Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

================================
Church of England CMS API Client
================================


.. image:: https://img.shields.io/pypi/v/pycofecms.svg
:target: https://pypi.python.org/pypi/pycofecms

.. image:: https://readthedocs.org/projects/pycofecms/badge/?version=latest
:target: https://pycofecms.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status


Before you start, make sure you have access credentials for the Church of England CMS API. You will
need a valid `API_ID` and `API_KEY`. See https://cmsapi.cofeportal.org/security for more
information about this.

Most of the endpoints also require a `diocese_id`. You should be supplied with this when you
receive your access credentials.


* Free software: BSD license
* Documentation: https://pycofecms.readthedocs.io


Features
========

* Python client for the CofE CMS API (https://cmsapi.cofeportal.org/)
* Python 3.5
* 100% test coverage


Quick Start
===========

.. code-block:: python

>>> from cofecms import CofeCMS
>>> cofe = CofeCMS(API_ID, API_KEY, diocese_id)
>>> result = cofe.get_contacts(
limit=10,
fields={'contact': ['surname']},
search_params={'keyword': 'smith', 'keyword_names_only': 'on'},
)

>>> # This query has 82 total results.
>>> print(result.total_count)
82

>>> # Spread across 9 pages
>>> print(result.total_pages)
9

>>> # Get the data for the first page for the query
>>> print(result)
[{'surname': 'Aynsley-Smith'},
{'surname': 'Bradford-Smith'},
{'surname': 'Brothertonsmith'},
{'surname': 'Busen-Smith'},
{'surname': 'Cox-Smith'},
{'surname': 'Drummond Smith'},
{'surname': 'Goldsmith'},
{'surname': 'Grout-Smith'},
{'surname': 'Hall-Smith'},
{'surname': 'Harcourt-Smith'}]

>>> # Get a specific page for the query
>>> print(result.get_data_for_page(4))
[{'surname': 'Smith-Agent'},
{'surname': 'Smith-Cherry'},
{'surname': 'Smith-McSmithSmith'},
{'surname': 'Smith'},
{'surname': 'Smith'},
{'surname': 'Smith'},
{'surname': 'Smith'},
{'surname': 'Smith'},
{'surname': 'Smith'},
{'surname': 'Smith'}]

>>> # Loop through all available pages
>>> for page in result.pages_generator():
print(len(page))
10
10
10
10
10
10
10
9
0


>>> # Or retrieve all records for the query
>>> print(result.all())
[{'surname': 'Aynsley-Smith'},
{'surname': 'Bradford-Smith'},
{'surname': 'Brothertonsmith'},
{'surname': 'Busen-Smith'},
{'surname': 'Cox-Smith'},
{'surname': 'Drummond Smith'},
{'surname': 'Goldsmith'},
...
{'surname': 'Smith'},
{'surname': 'Smith'},
{'surname': 'Smith'},
{'surname': 'Smitherman'},
{'surname': 'Smithers'},
{'surname': 'Sutton-Smith'},
{'surname': 'Thistleton-Smith'}]


=======
History
=======

0.1.0 (2017-03-20)
------------------

* First release on PyPI.

Metadata

Release files for pycofecms 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycofecms 0.1.1
File Size Uploaded
pycofecms-0.1.1.tar.gz 25.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycofecms 0.1.1
File Interpreter ABI Platform
pycofecms-0.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 35.1 kB

Release files / pycofecms-0.1.1.tar.gz

Download URL pycofecms-0.1.1.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
503142ffc82774118b6222d94a6000eb3d29958225d60dff49cabdefe3ca9f1d
BLAKE2b-256 checksum
How to use checksums
cab434c87545411a7e05d0da836076e8fe999681c2e4779aa72de2e8854d2539
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pycofecms-0.1.1-py2.py3-none-any.whl

Download URL pycofecms-0.1.1-py2.py3-none-any.whl
Size 9.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4f1a18d355a569f6423d6db12468dc0a92c4f9b5afe0b85701d71813ad0bbd9e
BLAKE2b-256 checksum
How to use checksums
0b6bb9d4fdf5ae5006425fb4ebb148321ff03739b370fc1271f4119e8c6b30f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page