Skip to main content

Client for PIMS key_file management swagger web API

Project description

pimsclient

CI PyPI PyPI - Python Version Code style: black Checked with mypy

Client for PIMS keyfile management swagger web API.

  • Pseudonymize and reidentify using PIMS keyfile management as backend
  • Supports multiple identity/pseudonym types:
    • PatientUID
    • StudyInstanceUID
    • SeriesInstanceUID
    • SOPInstanceUID
    • AccessionNumber
  • Authentication via NTLM

Installation

pip install pimsclient

Usage

Basic example

To use pimsclient in a project

    # Create a KeyFile instance    
    keyfile = KeyFile.init_from_id(
        keyfile_id=49,
        client=AuthenticatedClient(session=session),
        server=PIMSServer(url="https://url_to_pims_api")     

    # I have some patientIDs I want to pseudonymize with PIMS
    keys = keyfile.pseudonymize([PatientID('1234'),
                                 PatientID('5678'),
                                 PatientID('9012')])

    # I found some pseudo patientIDs. What was the original ID?
    keys = keyfile.reidentify([PseudoPatientID('Patient1'),
                               PseudoPatientID('Patient2'),
                               PseudoPatientID('Patient3')])

Credentials

pimsclient needs an authenticated requests.Session() object to interact with PIMS API. Check with the admins of the PIMS API server for credentials

Contributing

You can contribute in different ways

Report bugs

Report bugs at https://github.com/sjoerdk/pimsclient/issues.

Contribute code

Get the code

Fork this repo, create a feature branch

Set up environment

pimsclient uses poetry for dependency and package management

  • Install poetry (see poetry docs)
  • Create a virtual env. Go to the folder where cloned pimsclient and use
    poetry install 
    
  • Install pre-commit hooks.
    pre-commit install
    

Add your code

Make your code contributions. Make sure document and add tests for new features. To automatically publish to pypi, increment the version number and push to master. See below.

Lint your code

Publish

Create a pull request

Incrementing the version number

A merged pull request will only be published to pypi if it has a new version number. To bump pimsclient's version, do the following.

  • pimsclient uses semantic versioning Check whether your addition is a PATCH, MINOR or MAJOR version.

  • Manually increment the version number:

    • pyproject.toml -> version = "0.1.2"
  • Add a brief description of your updates new version to HISTORY.md

Credits

This package was originally created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

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

pimsclient-2.3.0.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pimsclient-2.3.0-py3-none-any.whl (27.4 kB view details)

Uploaded Python 3

File details

Details for the file pimsclient-2.3.0.tar.gz.

File metadata

  • Download URL: pimsclient-2.3.0.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.9.22 Linux/6.11.0-1015-azure

File hashes

Hashes for pimsclient-2.3.0.tar.gz
Algorithm Hash digest
SHA256 0cbfb3749264966eb8078cae474161e178086f046132b10b000af10cc48581a3
MD5 407f86796a1c45f08406e675cb08f398
BLAKE2b-256 f38eea405f9190a7b13b7c407c0d313097517dc45f57c52be4ac03bb8eef37ef

See more details on using hashes here.

File details

Details for the file pimsclient-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: pimsclient-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 27.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.9.22 Linux/6.11.0-1015-azure

File hashes

Hashes for pimsclient-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef59bc2660e88d88ef2f46acc0f960478db8163714b8c1f59dfcbe17dbb35bec
MD5 1bc2de2f5f55a311670aac27c3235667
BLAKE2b-256 55b267993063a8d107309682e98389b1a1518b93dc2057c886f1ba0b5bc60d45

See more details on using hashes here.

Supported by

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