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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file churchtools-0.1.14.tar.gz
.
File metadata
- Download URL: churchtools-0.1.14.tar.gz
- Upload date:
- Size: 26.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a515f0cdf968540d1b947157b48d1caafe9e1c4ad331010b3bff70fabe449dc2 |
|
MD5 | b69de048e1ba6d2f1e783d54606895a4 |
|
BLAKE2b-256 | c35cf5ee238c3f4d5e19ae2300298ba5455e1eb2759ad1037a3d043d7aa899fc |
File details
Details for the file churchtools-0.1.14-py3-none-any.whl
.
File metadata
- Download URL: churchtools-0.1.14-py3-none-any.whl
- Upload date:
- Size: 30.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 469a5d04f7a50cc3fe652e30a17c9004823b348328951ae6818224f51077ffe2 |
|
MD5 | 364696f3f4cdf716e9eee5c14509b922 |
|
BLAKE2b-256 | 141d9b6d72d10709c81d32ad3b7e79ca2792e4671cf7e716951d1caf639c99cc |