pipedrive-python is an API wrapper for Pipedrive written in Python.
pip install pipedrive-python-lib
from pipedrive.client import Client
client = Client('CLIENT_ID', 'CLIENT_SECRET')
url = client.authorization_url('REDIRECT_URL')
token = client.exchange_code('REDIRECT_URL', 'CODE')
client.set_access_token('ACCESS_TOKEN')
token = client.refresh_token('REFRESH_TOKEN')
from pipedrive.client import Client
client = Client(domain='https://companydomain.pipedrive.com/')
client.set_api_token('API_TOKEN')
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Activities
response = client.activities.get_activity('ACTIVITY_ID')
response = client.activities.get_all_activities()
data = {
'subject': '',
'type': ''
}
response = client.activities.create_activity(data)
data = {
'subject': '',
'type': ''
}
response = client.activities.update_activity('ACTIVITY_ID', data)
response = client.activities.delete_activity('ACTIVITY_ID')
response = client.activities.get_activity_fields()
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Deals
response = client.deals.get_deal('DEAL_ID')
response = client.deals.get_all_deals()
response = client.deals.get_all_deals_with_filter('FILTER_ID')
data = {
'title': ''
}
response = client.deals.create_deal(data)
data = {
'title': ''
}
response = client.deals.update_deal('DEAL_ID', data)
response = client.deals.delete_deal('DEAL_ID')
response = client.deals.duplicate_deal('DEAL_ID')
response = client.deals.get_deal_details('DEAL_ID')
params = {
'term': ''
}
response = client.deals.search_deals(params=params)
response = client.deals.get_deal_followers('DEAL_ID')
response = client.deals.add_follower_to_deal('DEAL_ID', 'USER_ID')
response = client.deals.delete_follower_to_deal('DEAL_ID', 'FOLLOWER_ID')
response = client.deals.get_deal_participants('DEAL_ID')
response = client.deals.add_participants_to_deal('DEAL_ID', 'PERSON_ID')
response = client.deals.delete_participant_to_deal('DEAL_ID', 'PARTICIPANT_ID')
response = client.deals.get_deal_activities('DEAL_ID')
response = client.deals.get_deal_mail_messages('DEAL_ID')
response = client.deals.get_deal_products('DEAL_ID')
response = client.deals.get_deal_fields()
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Filters
response = client.filters.get_filter('FILTER_ID')
response = client.filters.get_all_filters()
data = {
'name': '',
'conditions': {},
'type': ''
}
response = client.filters.create_filter(data)
data = {
'name': '',
'conditions': {},
'type': ''
}
response = client.filters.update_filter('FILTER_ID', data)
response = client.filters.delete_filter('FILTER_ID')
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Notes
response = client.notes.get_note('NOTE_ID')
response = client.notes.get_all_notes()
data = {
'content': ''
}
response = client.notes.create_note(data)
data = {
'content': ''
}
response = client.notes.update_note('NOTE_ID', data)
response = client.notes.delete_note('NOTE_ID')
response = client.notes.get_note_fields()
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Organizations
response = client.organizations.get_organization('ORGANIZATION_ID')
response = client.organizations.get_all_organizations()
params = {
'term': ''
}
response = client.products.search_organizations(params=params)
data = {
'name': ''
}
response = client.organizations.create_organization(data)
data = {
'name': ''
}
response = client.organizations.update_organization('ORGANIZATION_ID', data)
response = client.organizations.delete_organization('ORGANIZATION_ID')
response = client.organizations.get_organization_fields()
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Persons
response = client.persons.get_person('PERSON_ID')
response = client.persons.get_all_persons()
params = {
'term': ''
}
response = client.persons.search_persons(params=params)
data = {
'name': ''
}
response = client.persons.create_person(data)
data = {
'name': ''
}
response = client.persons.update_person('PERSON_ID', data)
response = client.persons.delete_person('PERSON_ID')
response = client.persons.get_person_deals('PERSON_ID')
response = client.persons.get_person_fields()
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Pipelines
response = client.pipelines.get_pipeline('PIPELINE_ID')
response = client.pipelines.get_all_pipelines()
response = client.pipelines.get_pipeline_deals()
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Products
response = client.products.get_product('PRODUCT_ID')
response = client.products.get_all_products()
params = {
'term': ''
}
response = client.products.search_products(params=params)
data = {
'name': ''
}
response = client.products.create_product(data)
data = {
'name': ''
}
response = client.products.update_product('PRODUCT_ID', data)
response = client.products.delete_product('PRODUCT_ID')
response = client.products.get_product_deal('PRODUCT_ID')
response = client.products.get_product_fields()
params = {
'since_timestamp': 'YYYY-MM-DD HH:MM:SS'
}
response = client.recents.get_recent_changes(params=params)
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Users
response = client.users.get_user('USER_ID')
response = client.users.get_all_users()
response = client.users.get_me()
API docs: https://developers.pipedrive.com/docs/api/v1/#!/Webhooks
response = client.webhooks.get_hooks_subscription()
data = {
'subscription_url': '',
'event_action': '',
'event_object': ''
}
response = client.webhooks.create_hook_subscription(data)
response = client.webhooks.delete_hook_subscription('HOOK_ID')
- requests
We are always grateful for any kind of contribution including but not limited to bug reports, code enhancements, bug fixes, and even functionality suggestions.
You can report any bug you find or suggest new functionality with a new issue.
- Fork it ( https://github.com/GearPlug/pipedrive-python )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Adds my new feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request