Name | churchtools JSON |
Version |
0.4.1
JSON |
| download |
home_page | None |
Summary | A library for the ChurchTools API |
upload_time | 2024-11-18 08:01:17 |
maintainer | None |
docs_url | None |
author | Philipp Glaum |
requires_python | <4.0,>=3.10 |
license | GPLv3 |
keywords |
api
churchtools
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# 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:
```python3
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.
```python3
ct.login('your_email', 'your_password')
```
### Example
You can execute the following in a python script to test the functionality.
```python3
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
## Tests
- Create a CT instance here: <https://ccp.church.tools/demo>
- Set the environment variables `CHURCHTOOLS_URL`, `CHURCHTOOLS_USER` & `CHURCHTOOLS_PASSWORD`
- Run `pytest`
Raw data
{
"_id": null,
"home_page": null,
"name": "churchtools",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": "api, churchtools",
"author": "Philipp Glaum",
"author_email": "p@pglaum.de",
"download_url": "https://files.pythonhosted.org/packages/16/ff/4d71552bef97e4b30f7555e567ac1fe6ef30a0c7052888473dfb6f01dba4/churchtools-0.4.1.tar.gz",
"platform": null,
"description": "# pychurchtools\n\nThis is a python wrapper for the ChurchTools API.\nThe API from ChurchTools is provided using the Swagger toolset.\n\n__Note:__ This library is WIP.\nSome endpoints are not implemented at all and the others are only partly\nimplemented.\n\n## Installation\n\nTo install from PyPI, you can use \"`pip install churchtools`\".\nType \"`pip uninstall churchtools`\" to remove the library.\n\nDependencies:\n\n- `pydantic`\n- `requests`\n\n## Usage\n\n### Authentication\n\n#### Via a cookie\n\nLogin to churchtools in your browser and copy the cookie.\nThe cookie object looks something like this:\n\n```python3\ncookie = {\n 'ChurchTools_ct_<church_name>': 'some_random_text',\n}\n```\n\nPass this object to the init function of the `ChurchTools` class or set the\nfield `cookie` in the `ChurchTools` object.\n\n#### Via REST API\n\nThe `ChurchTools` class provides a method `login` to log you in and set the\ncookie automatically.\n\n```python3\nct.login('your_email', 'your_password')\n```\n\n### Example\n\nYou can execute the following in a python script to test the functionality.\n\n```python3\nfrom churchtools import ChurchTools\n\nc = ChurchTools('https://<church_name>.church.tools')\nc.login('your_email', 'your_password')\n\nevents = c.events.list()\nprint('Upcoming event:', events[0].__repr__())\nprint(events[0].dict())\nprint()\n\nme = c.general.whoami()\nprint('Logged in as:', me.__repr__())\nprint()\n\nmy_events = c.person.events(me.id)\nprint('Your next events:')\n[print(f'- {e.__repr__()}') for e in my_events]\n```\n\n### Notes\n\n- Set the `debugging` field from 0 - 2 for none to many debug messages.\n- Times are in UTC\n\n## Tests\n\n- Create a CT instance here: <https://ccp.church.tools/demo>\n- Set the environment variables `CHURCHTOOLS_URL`, `CHURCHTOOLS_USER` & `CHURCHTOOLS_PASSWORD`\n- Run `pytest`\n\n",
"bugtrack_url": null,
"license": "GPLv3",
"summary": "A library for the ChurchTools API",
"version": "0.4.1",
"project_urls": null,
"split_keywords": [
"api",
" churchtools"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "500c482277308cabefd68338fd6d8919b78514ab02d069d120077a782b599958",
"md5": "6265bef793ba97eb24b9e02fdba07c2d",
"sha256": "4a9803fec628eb500163dd4d335b576314e8c4991b909b00b7c06aa48402c0d7"
},
"downloads": -1,
"filename": "churchtools-0.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6265bef793ba97eb24b9e02fdba07c2d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 42002,
"upload_time": "2024-11-18T08:01:15",
"upload_time_iso_8601": "2024-11-18T08:01:15.991326Z",
"url": "https://files.pythonhosted.org/packages/50/0c/482277308cabefd68338fd6d8919b78514ab02d069d120077a782b599958/churchtools-0.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "16ff4d71552bef97e4b30f7555e567ac1fe6ef30a0c7052888473dfb6f01dba4",
"md5": "3d45b319677975420fae4587f8ea3f44",
"sha256": "13435c5331c83b4df2796149b317a98116f92129e7a32afaebcf6ac3cea25ff5"
},
"downloads": -1,
"filename": "churchtools-0.4.1.tar.gz",
"has_sig": false,
"md5_digest": "3d45b319677975420fae4587f8ea3f44",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 32055,
"upload_time": "2024-11-18T08:01:17",
"upload_time_iso_8601": "2024-11-18T08:01:17.605224Z",
"url": "https://files.pythonhosted.org/packages/16/ff/4d71552bef97e4b30f7555e567ac1fe6ef30a0c7052888473dfb6f01dba4/churchtools-0.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-18 08:01:17",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "churchtools"
}