Skip to main content

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.

Metadata

Release files for pimsclient 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pimsclient 2.3.0
File Size Uploaded
pimsclient-2.3.0.tar.gz 23.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pimsclient 2.3.0
File Interpreter ABI Platform
pimsclient-2.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.4 kB

Release files / pimsclient-2.3.0.tar.gz

Download URL pimsclient-2.3.0.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0cbfb3749264966eb8078cae474161e178086f046132b10b000af10cc48581a3
BLAKE2b-256 checksum
How to use checksums
f38eea405f9190a7b13b7c407c0d313097517dc45f57c52be4ac03bb8eef37ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.9.22 Linux/6.11.0-1015-azure

Release files / pimsclient-2.3.0-py3-none-any.whl

Download URL pimsclient-2.3.0-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef59bc2660e88d88ef2f46acc0f960478db8163714b8c1f59dfcbe17dbb35bec
BLAKE2b-256 checksum
How to use checksums
55b267993063a8d107309682e98389b1a1518b93dc2057c886f1ba0b5bc60d45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.9.22 Linux/6.11.0-1015-azure

Release history Release notifications | RSS feed

This release

2.3.0 This release

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.0

2 release files

0.7.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page