Package: pipedrive-python-lib
pipedrive-pythonpipedrive-pythonis an API wrapper forPipedrivewritten in Python.Installingpip install pipedrive-python-libUsageUsing this library with OAuth 2.0Client instantiationfrompipedrive.clientimportClientclient=Client('CLIENT_ID','CLIENT_SECRET')Get authorization urlurl=client.authorization_url('REDIRECT_URL')Exchange the code for an access tokentoken=client.exchange_code('REDIRECT_URL','CODE')Set access token in the libraryclient.set_access_token('ACCESS_TOKEN')Refresh tokentoken=client.refresh_token('REFRESH_TOKEN')Using this library with API TokenClient instantiationfrompipedrive.clientimportClientclient=Client(domain='https://companydomain.pipedrive.com/')Set API token in the libraryclient.set_api_token('API_TOKEN')ActivitiesAPI docs:https://developers.pipedrive.com/docs/api/v1/ActivitiesGet an activityresponse=client.activities.get_activity('ACTIVITY_ID')Get all activitiesresponse=client.activities.get_all_activities()Create an activitydata={'subject':'','type':''}response=client.activities.create_activity(data)Update an activitydata={'subject':'','type':''}response=client.activities.update_activity('ACTIVITY_ID',data)Delete an activityresponse=client.activities.delete_activity('ACTIVITY_ID')Get activity fieldsresponse=client.activities.get_activity_fields()DealsAPI docs:https://developers.pipedrive.com/docs/api/v1/DealsGet a dealresponse=client.deals.get_deal('DEAL_ID')Get all dealsresponse=client.deals.get_all_deals()Get all deals based on filterresponse=client.deals.get_all_deals_with_filter('FILTER_ID')Create dealdata={'title':''}response=client.deals.create_deal(data)Update dealdata={'title':''}response=client.deals.update_deal('DEAL_ID',data)Delete dealresponse=client.deals.delete_deal('DEAL_ID')Duplicate dealresponse=client.deals.duplicate_deal('DEAL_ID')Get details of a dealresponse=client.deals.get_deal_details('DEAL_ID')Search dealsparams={'term':''}response=client.deals.search_deals(params=params)Get followers of a dealresponse=client.deals.get_deal_followers('DEAL_ID')Add a follower to a dealresponse=client.deals.add_follower_to_deal('DEAL_ID','USER_ID')Delete a follower from a dealresponse=client.deals.delete_follower_to_deal('DEAL_ID','FOLLOWER_ID')Get participants of a dealresponse=client.deals.get_deal_participants('DEAL_ID')Add a participant to a dealresponse=client.deals.add_participants_to_deal('DEAL_ID','PERSON_ID')Delete a participant from a dealresponse=client.deals.delete_participant_to_deal('DEAL_ID','PARTICIPANT_ID')Get activities associated with a dealresponse=client.deals.get_deal_activities('DEAL_ID')Get mail messages associated with a dealresponse=client.deals.get_deal_mail_messages('DEAL_ID')Get products attached to a dealresponse=client.deals.get_deal_products('DEAL_ID')Get deal fieldsresponse=client.deals.get_deal_fields()Get updates of a dealresponse=client.deals.get_deal_updates('DEAL_ID')FiltersAPI docs:https://developers.pipedrive.com/docs/api/v1/FiltersGet a filterresponse=client.filters.get_filter('FILTER_ID')Get all filtersresponse=client.filters.get_all_filters()Create filterdata={'name':'','conditions':{},'type':''}response=client.filters.create_filter(data)Update filterdata={'name':'','conditions':{},'type':''}response=client.filters.update_filter('FILTER_ID',data)Delete filterresponse=client.filters.delete_filter('FILTER_ID')NotesAPI docs:https://developers.pipedrive.com/docs/api/v1/NotesGet a noteresponse=client.notes.get_note('NOTE_ID')Get all notesresponse=client.notes.get_all_notes()Add a notedata={'content':''}response=client.notes.create_note(data)Update a notedata={'content':''}response=client.notes.update_note('NOTE_ID',data)Delete a noteresponse=client.notes.delete_note('NOTE_ID')Get note fieldsresponse=client.notes.get_note_fields()OrganizationsAPI docs:https://developers.pipedrive.com/docs/api/v1/OrganizationsGet an organizationresponse=client.organizations.get_organization('ORGANIZATION_ID')Get all organizationsresponse=client.organizations.get_all_organizations()Search organizationsparams={'term':''}response=client.products.search_organizations(params=params)Add organizationdata={'name':''}response=client.organizations.create_organization(data)Update organizationdata={'name':''}response=client.organizations.update_organization('ORGANIZATION_ID',data)Delete an organizationresponse=client.organizations.delete_organization('ORGANIZATION_ID')Get organization fieldsresponse=client.organizations.get_organization_fields()PersonsAPI docs:https://developers.pipedrive.com/docs/api/v1/PersonsGet a personresponse=client.persons.get_person('PERSON_ID')Get all personsresponse=client.persons.get_all_persons()Search personsparams={'term':''}response=client.persons.search_persons(params=params)Create persondata={'name':''}response=client.persons.create_person(data)Update persondata={'name':''}response=client.persons.update_person('PERSON_ID',data)Delete personresponse=client.persons.delete_person('PERSON_ID')Get deals associated with a personresponse=client.persons.get_person_deals('PERSON_ID')Get person fieldsresponse=client.persons.get_person_fields()PipelinesAPI docs:https://developers.pipedrive.com/docs/api/v1/PipelinesGet a pipelineresponse=client.pipelines.get_pipeline('PIPELINE_ID')Get all pipelinesresponse=client.pipelines.get_all_pipelines()Get deals attached to a pipelineresponse=client.pipelines.get_pipeline_deals()ProductsAPI docs:https://developers.pipedrive.com/docs/api/v1/ProductsGet a productresponse=client.products.get_product('PRODUCT_ID')Get all productsresponse=client.products.get_all_products()Search productsparams={'term':''}response=client.products.search_products(params=params)Create a productdata={'name':''}response=client.products.create_product(data)Update a productdata={'name':''}response=client.products.update_product('PRODUCT_ID',data)Delete a productresponse=client.products.delete_product('PRODUCT_ID')Get deals where a product is attached toresponse=client.products.get_product_deal('PRODUCT_ID')Get product fieldsresponse=client.products.get_product_fields()RecentsGet recent changesparams={'since_timestamp':'YYYY-MM-DD HH:MM:SS'}response=client.recents.get_recent_changes(params=params)LeadsAPI docs:https://developers.pipedrive.com/docs/api/v1/LeadsGet a leadresponse=client.leads.get_lead('LEAD_ID')Search leadsparams={'term':''}response=client.leads.search_leads(params=params)UsersAPI docs:https://developers.pipedrive.com/docs/api/v1/UsersGet an userresponse = client.users.get_user('USER_ID')Get all usersresponse = client.users.get_all_users()Get meresponse = client.users.get_me()WebhookAPI docs:https://developers.pipedrive.com/docs/api/v1/WebhooksGet webhooksresponse = client.webhooks.get_hooks_subscription()Add webhookdata = {
    'subscription_url': '',
    'event_action': '',
    'event_object': ''
}
response = client.webhooks.create_hook_subscription(data)Delete webhookresponse = client.webhooks.delete_hook_subscription('HOOK_ID')RequirementsrequestsContributingWe 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 newissue.If you want to add yourself some functionality to the wrapper: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