Skip to main content

The unofficial API to the TSA Compass membership database

Project description

Compass Interface - Core

PyPI - Python Version PyPI - Status PyPI Latest Release Conda Latest Release License Code style: black

The Compass Interface project aims to provide a unified and well-documented API to the Scouts' national membership system, Compass.

Notice

This is not an official API to Compass and as such should be used in a way that doesn't cause a high request load on the Compass system.

Please also remember your personal data handling obligations (under both GDPR and Scouting policies) whilst using this module.

Where to get it

The source code for the project is hosted on GitHub at the-scouts/compass-interface-core

Installers for the latest release are availibe on Conda and at the Python Package Index (PyPI).

# conda
conda install compass-interface-core
# or PyPI
pip install compass-interface-core

Dependencies

License

Compass Interface - Core is naturally open source and is licensed under the MIT license.

Core Module

This sub-project hosts the extraction functionaility of Compass Interface, and is itself a standalone module for querying Compass.

The main project is found at the-scouts/compass-interface.

Example Usage

import compass.core as ci

# Turn on debug logging for development
ci.logger.enable_debug_logging()

# Login to Compass
compass_session = ci.login("username", "password")

# Setup Compass Helpers
hierarchy = ci.Hierarchy(compass_session)
people = ci.People(compass_session)

# Get all unique members from your hierarchy
member_set = hierarchy.get_unique_members()

Specifying a role

By default, Compass Interface uses your primary role to access Compass. To change this, a custom role can be specified when calling ci.login, as follows:

import compass.core as ci

# Turn on debug logging for development
ci.logger.enable_debug_logging()

# Login to Compass
compass_session = ci.login("username", "password", role="role_as_on_compass")

The string passed to the role argument must match the role title on Compass exactly, as they are compared internally. You can validate that the role has updated successfully through the log output.

Specifying a role and location

If you have multiple roles with the same title on compass (for example, two Group Administrator or Scout Active Support Manager roles), these can be differentiated by also specifying a role location, as follows:

import compass.core as ci

# Turn on debug logging for development
ci.logger.enable_debug_logging()

# Login to Compass
compass_session = ci.login("username", "password", role="role_as_on_compass", location="location_as_on_compass")

As with the role title, the location needs to match the text in the Location column of My Roles exactly, as we verify the text matches internally.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

compass-interface-core-0.10.4.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

compass_interface_core-0.10.4-py3-none-any.whl (54.8 kB view details)

Uploaded Python 3

File details

Details for the file compass-interface-core-0.10.4.tar.gz.

File metadata

  • Download URL: compass-interface-core-0.10.4.tar.gz
  • Upload date:
  • Size: 48.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for compass-interface-core-0.10.4.tar.gz
Algorithm Hash digest
SHA256 be3ee9791cb7aa1e20d4b1d7aad509d6a2c9581c1dbf8c28e83d8a80bc4387ce
MD5 22a03ec6ccf8e752a667456ae022a1a5
BLAKE2b-256 56d960a8874f7237c5ee52249f24f67a8b6c4db408dcf9ec6fc31c48ef94da20

See more details on using hashes here.

File details

Details for the file compass_interface_core-0.10.4-py3-none-any.whl.

File metadata

  • Download URL: compass_interface_core-0.10.4-py3-none-any.whl
  • Upload date:
  • Size: 54.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for compass_interface_core-0.10.4-py3-none-any.whl
Algorithm Hash digest
SHA256 94b87eda8ce37e79a7dce6235696dc3062aaa0a4d607bc036a20899235bb0016
MD5 6c277877ad5042c3a6b5949e2bf99c98
BLAKE2b-256 5745fabc0b039362021d7209d504e35596b550dcb3b2c5a2dd45328c0a079b71

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page