Skip to main content

Providing a unified (well-documented) API to the Scouts' national membership system, Compass.

Project description

Compass Interface — the unofficial Compass API

Python Versions 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 system.

Objectives

The project aims to:

  • increase flexibility and simplicity when developing applications that interface with Compass data,
  • provide stability and abstract complexities of Compass, and
  • enable greater support to our adult volunteers and members.

Where to get it

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

The project can be installed through either pip or conda.

# conda
conda env update
conda activate compass-interface

If installing dependencies with pip, use a virtual environment to isolate your packages.

# or PyPI

# create venv
python -m venv venv

# activate venv - windows
.\venv\Scripts\activate
# activate venv - unix-like (macOS, linux)
source env/bin/activate 

# install dependencies
python -m pip install -r requirements.txt 

Dependencies

  • compass - Core Compass Interface, with parsing and validation logic
  • pandas - for data management and transformation
  • numba - to speed things up
  • pyarrow - to process and move data fast
  • FastAPI - for an intuitive API
  • uvicorn - serving on the lightning-fast ASGI server

Dev-dependencies

We use black, isort, ipython and others to speed up the development process!

Licence

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

Usage

Running the API

To run the API either run uvicorn compass.api.app:app --reload in the root directory, or run the app.py file in the /compass/api/ directory. This second method also enables interactive debugging.

Alternatively, use Docker

Running the Compass Interface files directly

To run the Compass Interface files directly the top-level script.py file is useful for getting started immediately. Please make sure not to commit credentials to git, as these are assumed public as soon as they are on GitHub.

Docker

To run Compass Interface locally, we provide docker templates in /docker.

! Note: All commands below are run in the /docker directory.

Local hosting / development

To start docker, run docker compose -f docker-compose.yml up -d.
To rebuild the Compass Interface backend, run docker buildx build -t scouts/compass-interface-backend --load -f backend.dockerfile ..
To stop docker, run docker compose down.
To remove old build files, run docker container prune -f; docker image prune -f

Deployment

To start docker, run docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d.
To stop docker, run docker-compose down.

Ports

When the containers are running, the FastAPI app is reached at localhost:8888.

If you are running the deployment configuration, you will also find the Traefik reverse proxy at localhost:80 and Traefik's dashboard at localhost:8080.

Support

For support please contact Adam Turner (@AA-Turner). There is a wider community of interest on the UK Scouts IT Lab group.

Ideas, Bugs, Features

Please use GitHub issues / Pull Requests to note bugs or feature requests.

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-0.26.0.tar.gz (620.6 kB view details)

Uploaded Source

Built Distribution

compass_interface-0.26.0-py3-none-any.whl (627.7 kB view details)

Uploaded Python 3

File details

Details for the file compass-interface-0.26.0.tar.gz.

File metadata

  • Download URL: compass-interface-0.26.0.tar.gz
  • Upload date:
  • Size: 620.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for compass-interface-0.26.0.tar.gz
Algorithm Hash digest
SHA256 5d4924a045ac2926eb75e02105b6c156f1a5118b7e84899571253591025c2c5d
MD5 e97cf2b0822d350e6dc034dcedc40ec2
BLAKE2b-256 2e50dafd092796bb7348069bc5442a581878dc06844604e9cff8500b6f89d5ce

See more details on using hashes here.

File details

Details for the file compass_interface-0.26.0-py3-none-any.whl.

File metadata

  • Download URL: compass_interface-0.26.0-py3-none-any.whl
  • Upload date:
  • Size: 627.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.7

File hashes

Hashes for compass_interface-0.26.0-py3-none-any.whl
Algorithm Hash digest
SHA256 812af3bc296b55014a27c97a930b62b398c21bfe3673e3967e038cc4f01bc749
MD5 8a077913b13852885172af5ca8f35a77
BLAKE2b-256 47e62a49736278f063e9500c8f6f27e462ae6845f62ed8a80216826dfaa10117

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