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, you can use "pip install ." in the source directory. 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

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.1.8.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

churchtools-0.1.8-py3-none-any.whl (28.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: churchtools-0.1.8.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for churchtools-0.1.8.tar.gz
Algorithm Hash digest
SHA256 58b5e544edcbad09824026abea77dc36b7f91977972b2327d6318c4eaa397e8f
MD5 27745cdb073e437a2b756d3ee76949f1
BLAKE2b-256 2abf580fa681c4dc5d91377d775d4c880e39864e8d08ad8def0883dd0908dd73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: churchtools-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 28.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for churchtools-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4d44b10973a74cf6ef4b807a525c2ccd45618bf9666b588bc33f38c63c21ea3d
MD5 886ecaaf30502c721a902f425588f610
BLAKE2b-256 c527c16644cdead09471b67ba03fbfdb80f2bcb1f5698dcfe5648c3744933bba

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page