# Parature Gmail Feed
## Description
The Parature Gmail Feed:
* Retrieves emails cc'd to a Gmail account originating from Parature
* Extracts Parature specific content from each email
* Creates a record from the extracted content
* Loads the record to a MongoDB database
## Installation
Install with pip
```
pip install paraturegmailfeed
```
**Project requires MongoDB**
[See MongoDB documentation for installation instructions](https://docs.mongodb.org/manual/installation/)
## Getting Started
### Setting up your config file
Create a new .py file. For example `my_config.py`
```
# Gmail API Variables
CLIENT_SECRET_FILE = 'Exported from your Google application account'
SCOPES = 'Scopes for your Google application'
APPLICATION_NAME = 'Name of your application'
USER_ID = 'YOUR EMAIL ACCOUNT USER ID'
TARGET_LABEL_QUERY = 'The label name '
# MongoDB Variables
MONGO_URI = 'YOUR DB URI'
DB_NAME = 'YOUR DB NAME'
```
### Example of usage:
```
from paraturegmailfeed import ParatureGmailFeed
def main():
feed = ParatureGmailFeed('my_config.py')
feed.run()
main()
```
### Running for the first time
Be sure to have `mongod` running.
You will be prompted to authorize the application to access your Gmail account.
After accepting, the application will run automatically.
[See official documentation for assistance](https://developers.google.com/gmail/api/quickstart/python)
## Design Decisions
### Why MongoDB?
* Flexible schema. As requirement grow/change the data schema can to!
* Native functionality. Simple upserts (unlike most SQL databses).
### How are duplicate records prevented?
* Gmail API message query is restricted to all messages that do NOT have the "Processed" label.
* The pymongo `update_one` method is used with the `upsert` option. This means that if a record already exists based on the composite key (ticket number and timestamp) the action will simply update the record (essentially do nothing).
## Description
The Parature Gmail Feed:
* Retrieves emails cc'd to a Gmail account originating from Parature
* Extracts Parature specific content from each email
* Creates a record from the extracted content
* Loads the record to a MongoDB database
## Installation
Install with pip
```
pip install paraturegmailfeed
```
**Project requires MongoDB**
[See MongoDB documentation for installation instructions](https://docs.mongodb.org/manual/installation/)
## Getting Started
### Setting up your config file
Create a new .py file. For example `my_config.py`
```
# Gmail API Variables
CLIENT_SECRET_FILE = 'Exported from your Google application account'
SCOPES = 'Scopes for your Google application'
APPLICATION_NAME = 'Name of your application'
USER_ID = 'YOUR EMAIL ACCOUNT USER ID'
TARGET_LABEL_QUERY = 'The label name '
# MongoDB Variables
MONGO_URI = 'YOUR DB URI'
DB_NAME = 'YOUR DB NAME'
```
### Example of usage:
```
from paraturegmailfeed import ParatureGmailFeed
def main():
feed = ParatureGmailFeed('my_config.py')
feed.run()
main()
```
### Running for the first time
Be sure to have `mongod` running.
You will be prompted to authorize the application to access your Gmail account.
After accepting, the application will run automatically.
[See official documentation for assistance](https://developers.google.com/gmail/api/quickstart/python)
## Design Decisions
### Why MongoDB?
* Flexible schema. As requirement grow/change the data schema can to!
* Native functionality. Simple upserts (unlike most SQL databses).
### How are duplicate records prevented?
* Gmail API message query is restricted to all messages that do NOT have the "Processed" label.
* The pymongo `update_one` method is used with the `upsert` option. This means that if a record already exists based on the composite key (ticket number and timestamp) the action will simply update the record (essentially do nothing).
Metadata
Release files for paraturegmailfeed 0.65
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| paraturegmailfeed-0.65.tar.gz | 5.7 kB | Details |
Release files / paraturegmailfeed-0.65.tar.gz
| Download URL | paraturegmailfeed-0.65.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3690f37abd9517dabe3f0a495b876c99d7b1d6c46ce98fa0dc925d377d8d1324
|
|
BLAKE2b-256 checksum How to use checksums |
43db348dee8d466c9c1d08d5ac8b503eb27158ba0f64ebe7a8a017ed257c70eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |