Skip to main content

The Python Pipedrive API Helper

Project description

Pipedrive REST API Helper

This is a helper library for Pipedrive's rest API. At the moment, the helper is capable of Add, Update, and Delete for Persons, Products, and Deals.

This library is available in pypi.org to install:

python -m pip install pypedrive-helper

Getting Started

Install all libraries in requirements.txt

To install: There is only one requirement for the moment, that is the request library.

pip install -r requirements.txt

To start using the class the after installing:

from pypedrivehelper.helper import PipedriveHelper

Prerequisites

Your Pipedrive API Token is required to use all the methods of this helper.

Provide an API token when creating an insance of the PipedriveHelper class, in str format.

Sample Usage

When creating an instance of a class, provide the API token of type str.

pipedrive_api = PipedriveHelper(api_key)

When using functions. Provide the parameters of type dict. For details of function usage refer to the docstrings.

data = {
    "title": "test title 2"
  }

pipedrive_api.add_deal(data)

Doc Strings

The information below can also be found within the library as docstrings. Use help() to view them.

A class that simplifies the use of the Pipedrive REST API

    ...
    Constructors
    ----------
    api_token : str
        your pipedrive api token.

    Attributes
    ----------
    product_url : str
        api url for all product methods
    person_url : str
        api url for all product methods
    deal_url : str
        api url for all deal methods
    org_url : str
        api url for all org methods
    person_fields_url : str
        api url for all personfield methods
    product_fields_url : str
        api url for all productfield methods
    deal_fields_url : str
        api url for all dealfield methods
    org_fields_url : str
        api url for all orgfield methods

    Methods
    -------
    add_person(self, person_args: dict) returns dict
        Add a single person to contacts in Piprdrive
    add_product(self, product_args: dict) returns dict
        Add a single person to products in Piprdrive
    update_product(self, product_args: dict, product_id: str) returns dict
        Updates an existing product in Pipedrive.
    delete_product(self, product_id: str) returns dict
        Deletes an existing product in Pipedrive.

Add Person

Adds a single contact in Pipedrive. Returns REST result status and API rate limit info.

Parameters
        ----------
        person_args : dict
            Values for each column for a single contact. Accepts default fields and custom fields.

        Usage
        ----------
            data = {
              "name": Luke, # where "name" is a sample of a default field
              "74f20ffc505c9708d4f0958333b0cc1df74a2ee9": 92, # where "74f20ffc505c970..." is a sample of custom field
            }

Update Person

Updates an existing contact in Pipedrive. Returns REST result status and API rate limit info.

Parameters
        ----------
        person_args : dict
            Values for each column for a single contact. Accepts default fields and custom fields.
        product_id : str
            Pipedrive product id

        Usage
        ----------
            Only add the fields/customfields you want to update.

              data = {
                "name": John, # where "name" is a sample of a default field
                "74f20ffc505c9708d4f0958333b0cc1df74a2ee9": 92, # where "74f20ffc505c970..." is a sample of a custom field
                }
              update_product(data, "1")

Delete Person

Deletes an existing contact in Pipedrive. Returns REST result status and API rate limit info.

Parameters
        ----------
        person_id : str
            Pipedrive person id

        Usage
        ----------
            delete_person("1") # where "1" is the pipedrive person id

Add Product

Add a single row to products in Piprdrive. Returns API call status and API rate limit info.

Parameters
        ----------
        product_args : dict
            Values for each column for a single contact. Accepts default fields and custom fields.

        Usage
        ----------
            data = {
              "name": "SCPH-90006", # where "name" is a sample of a default field
              "74f20ffc505c9708d4f0958333b0cc1df74a2ee9": 92, # where "74f20ffc505c970..." is a sample of custom field
              }
            add_product(data)

Update Product

Updates an existing product in Pipedrive.Returns REST result status and API rate limit info.

Parameters
        ----------
        product_args : dict
            Values for each column for a single contact. Accepts default fields and custom fields.
        product_id : str
            Pipedrive product id

        Usage
        ----------
            Only add the fields/customfields you want to update.

              data = {
                "name": "SCPH-90006", # where "name" is a sample of a default field
                "74f20ffc505c9708d4f0958333b0cc1df74a2ee9": 92, # where "74f20ffc505c970..." is a sample of a custom field
                }
              update_product(data, "1")

Delete Product

Deletes an existing product in Pipedrive. Returns REST result status and API rate limit info.

Parameters
        ----------
        product_id : str
            Pipedrive product id

        Usage
        ----------
            delete_product("1") # where "1" is the pipedrive product id

Add Deal

Creates a single deal to Pipedrive. Returns REST result status and API rate limit info.

Parameters
        ----------
        deal_args : dict
            Values for each column for a single deal. Accepts default fields and custom fields.

        Usage
        ----------
            data = {
              "title": John's Deal, # where "name" is a sample of a default field
              "74f20ffc505c9708d4f0958333b0cc1df74a2ee9": 92, # where "74f20ffc505c970..." is a sample of custom field
            }

Update Deal

Updates an existing deal in Pipedrive.Returns REST result status and API rate limit info.

Parameters
        ----------
        deal_args : dict
            Values for each column for a single deal. Accepts default fields and custom fields.

        Usage
        ----------
            data = {
              "title": John's Deal, # where "name" is a sample of a default field
              "74f20ffc505c9708d4f0958333b0cc1df74a2ee9": 92, # where "74f20ffc505c970..." is a sample of custom field
            }

Delete Deal

Deletes an existing deal in Pipedrive. Returns REST result status and API rate limit info.

Parameters
        ----------
        deal_id : str
            Pipedrive product id

        Usage
        ----------
            delete_deal("1") # where "1" is the pipedrive product id

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License

MIT License

Copyright (c) 2020 Kristan Sangalang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE

Acknowledgments

  • To pipedrive for the opportunity to create this module
  • To my mentor for inspiring me to be better

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

pypedrive-helper-1.0.2.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

pypedrive_helper-1.0.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pypedrive-helper-1.0.2.tar.gz.

File metadata

  • Download URL: pypedrive-helper-1.0.2.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for pypedrive-helper-1.0.2.tar.gz
Algorithm Hash digest
SHA256 caa4e8a49694cafb250d58f4c98d0ac8f0c844d98dabf020823aa8c1680aefde
MD5 b02da86299f67f882df0d0f5e571b629
BLAKE2b-256 820e9e497b20b4bf6333144e06d1b75a331d04794e2a9fa73404d0e30d70c096

See more details on using hashes here.

File details

Details for the file pypedrive_helper-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: pypedrive_helper-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.1 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for pypedrive_helper-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 98dc03cb0fcbf73c3a56674f689e2fa1f3e3d8338e44ac1b41c096b5cc5af524
MD5 f994cb9274ba394d975f5df9eaf28a13
BLAKE2b-256 635f842e5e3df4c599f9c6f26be2feff71ce97c8a982fbc98dccb82e378808c1

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