Skip to main content

A lightweight Python SDK for the Pipedrive API, built with `httpx`.

Project description

Pipedrive API

A lightweight Python SDK for the Pipedrive API, built with httpx.

Installation

pip install pipedrive-api

Usage

from pipedrive import Pipedrive

pipedrive = Pipedrive(domain="yourcompany", api_token="your-api-token")

# Deals
pipedrive.deals.list()
pipedrive.deals.get(123)

Or use as a context manager:

with Pipedrive(domain="yourcompany", api_token="your-api-token") as pipedrive:
    deals = pipedrive.deals.list()

Authentication

Authenticate using your Pipedrive API token. You can find it in Pipedrive under Settings → Personal preferences → API.

It is recommended to load credentials from environment variables rather than hardcoding them:

import os

pipedrive = Pipedrive(
    domain=os.environ["PIPEDRIVE_DOMAIN"],
    api_token=os.environ["PIPEDRIVE_API_TOKEN"],
)

Pagination

.list() returns a single page of results. Use .stream() to automatically paginate through all results, yielding one item at a time:

for deal in pipedrive.deals.stream():
    print(deal["id"])

This works on all endpoints that support listing:

for org in pipedrive.organizations.stream():
    ...

for person in pipedrive.persons.stream():
    ...

You can pass the same filtering parameters as .list():

for deal in pipedrive.deals.stream(status="open", limit=50):
    print(deal["title"])

To collect all results into a list:

all_deals = list(pipedrive.deals.stream())

Error Handling

All non-2xx responses raise a PipedriveError with a status_code attribute:

from pipedrive import Pipedrive, PipedriveError

try:
    pipedrive.deals.get(999)
except PipedriveError as e:
    print(e.status_code)  # e.g. 404

Version History

Complete version history available in the CHANGELOG.md

Docs

Full API documentation can be found on GitHub Pages

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

pipedrive_api-0.11.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

pipedrive_api-0.11.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file pipedrive_api-0.11.0.tar.gz.

File metadata

  • Download URL: pipedrive_api-0.11.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pipedrive_api-0.11.0.tar.gz
Algorithm Hash digest
SHA256 778a55dea8cbfdc0afa5e1d3d86145dbfc4010085aeb84831eead26ab2331223
MD5 6f8416246c5969b72422579b67d0cca9
BLAKE2b-256 2f9594a38f2e754575bb480b8bad54bf14deb8c0e7f604ed0d7b013439aca4e2

See more details on using hashes here.

File details

Details for the file pipedrive_api-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: pipedrive_api-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pipedrive_api-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ca4e72444c3d711f4ca64d3592e49ac1a2a2296d4fc5798ee6469d36040093b1
MD5 ac82dda1f5d0a3d45b9bfbdcf48034a2
BLAKE2b-256 28ab05f268036279233ce007f3ae64f6e741c7673752cefeacd442212230e26f

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