Skip to main content

Pypco ReadMe

Pypi Version Documentation Status Build codecov Pypi Python Versions Checked with mypy

Stop writing boilerplate code to communicate with the Planning Center Online REST API, and start using pypco! Pypco is a Python wrapper library that supports the full breadth of the PCO REST API. With pypco, you'll spend less time worrying about building and managing HTTP requests and more time building cool things.

>>> Read the Docs (stable) <<<

Features

  • Boilerplate Done for You: No need to manage HTTP requests, and useful helper functions included (authentication, iteration/pagination, new object templating, etc.)!
  • Automatic rate limit handling: If you hit your rate limit, pypco will automatically pause requests and continue once your rate limit period has expired.
  • Automatic Pagination: Pypco provides automatic pagination/object iteration, allowing you to quickly and easily retrieve large numbers of objects off from the PCO API.
  • Simple Wrapper API: Using API wrappers can feel like learning two new APIs: the REST API itself and the wrapper you're using. Pypco's simple approach is built around the HTTP verbs you already know: GET, POST, PATCH, and DELETE. As a result, after a few minutes with the pypco docs you'll be spending your time in the PCO API docs instead and be on your way to getting things done.
  • Full API Support: Pypco supports all versions of the PCO v2 REST API, and supports any combination of API versions you might use for each of the PCO apps.

Examples

import pypco
pco = pypco.PCO("<app_id>", "<app_secret>")

# Print first and last names of everyone in People
for person in pco.iterate('/people/v2/people'):
    print(f'{person["data"]["attributes"]["first_name"]} '\
    f'{person["data"]["attributes"]["last_name"]}')

# Create, save, and print a new person's attribs
payload = pco.template(
  'Person',
  {'first_name': 'John', 'last_name': 'Doe'}
)
new_person = pco.post('/people/v2/people', payload)
print(new_person['data']['attributes'])

# Change our new person's last name and print attribs
payload = pco.template(
  'Person',
  {'last_name': 'Smith'}
)
updated_person = pco.patch(
  f'/people/v2/people/{new_person["data"]["id"]}',
  payload
)
print(updated_person['data']['attributes'])

# Add an email address for our person
payload = pco.template(
  'Email',
  {
    'address': 'john.doe@mailinator.com',
    'location': 'Home'
  }
)
email_object = pco.post(
  f'/people/v2/people/{updated_person["data"]["id"]}/emails',
  payload
)

# Iterate through our person's email addresses
for email in pco.iterate(
  f'/people/v2/people/{updated_person["data"]["id"]}/emails'
):
  print(email['data']['attributes']['address'])
  

Version 1.0

Code written for pypco v0 will not be compatible with the v1 release. Because of changes in the PCO API (primarily the introduction of versioning) and the need for significantly improved performance, v1 is almost a complete rewrite. The result is a much more flexible, performant, and robust API wrapper. Though perhaps a bit less "pythonic", pypco v1.0.x will be much more maintainable going forward.

If you're relying on pypco v0, you can still find the source code here. Development will not continue on the v0 release, but feel free to submit an issue if you're relying on v0 and need help with a specific problem.

License

Pypco is licensed under the terms of the MIT License.

Metadata

Release files for pypco 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypco 1.2.0
File Size Uploaded Provenance
pypco-1.2.0.tar.gz 12.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pypco 1.2.0
File Interpreter ABI Platform
pypco-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / pypco-1.2.0.tar.gz

Download URL pypco-1.2.0.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
89b81592e21d19d722a863702f992958e54affbf601ca7c0e01ea42e1c5ff18b
BLAKE2b-256 checksum
How to use checksums
40886e262213cfff85bfebd9d9a26125a35b629c0739b41693c88f63317a8237
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.8.3 requests/2.23.0 setuptools/65.3.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.13

Release files / pypco-1.2.0-py3-none-any.whl

Download URL pypco-1.2.0-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38486f669f857b9ae4c179cb83e140564f16ff077faccc24d3349aafb52d57f4
BLAKE2b-256 checksum
How to use checksums
38458d17ed101edf11508f0f69b0169979369ad0645b91348995f3a904b8ca1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.8.3 requests/2.23.0 setuptools/65.3.0 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.13

Security for pypco 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page