Skip to main content

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

  1. Installation
    1. Dependent libraries The following dependent libraries were installed.

    pip install singer-python pip install requests

    1. Install from pypi using pip

    pip install python-outreach

    1. 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 .
    
  2. Set the environment variables, refresh_token, redirect_uri, client_id, and client_secret are the credentials need to set for outreach client. More details for Authentication is here
    export client_id=<Application_Identifier>
    export client_secret=<Application_Secret>
    export redirect_uri=<Application_Redirect_URI>
    export refresh_token=<Refresh_Token>
    
  3. 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)
    
  4. 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}')
    
  5. 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


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.1.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

python_outreach-0.1.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

python_outreach-0.1.0-py2-none-any.whl (5.0 kB view details)

Uploaded Python 2

File details

Details for the file python-outreach-0.1.0.tar.gz.

File metadata

  • Download URL: python-outreach-0.1.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for python-outreach-0.1.0.tar.gz
Algorithm Hash digest
SHA256 31902cd1e56cfd9709dd2994416c35eacfc761f8d07025af17e1c9572edb29c0
MD5 4b6f8ede5ef470ccedccc4a88483eb78
BLAKE2b-256 42ad01665739694b3ef25ba78fc3d4f18c36087d8bb082c83061d36194f5e345

See more details on using hashes here.

File details

Details for the file python_outreach-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: python_outreach-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for python_outreach-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2410f3b25da289c4dd44fb98129f64f85150283d313afe9c4a0ad1ecb3888258
MD5 84ea8aaa83b2b2b1a78e6db6e868f60e
BLAKE2b-256 a9d3a86160dc3c0f55a7cc6b1d8045e8b38f76b12cbd1c797008064aa8b3b44d

See more details on using hashes here.

File details

Details for the file python_outreach-0.1.0-py2-none-any.whl.

File metadata

  • Download URL: python_outreach-0.1.0-py2-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for python_outreach-0.1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 b11f1749504a9941aa7fcf111b4c43165396ccfb59d813b7288e3b7af4327353
MD5 2a07956e590f72fd0f67b241ff87d014
BLAKE2b-256 f30e63856888d65b69177ae4a86ecd8efeef44aae02920bcde4c09b4f33a8b93

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page