Skip to main content

A module containing helpers and shared code related to identity systems within UIS, University of Cambridge.

Project description

Identity Lib

This Python package contains shared code related to Identity systems within UIS. It's primary purpose is to encourage code-reuse and to allow for client systems to make use of the same data structures and logic that is contained within our emergent identity APIs.

Use

Install ucam-identitylib using pip:

pip install ucam-identitylib

The module can then be used as identitylib:

from identitylib.identifiers import Identifier

identifier = Identifier.from_string('wgd23@v1.person.identifiers.cam.ac.uk')
print(identifier)

Developer quickstart

This project contains a dockerized testing environment which wraps tox.

Tests can be run using the ./test.sh command:

# Run all PyTest tests and Flake8 checks
$ ./test.sh

# Run PyTest and Flake8 and recreate test environments
$ ./test.sh --recreate

# Run just PyTest
$ ./test.sh -e py3

# Run a single test file within PyTest
$ ./test.sh -e py3 -- tests/test_identifiers.py

# Run a single test file within PyTest with verbose logging
$ ./test.sh -e py3 -- tests/test_identifiers.py -vvv

Pulling latest specs from source repositories

Local copies of the OpenAPI specs used to generate the library should be pulled in to this repo so the specific specs used in each build are under revision control. This can be done using the provided script:

$ ./pull-specs.sh

# If an access token required for https clones from gitlab repositories
# then this can be specified using:
$ ./pull-specs.sh --token "ACCESS_TOKEN_HERE"

# You may need to first set the $USER environment variable to match the GitLab account name.

Generating the identitylib

The identitylib is generated during the docker build process. To create a local copy of the identitylib distribution use the build script:

$ ./build-local.sh

This will create a new folder /dist in the current directory with the wheel and tar package for identitylib.

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

ucam-identitylib-2.0.0.tar.gz (340.0 kB view details)

Uploaded Source

Built Distribution

ucam_identitylib-2.0.0-py3-none-any.whl (891.9 kB view details)

Uploaded Python 3

File details

Details for the file ucam-identitylib-2.0.0.tar.gz.

File metadata

  • Download URL: ucam-identitylib-2.0.0.tar.gz
  • Upload date:
  • Size: 340.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for ucam-identitylib-2.0.0.tar.gz
Algorithm Hash digest
SHA256 11d1d89ed749ba3785096aeea0c917b8ce86be7c493e082a31aae68e28359e1f
MD5 cd206fbb53e91b73c55e3f59c1170df9
BLAKE2b-256 751e78c641133a4764fa95b7bb53336cadcfe370a538b2d29d3cb000c62fce3a

See more details on using hashes here.

File details

Details for the file ucam_identitylib-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ucam_identitylib-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e9061e9dc8cf80b581f86404c92fa58ef05ca4dbfc24e853e16df607628cc6b
MD5 b05974dd23946a9a910803eeb3a2635c
BLAKE2b-256 d10ffd3914c2712a25d9930a49f80f0fbc33fb9dd4e831bfd6bfcde653fbeb70

See more details on using hashes here.

Supported by

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