-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use enum wrapper for options Update README.md, requirements.txt and Dockerfile Release alpha version
- Loading branch information
1 parent
2f60c68
commit bd3b2fe
Showing
10 changed files
with
159 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,20 +27,29 @@ pip install gmail-connector | |
## Env Vars | ||
Environment variables can be loaded from any `.env` file. | ||
```bash | ||
# For authentication | ||
GMAIL_USER='[email protected]', | ||
GMAIL_PASS='<ACCOUNT_PASSWORD>' | ||
|
||
# For outbound SMS | ||
PHONE='1234567890' | ||
``` | ||
|
||
*Optionally `.env` files can also be scanned for:* | ||
<details> | ||
<summary><strong>Env variable customization</strong></summary> | ||
|
||
To load a custom `.env` file, set the filename as the env var `env_file` before importing `gmailconnector` | ||
```python | ||
import os | ||
os.environ['env_file'] = 'custom' # to load a custom .env file | ||
import gmailconnector as gc | ||
|
||
gc.load_env(scan=True) | ||
``` | ||
To avoid using env variables, arguments can be loaded during object instantiation. | ||
```python | ||
import gmailconnector as gc | ||
kwargs = dict(gmail_user='EMAIL_ADDRESS', | ||
gmail_pass='PASSWORD', | ||
encryption=gc.Encryption.SSL, | ||
timeout=5) | ||
email_obj = gc.SendEmail(**kwargs) | ||
``` | ||
</details> | ||
|
||
## Usage | ||
### [Send SMS](https://github.com/thevickypedia/gmail-connector/blob/master/gmailconnector/send_sms.py) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
idna>=3.3 | ||
python-dotenv>=0.21.0 | ||
pytz>=2021.3 | ||
dnspython==2.3.0 | ||
idna==3.* | ||
pytz==2023.* | ||
dnspython==2.4.2 | ||
pydantic[email]==2.4.* | ||
pydantic_settings==2.0.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.