Pipedrive is a sales pipeline software that gets you organized. It's a powerful sales CRM with effortless sales pipeline management. See www.pipedrive.com for details.
This is an unofficial Pipedrive API wrapper-client for Python 3.x based apps, distributed by Matumaros freely under the MIT licence. It provides you with basic functionality for operating with objects such as Deals, Persons, Organizations, Products and much more, without having to worry about the underlying networking stack and actual HTTPS requests. It is modelled in a similar way to the official client for Node.js
pip install -U pypedriver
pip install -U requests
pypedriver relies on the requests package.
With a pre-set API token:
from pypedriver import Client
pipedrive = Client('YOUR_API_TOKEN_HERE')
Here's a quick example that will list some deals from your Pipedrive account:
from pypedriver import Client
pipedrive = Client('YOUR_API_TOKEN_HERE')
deals = pipedrive.Deal.fetch_all()
for deal in deals:
print(deal.title, '(worth', deals.value, deals.currency + ')')
- Activity (Untested)
- ActivityType (Untested)
- Authorization (Untested)
- Currency (Untested)
- Deal (Untested)
- DealField (Untested)
- File (Untested)
- Filter (Untested)
- Note (Untested)
- Organization
- OrganizationField
- Person
- PersonField (Untested)
- Pipeline (Untested)
- Product (Untested)
- ProductField (Untested)
- SearchResult (Untested)
- Stage (Untested)
- User (Untested)
Client.authenticate(user='john@doe.com', password='example')
Fetches the possible API tokens for the given user against email and password. You can use the API tokens returned by this method to instantiate the API client by issuing pipedrive = Client('API_TOKEN_HERE')
or directly enter email and password by issuing pipedrive = Client(user='john@doe.com', password='example')
.
Note that the "Supported operations for object collections" part is omitted here, because it doesn't quite work the same way as for Node.js. By issuing
pipedrive.{Object}
, you get an object of that type in return and can issue all following methods on it. You can also build chains with all but thefetch
methods, because they return another object.
Returns a maximum of limit
objects as generator.
Returns the JSON response.
Returns as many objects as possible as generator.
Uses the current object as filter and returns a new object or an error if it found multiple matches.
Update an object.
Delete an object with a specifc ID.
Merge two objects of the same kind. Returns error
in case of an error to the callback. Merge is only supported for the following objects:
- Person
- Organization
- User
Adding a product to a deal is not supported yet.
Updating deal products is not supported yet.
Deleting a product from a deal is not supported yet.
Search for field value matches is not supported yet.
You can request all entries for an valid object using fetch_all(filter_id=None, start=0)
organizations = pipedrive.Organization.fetch_all()
You can request all entries for an valid object using a call on the Organization object.
organizations = pipedrive.Organization(open_deals_count=0).fetch_all()
from pypedriver import Client
pipedrive = Client(user='john@doe.com', password='example')
filter_list = list(pipedrive.Filter(type='deals').fetch_all())
if len(filter_list) > 0:
deals = pipedrive.Deal.fetch(
filter_id=filter_list[0].id,
limit=15,
)
for deal in deals:
print(deal.title, '(worth', deal.value, deal.currency + ')')
from pypedriver import Client
pipedrive = Client(user='john@doe.com', password='example')
pipedrive.Organization(id=5).complete()(id=None, owner_id=6).save()
The Pipedrive REST API documentation can be found at https://developers.pipedrive.com/v1
This Pipedrive API client is distributed under the MIT licence.