Skip to main content
# 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).

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)

Source distribution for paraturegmailfeed 0.65
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

Release history Release notifications | RSS feed

This release

0.65 This release

1 release file

0.60

1 release file

0.50

1 release file

0.15

1 release file

0.10

1 release file

0.6.6

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page