Python-outreach is a Python wrapper functions for Outreach APIs
Project description
outreach
Python wrapper functions for Outreach APIs, tested with Python 3.8 - 3.9.
This python client wrapper helps connects outreach API by authentication flow, any request use two distinct sets of credentials. The API key and secret identify the requester.
Quick Start
- Installation
- Dependent libraries The following dependent libraries were installed.
pip install singer-python pip install requests
- Install from pypi using pip
pip install python-outreach
- Clone this repository, and then install using setup.py. Recommend using a virtualenv:
> virtualenv -p python3 venv > source venv/bin/activate > python setup.py install OR > cd .../python-outreach > pip install .
- Set the environment variables,
refresh_token
,redirect_uri
,client_id
, andclient_secret
are the credentials need to set for outreach client. More details for Authentication is hereexport client_id=<Application_Identifier> export client_secret=<Application_Secret> export redirect_uri=<Application_Redirect_URI> export refresh_token=<Refresh_Token>
- To work with the API client, we start with the
OutreachClient
class:connect_config = { 'user_agent': '', 'client_id': environ['OUTREACH_CLIENT_ID'], 'client_secret': environ['OUTREACH_CLIENT_SECRET'], 'redirect_uri': environ['OUTREACH_REDIRECT_URI'], 'refresh_token': environ['OUTREACH_REFRESH_TOKEN'], 'quota_limit': 9999 } or_client = OutreachClient(connect_config)
- To Fetch prospects by email address or prospect id use
or_client.get(path=f'prospects?filter[emails]={:email}') # or or_client.get(path=f'prospects/{:id}')
- To Create new prospects or update existing
# To Create New or_client.post(path=f'prospects', json={ "data": { "type": "prospect", "attributes": {:Prospect_rec_attributes key:value} } }) # For update or_client.update(path=f'prospects/{prospect_id}', json={ "data": { "type": "prospect", "id": int(prospect_id), "attributes": prospect_rec } })
Feature requests
To request a new feature in this package, please open a new issue on the Github repo. To report problems, please open a new issue on the Github repo.
Contribution
Pull requests are welcomed! All pull requests must have the following:
- OK global score from pylint using PEP8 standards
- This one is a bit loose for now given that the old code is still a mess; once the renovation is complete, we will implement a minimum passing pylint score
- Passing unit tests (nosetests) that cover the included use cases and pass the current tox config
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-outreach-0.0.4.tar.gz
(4.4 kB
view hashes)
Built Distributions
Close
Hashes for python_outreach-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8592b9a7c4b885b35883ef37da2aef12d978221a83f02c6330738217c189340a |
|
MD5 | f4003e18a1e0414e921b314acbc56c2e |
|
BLAKE2b-256 | c548c11a939a0936c2ca8e61fb1c3482a4e44806ac884b89a7ce8865fc4e4892 |
Close
Hashes for python_outreach-0.0.4-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a931d461feac7daadb03cd4ba4c94fe0de14b70429429e817cc7f1d2b70d72e4 |
|
MD5 | 40012e8074e08f695c80443f702a1e75 |
|
BLAKE2b-256 | c98e9106b1fbcee5d1b2cb59595af6ec8f67c9841de81ea1dbedc0e4cbe2af8f |