semvec/pypi-packages huggingface dataset:
mainzelliste-client 0.1.1
Client for Mainzelliste, a pseudonymization service.
Requires Python: >=3.11

# mainzelliste-client

Python client for the mainzelliste, a pseudonymization service



## Installation
```bash
pip install mainzelliste-client
```

## Usage

### Basic Example

```python
from mainzelliste_client import MainzellisteClient

example_key = 'e8KcR1vcOLOTY0lRC7RjnMbdr4ARYIGurhEUZSpbvqU='

with MainzellisteClient(base_url='http://localhost:8081', api_key=example_key) as client:
    new_patient_id = client.generate_patient_id('5Yp0E')

print(new_patient_id)  # PQRYHQG0
```

## Setup a test Mainzelliste instance

1. Go in the `tests/docker/` directory
```bash
cd tests/docker/
```
2. Run the docker compose
```bash
docker-compose up -d
```
3. Mainzelliste should be at http://localhost:8081/

## API Reference

### MainzellisteClient

#### `__init__(base_url, api_key, api_version="2.0")`

Initialize the Mainzelliste client.

**Parameters:**

- `base_url` (str): Base URL of the Mainzelliste service

- `api_key` (str): API key for authentication

- `api_version` (str, optional): API version to use (default: "2.0")

#### `generate_patient_id(patient_id)`

Generate a new pseudonymized patient ID using the Mainzelliste API. This is the main method for users to pseudonymize patient identifiers.

This method handles the complete workflow: creating a session, generating a token, and adding the patient to get a new pseudonymized ID.

**Parameters:**

- `patient_id` (str): Original patient ID to be pseudonymized

**Returns:** String containing the new pseudonymized patient ID.

**Example:**

```python
with MainzellisteClient(base_url='http://localhost:8081', api_key='your-api-key') as client:
    new_id = client.generate_patient_id('patient-123')
    print(f"Pseudonymized ID: {new_id}")
```

#### `create_session()`

Create a new session.

**Returns:** Dictionary containing session information with a `uri` field.

#### `create_token(session_id, token_type, idtypes=None, fields=None, ids=None)`

Create a token for a session.

**Parameters:**

- `session_id` (str): The session ID

- `token_type` (str): Type of token (e.g., "addPatient")

- `idtypes` (list, optional): List of ID types to generate (default: ["pid"])

- `fields` (dict, optional): Patient fields (default: {})

- `ids` (dict, optional): Patient IDs (default: {})

**Returns:** Dictionary containing token information with a `tokenId` field.

#### `add_patient(token_id, sureness=True)`

Add a patient using a token.

**Parameters:**

- `token_id` (str): The token ID for adding the patient

- `sureness` (bool, optional): Whether the data is certain (default: True)

**Returns:** Dictionary containing patient information.

#### `close()`

Close the underlying session.

## License

See LICENSE file for details.
illustris-python 1.1.1
illustris_python analysis package.
Requires Python: >3.7.0
Keywords: astronomy, simulation, cosmology, astrophysics

# README #

The Illustris[TNG] Simulation: Public Data Release

Example code (Python).

See the [IllustrisTNG Website Data Access Page](http://www.tng-project.org/data/) for details.

# Install

Updates are rare, so a `pip` install should work well:

```
pip install illustris_python
```

or the latest development version:

```
git clone git@github.com:illustristng/illustris_python.git
cd illustris_python
pip install .
```