Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smehrbrodt/churchtools-memberlist
Generate membership directory and other reports via ChurchTools API
https://github.com/smehrbrodt/churchtools-memberlist
churchtools churchtools-api py3o python
Last synced: about 2 months ago
JSON representation
Generate membership directory and other reports via ChurchTools API
- Host: GitHub
- URL: https://github.com/smehrbrodt/churchtools-memberlist
- Owner: smehrbrodt
- License: mit
- Created: 2022-06-17T05:29:03.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-28T09:46:03.000Z (10 months ago)
- Last Synced: 2024-04-23T14:51:32.335Z (8 months ago)
- Topics: churchtools, churchtools-api, py3o, python
- Language: Python
- Homepage:
- Size: 149 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Reporting via Churchtools API
Python script to create documents via Churchtools API.
* Member list
* Prayer list
* Checkin form
* Attendance report## Initial Setup
* Copy `.env.sample` to `.env`, and adjust to your setup.
* See [Getting a login token](#getting-a-login-token)
* Copy template.sample.odt to template.odt and adjust to your preferences (Use [LibreOffice](https://www.libreoffice.org/) to modify the template).
* Check the [template language documentation](https://py3otemplate.readthedocs.io/)
* Install [Python 3](https://www.python.org/)
* Create a virtual env for this project, and activate the venv. [More information](https://docs.python.org/3/library/venv.html)
* Install Python dependencies:
* `/bin/pip install -r requirements.txt`## Usage
Any of the below commands will create `odt` output files.
Use [LibreOffice](https://www.libreoffice.org/) to preview or postprocess them, or generate a PDF of it.You can also use the command line to generate a PDF: `libreoffice --convert-to pdf --outdir . input.odt`
### Member list
Creates a membership directory.
```bash
./create-memberlist.py \
--filter-group \
[--template template_memberlist.odt] \
[--output memberlist.odt]
```The `--filter-group` param is used to filter by a certain group in Churchtools.
### Prayer list
Creates a prayer list (similiar to membership directory, but different layout). Can be filtered to include only part of the members using `--surname-from` and `surname-to` arguments.
```bash
./create-prayerlist.py \
[--surname-from ] \
[--surname-to ] \
[--template template_prayerlist.odt] \
[--output prayerlist.odt]
```### Checkin form
Create a checkin form. This assumes you have two groups: Members and regular visitors.
The regular visitors group can be filtered to include only certain roles from that group.```bash
./create-checkinform.py \
--group-members \
--group-regularvisitors \
--role-id-regularvisitors \
[--template template_checkinform.odt] \
[--output checkinform.odt]
```### Attendance report
Generate an attendance report.
```bash
./create-attendancereport.py \
--group-members \
--group-regular-visitors \
--role-id-regularvisitors \
--group-visitors \
--role-id-visitors \
--date YYYY-MM-DD \
[--template template_attendancereport.odt] \
[--output attendancereport.odt]
```## Getting a login token
Find your ChurchTools API documentation / playground here: \.church.tools/api
To retrieve a login token, first find your user ID using the `GET /persons` API.
Then use the `GET /persons/{id}/logintoken` API to get your login token.