pimsclient
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
- Run all tests
- Run pre-commit:
pre-commit run
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)
| File | Size | Uploaded | |
|---|---|---|---|
| pimsclient-2.3.0.tar.gz | 23.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|