--- title: "Darwinium Python SDKs: Installation and Authentication" slug: "python-sdks" description: "Install Darwinium Python SDKs and configure the authentication and package access needed to use them in your integration." updated: 2026-10-16T02:26:32Z published: 2026-10-15T05:42:36Z canonical: "docs.darwinium.com/python-sdks" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.darwinium.com/llms.txt > Use this file to discover all available pages before exploring further. # Install & authenticate Darwinium's Python SDKs let your own code call Darwinium APIs. They connect to your nodes over mutual TLS (mTLS) with an API certificate, like the other Darwinium APIs. | Package | Use it to | Certificate permission | Guide | | --- | --- | --- | --- | | `dwn_label_management` | Add, remove and list labels | **Edit Labels** | [Python Label Management SDK](/v1/docs/python-label-management-sdk) | | `dwn_erasure` | Erase a person's data when they exercise their right to erasure (GDPR Article 17) | **Right to erasure**, on every node | [Python Erasure SDK](/v1/docs/python-erasure-sdk) | For the `dwn_ext_decision` and `dwn_ext_call_api` packages, see [Import Python Packages](/v1/docs/import-python-packages). ## Before you start You need: - Python 3.10, 3.11 or 3.12. - An API certificate. Follow [Setting up certificates & Access](/v1/docs/setting-up-certificates) to create one. Keep the private key, the signed certificate and the CA chain file. - The certificate's permissions. In the Darwinium Portal, an administrator opens **Admin → API Access**, double-clicks the certificate, and ticks **API Access** and the SDK's permission (see the table above) for each node it will call. - The name of the node to call. Your portal administrator can give you this. ## Getting an SDK access token You need an SDK access token to download the packages. 1. In the Darwinium Portal, click **Preferences** in the top right corner of the page. ![SDK Access in Preferences](https://cdn.document360.io/db6f7316-640d-4099-b5a1-b01b4dbd17fc/Images/Documentation/SDK%20access%20Image.png?sv=2026-02-06&spr=https&st=2026-12-01T07%3A54%3A40Z&se=2026-12-01T08%3A54%3A40Z&sr=b&sp=r&sig=rrW4qyj%2BME8k%2B6sy%2F%2Bh8xugB6rBtcT15f83%2Fm5u9dgA%3D) 2. Click **SDK Access**, then **Generate Token**. ![Generate Token](https://cdn.document360.io/db6f7316-640d-4099-b5a1-b01b4dbd17fc/Images/Documentation/sdk%20access%20token%20image.png?sv=2026-02-06&spr=https&st=2026-12-01T07%3A54%3A40Z&se=2026-12-01T08%3A54%3A40Z&sr=b&sp=r&sig=T%2FBqG1s%2FrryDGnCaARNiQbSnyHk7qpPPcXxNg2sU6%2FQ%3D) 3. Note down the username and token. The username is your Darwinium Portal email. The token is shown only once. Treat the token like a password: keep it out of source code and notebooks. ## Installing a package Set `DARWINIUM_PYPI_USERNAME` to your Darwinium Portal email and `DARWINIUM_PYPI_PASSWORD` to your token. Then install the package with pip: ``` pip install --extra-index-url=https://${DARWINIUM_PYPI_USERNAME}:${DARWINIUM_PYPI_PASSWORD}@packages.darwinium.com/artifactory/api/pypi/pypi-local/simple "dwn_label_management>=1.5.24" ``` To install the erasure SDK, use `"dwn_erasure>=1.5.24"` instead. The `--extra-index-url` option keeps the public PyPI index available for each package's dependencies. Package versions follow the Darwinium release cycle. ## Creating a client Every SDK takes the same connection settings: | Setting | Description | | --- | --- | | `node_name` | The node's hostname. Your portal administrator can give you this. | | `api_endpoint_port` | The node's API port. Defaults to `9443`. | | `mtls_CA_file_path` | Path to the CA chain file you downloaded with the certificate. | | `mtls_cert_file_path` | Path to the signed certificate file. | | `mtls_key_file_path` | Path to your private key file. | | `mtls_key_file_password` | The private key's password, if it has one. | For example, with the label SDK: ``` from dwn_label_management import LabelClient, LabelClientConfig config = LabelClientConfig( node_name="", api_endpoint_port=9443, mtls_CA_file_path="/path/to/cachain.pem", mtls_cert_file_path="/path/to/cert.pem", mtls_key_file_path="/path/to/privkey.key", mtls_key_file_password="", # Only if your key has a password ) client = LabelClient(config) ``` The erasure SDK's `ErasureClientConfig` and `ErasureClient` take the same settings. ## Calling the SDK The SDK methods are asynchronous, so call them with `await`. In a script, run them inside `asyncio.run`: ``` import asyncio async def main() -> None: client = LabelClient(config) page = await client.get_labels(page=0, page_size=20) print(f"{page.total_count} labels") asyncio.run(main()) ``` In a Jupyter notebook you can `await` the calls directly in a cell.