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"

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

Uploaded Source

Built Distribution

ucam_identitylib-1.0.15-py3-none-any.whl (794.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ucam-identitylib-1.0.15.tar.gz
  • Upload date:
  • Size: 329.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.8

File hashes

Hashes for ucam-identitylib-1.0.15.tar.gz
Algorithm Hash digest
SHA256 1742f5a091120d94e0b64ee6484bf79e7c07803c61af3339fb0f4fcf835ab93f
MD5 92e8fe1014cc3cb364f5a33be6b63d09
BLAKE2b-256 3e0f5b039037ab165e6177bb40a6db9f3d8968d328127c90fdb809b4da22350f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ucam_identitylib-1.0.15-py3-none-any.whl
Algorithm Hash digest
SHA256 ddab7996050451a0d8a95d90ebd9093111c4a27ffe1918b127cc3eeb075b3d5b
MD5 6ff3c918f0a4122c5f250749536a9978
BLAKE2b-256 8701040ed02666b8f7fcb587d087075eae37a5a252441553b9040edc8605e204

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