Skip to content

Commit 1458ebc

Browse files
committed
Change name of the project
1 parent 8504369 commit 1458ebc

16 files changed

+74
-74
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ifeq ($(env),venv)
1414
DEACTIVATE_COMMAND="deactivate"
1515
else
1616
# Use Conda
17-
BASE=~/anaconda3/envs/py_emailer
17+
BASE=~/anaconda3/envs/pyemail_sender
1818
BIN=$(BASE)/bin
1919
CREATE_COMMAND="conda create --prefix $(BASE) python=$(PYTHON_VERSION) -y"
2020
DELETE_COMMAND="conda env remove -p $(BASE)"

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Python Emailer
22

3-
[![CircleCI](https://circleci.com/gh/drkostas/py-emailer/tree/master.svg?style=svg)](https://circleci.com/gh/drkostas/py-emailer/tree/master)
4-
[![GitHub license](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/drkostas/py-emailer/master/LICENSE)
3+
[![CircleCI](https://circleci.com/gh/drkostas/pyemail-sender/tree/master.svg?style=svg)](https://circleci.com/gh/drkostas/pyemail-sender/tree/master)
4+
[![GitHub license](https://img.shields.io/badge/license-Apache-blue.svg)](https://github.com/drkostas/pyemail-sender/master/LICENSE)
55

66
## About <a name = "about"></a>
77

88
A utility for sending emails with attachments. Currently only Gmail
9-
is supported. [PYPI Package](https://pypi.org/project/py-emailer/)
9+
is supported. [PYPI Package](https://pypi.org/project/pyemail-sender/)
1010

1111
## Table of Contents
1212

@@ -24,7 +24,7 @@ is supported. [PYPI Package](https://pypi.org/project/py-emailer/)
2424
## Using the library <a name = "using"></a>
2525

2626
For a detailed usage example see
27-
[example.py](https://github.com/drkostas/py-emailer/master/example.py).
27+
[example.py](https://github.com/drkostas/pyemail-sender/master/example.py).
2828

2929
You will need an application-specific password for your Google account.
3030
[Reference 1](https://support.google.com/mail/?p=InvalidSecondFactor),
@@ -35,31 +35,31 @@ You will need an application-specific password for your Google account.
3535
First, you need to install the library using pip:
3636

3737
```shell
38-
$ pip install py_emailer
38+
$ pip install pyemail_sender
3939
```
4040

4141
Then, import it and initialize it like so:
4242

4343
```python
44-
from py_emailer import GmailPyEmailer
44+
from pyemail_sender import GmailPyEmailSender
4545

4646
email_conf = {'type': 'gmail',
4747
'config': {'api_key': 'your api key', 'email_address': 'youremail@gmail.com'}}
48-
pymail = GmailPyEmailer(config=email_conf)
48+
pymail = GmailPyEmailSender(config=email_conf)
4949
```
5050

51-
If you want to use a yml file to load the configuration, you can use the `PyEmailerConfig` class:
51+
If you want to use a yml file to load the configuration, you can use the `PyEmailSenderConfig` class:
5252
```python
53-
from py_emailer import PyEmailerConfig
53+
from pyemail_sender import PyEmailSenderConfig
5454
import os
5555

5656
config_path = str(os.path.join('confs', 'conf.yml'))
57-
config = PyEmailerConfig(config_src=config_path)
58-
email_conf = config.get_pyemailer_config()
57+
config = PyEmailSenderConfig(config_src=config_path)
58+
email_conf = config.get_pyemail_sender_config()
5959
```
6060

6161
Two example YAML files can be found in
62-
the [confs folder](https://github.com/drkostas/py-emailer/blob/master/confs).
62+
the [confs folder](https://github.com/drkostas/pyemail-sender/blob/master/confs).
6363
For more details on how to use this YAML configuration loader see
6464
this [Readme](https://github.com/drkostas/yaml-config-wrapper/blob/master/README.md).
6565

@@ -91,7 +91,7 @@ pymail.send_email(subject='Email with all possible arguments',
9191
```
9292

9393
All of these examples can be found
94-
in [example.py](https://github.com/drkostas/py-emailer/tree/blob/master/example.py).
94+
in [example.py](https://github.com/drkostas/pyemail-sender/tree/blob/master/example.py).
9595

9696
## Manually install the library <a name = "manual_install"></a>
9797

@@ -117,16 +117,16 @@ $ echo $SHELL
117117
### Install the requirements <a name = "installing_req"></a>
118118

119119
All the installation steps are being handled by
120-
the [Makefile](https://github.com/drkostas/py-emailer/blob/master/Makefile).
120+
the [Makefile](https://github.com/drkostas/pyemail-sender/blob/master/Makefile).
121121

122122
First, modify the python version (`min_python`) and everything else you need in
123-
the [settings.ini](https://github.com/drkostas/py-emailer/blob/master/settings.ini).
123+
the [settings.ini](https://github.com/drkostas/pyemail-sender/blob/master/settings.ini).
124124

125125
Then, execute the following commands:
126126

127127
```ShellSession
128128
$ make create_env
129-
$ conda activate py_emailer
129+
$ conda activate pyemail_sender
130130
$ make dist
131131
```
132132

@@ -146,7 +146,7 @@ For the continuous integration, the <b>CircleCI</b> service is being used. For m
146146
check the [setup guide](https://circleci.com/docs/2.0/language-python/).
147147

148148
For any modifications, edit
149-
the [circleci config](https://github.com/drkostas/py-emailer/blob/master/.circleci/config.yml).
149+
the [circleci config](https://github.com/drkostas/pyemail-sender/blob/master/.circleci/config.yml).
150150

151151
## Update PyPI package <a name = "pypi"></a>
152152

@@ -161,13 +161,13 @@ password = your_pypi_password
161161

162162
Then, modify the python version (`min_python`), project status (`status`), release version (`version`)
163163
and everything else you need in
164-
the [settings.ini](https://github.com/drkostas/py-emailer/blob/master/settings.ini).
164+
the [settings.ini](https://github.com/drkostas/pyemail-sender/blob/master/settings.ini).
165165

166166
Finally, execute the following commands:
167167

168168
```ShellSession
169169
$ make create_env
170-
$ conda activate py_emailer
170+
$ conda activate pyemail_sender
171171
$ make release
172172
```
173173

@@ -176,6 +176,6 @@ For a dev release, change the `testing_version` and instead of `make release`, r
176176
## License <a name = "license"></a>
177177

178178
This project is licensed under the MIT License - see
179-
the [LICENSE](https://github.com/drkostas/py-emailer/blob/master/LICENSE) file for details.
179+
the [LICENSE](https://github.com/drkostas/pyemail-sender/blob/master/LICENSE) file for details.
180180

181181
<a href="https://www.buymeacoffee.com/drkostas" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

confs/conf.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tag: test
2-
py-emailer:
2+
pyemail-sender:
33
- config:
44
email_address: Your Name <youremail@gmail.com>
55
api_key: your-api-key

confs/conf_with_env_vars.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tag: test
2-
py-emailer:
2+
pyemail-sender:
33
- config:
44
email_address: !ENV ${EMAIL_ADDRESS}
55
api_key: !ENV ${GMAIL_API_KEY}

env_example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# You should create a new file with ".env" name or something similar and NOT include it in your git
2-
export EMAIL_ADDRESS="Your Name <youremail@gmail.com>"
2+
export EMAIL_ADDRESS=Your Name <youremail@gmail.com>
33
export GMAIL_API_KEY=your-api-key

example.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# pip install py-emailer
1+
# pip install pyemail-sender
22
import os
3-
from py_emailer import GmailPyEmailer, PyEmailerConfig, ColorLogger
3+
from pyemail_sender import GmailPyEmailSender, PyEmailSenderConfig, ColorLogger
44

55
# Setup Logger
66
log = ColorLogger(logger_name='Example', color='yellow')
@@ -10,15 +10,15 @@
1010
# 'config': {'api_key': 'your api key', 'email_address': 'youremail@gmail.com'}}
1111
# config_path = os.path.join('confs', 'conf.yml')
1212
config_path = os.path.join('confs', 'conf_with_env_vars.yml')
13-
config = PyEmailerConfig(config_src=config_path)
14-
email_conf = config.get_pyemailer_config()
13+
config = PyEmailSenderConfig(config_src=config_path)
14+
email_conf = config.get_pyemail_sender_config()
1515
# Check for errors
1616
if email_conf['type'] != 'gmail':
1717
raise Exception(f"{email_conf['type']} not yet supported!")
1818
if email_conf['config']['api_key'] == 'GMAIL_API_KEY':
1919
raise Exception("You are trying to use environmental variables but they are not loaded!")
2020
# Initialize handler
21-
pymail = GmailPyEmailer(config=email_conf['config'])
21+
pymail = GmailPyEmailSender(config=email_conf['config'])
2222
# Create a test file
2323
with open('my_file.txt', 'w') as fp:
2424
fp.write('blank')

py_emailer/__init__.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

pyemail_sender/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
"""pyemail-sender package"""
2+
3+
from .gmail_pyemail_sender import GmailPyEmailSender
4+
from .pyemail_sender_config import PyEmailSenderConfig
5+
from termcolor_logger import ColorLogger
6+
7+
__author__ = "drkostas"
8+
__email__ = "georgiou.kostas94@gmail.com"
9+
__version__ = "1.0.1"

py_emailer/abstract_pyemailer.py renamed to pyemail_sender/abstract_pyemail_sender.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from abc import ABC, abstractmethod
22

33

4-
class AbstractPyEmailer(ABC):
4+
class AbstractPyEmailSender(ABC):
55
__slots__ = ('_handler',)
66

77
@abstractmethod
@@ -17,7 +17,7 @@ def __init__(self, *args, **kwargs) -> None:
1717
@abstractmethod
1818
def get_handler(*args, **kwargs):
1919
"""
20-
Returns an PyEmailer handler.
20+
Returns an PyEmailSender handler.
2121
2222
:param args:
2323
:param kwargs:

py_emailer/gmail_pyemailer.py renamed to pyemail_sender/gmail_pyemail_sender.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from typing import List, Dict
22
from gmail import GMail, Message
33
from termcolor_logger import ColorLogger
4-
from .abstract_pyemailer import AbstractPyEmailer
4+
from .abstract_pyemail_sender import AbstractPyEmailSender
55

6-
logger = ColorLogger('GmailPyEmailer')
6+
logger = ColorLogger('GmailPyEmailSender')
77

88

9-
class GmailPyEmailer(AbstractPyEmailer):
9+
class GmailPyEmailSender(AbstractPyEmailSender):
1010
__slots__ = ('_handler', 'email_address', 'test_mode')
1111

1212
_handler: GMail

0 commit comments

Comments
 (0)