Skip to main content

A library for the ChurchTools API

Project description

pychurchtools

This is a python wrapper for the ChurchTools API. The API from ChurchTools is provided using the Swagger toolset.

Note: This library is WIP. Some endpoints are not implemented at all and the others are only partly implemented.

Installation

To install from PyPI, you can use "pip install churchtools". Type "pip uninstall churchtools" to remove the library.

Dependencies:

  • pydantic
  • requests

Usage

Authentication

Via a cookie

Login to churchtools in your browser and copy the cookie. The cookie object looks something like this:

cookie = {
  'ChurchTools_ct_<church_name>': 'some_random_text',
}

Pass this object to the init function of the ChurchTools class or set the field cookie in the ChurchTools object.

Via REST API

The ChurchTools class provides a method login to log you in and set the cookie automatically.

ct.login('your_email', 'your_password')

Example

You can execute the following in a python script to test the functionality.

from churchtools import ChurchTools

c = ChurchTools('https://<church_name>.church.tools')
c.login('your_email', 'your_password')

events = c.events.list()
print('Upcoming event:', events[0].__repr__())
print(events[0].dict())
print()

me = c.general.whoami()
print('Logged in as:', me.__repr__())
print()

my_events = c.person.events(me.id)
print('Your next events:')
[print(f'- {e.__repr__()}') for e in my_events]

Notes

  • Set the debugging field from 0 - 2 for none to many debug messages.
  • Times are in UTC

Contributing

Linting

poetry install
pre-commit install --install-hooks
pre-commit run --all

Tests

  • Create a CT instance here: https://ccp.church.tools/demo
  • Set the environment variables CHURCHTOOLS_URL, CHURCHTOOLS_USER & CHURCHTOOLS_PASSWORD
  • Run pytest

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

churchtools-0.5.2.tar.gz (31.5 kB view details)

Uploaded Source

Built Distribution

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

churchtools-0.5.2-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file churchtools-0.5.2.tar.gz.

File metadata

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

File hashes

Hashes for churchtools-0.5.2.tar.gz
Algorithm Hash digest
SHA256 35fdd44e992e36c759647ce590348145fdaf086884e45113fa0bde703678cfac
MD5 0f962e45c9449954c52dbbe605340bc4
BLAKE2b-256 e034db1f3b67ae2405f77f2a367725f393457e33e8ccba95efd1e27aec6167dc

See more details on using hashes here.

File details

Details for the file churchtools-0.5.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for churchtools-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 07a8768379c563a05fe8bd652d654f73e155c887565068d83e7057c06fa88642
MD5 866d0379266b3e4061beb77096d4fe6d
BLAKE2b-256 cfe6bb8f867be74edec86db898f29b7b9d3adb2d939bbdf6f84907d987c2dc7f

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