churchtools


Namechurchtools JSON
Version 0.4.0 PyPI version JSON
download
home_pageNone
SummaryA library for the ChurchTools API
upload_time2024-09-26 12:00:19
maintainerNone
docs_urlNone
authorPhilipp Glaum
requires_python<4.0,>=3.10
licenseGPLv3
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/ce/d8/a2191bda9863c1a0b53a8d1fc87bc2e3f3ab8d833a9a40d3eddf41a761fa/churchtools-0.4.0.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.0",
    "project_urls": null,
    "split_keywords": [
        "api",
        " churchtools"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6129b60268710100b10797dd9abcd7e963d3a959b7f1f366e7c9094cfbd1925e",
                "md5": "452883a1b74276b8727423f615c315e1",
                "sha256": "ee1a7739bed43c52072be794383e9be94e1558763c9279980284a0b922531879"
            },
            "downloads": -1,
            "filename": "churchtools-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "452883a1b74276b8727423f615c315e1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 41879,
            "upload_time": "2024-09-26T12:00:18",
            "upload_time_iso_8601": "2024-09-26T12:00:18.826368Z",
            "url": "https://files.pythonhosted.org/packages/61/29/b60268710100b10797dd9abcd7e963d3a959b7f1f366e7c9094cfbd1925e/churchtools-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ced8a2191bda9863c1a0b53a8d1fc87bc2e3f3ab8d833a9a40d3eddf41a761fa",
                "md5": "e0b098315596b5df14b5fdb35834b9bc",
                "sha256": "13eda8ac453ad8081dcd3ad9026680cbdd07839a4cc6b19dae62b349792f2bd1"
            },
            "downloads": -1,
            "filename": "churchtools-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "e0b098315596b5df14b5fdb35834b9bc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 31941,
            "upload_time": "2024-09-26T12:00:19",
            "upload_time_iso_8601": "2024-09-26T12:00:19.725747Z",
            "url": "https://files.pythonhosted.org/packages/ce/d8/a2191bda9863c1a0b53a8d1fc87bc2e3f3ab8d833a9a40d3eddf41a761fa/churchtools-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-26 12:00:19",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "churchtools"
}
        
Elapsed time: 0.50200s