Skip to main content

Cytomine Python client

Cytomine-python-client is an open-source Cytomine client written in Python. This client is a Python wrapper around Cytomine REST API gateway.

PyPI version

Overview

All data available from the Cytomine graphical interface can be manipulated programmatically from your computer. This page introduces the key concepts on how to interact with Cytomine without this graphical interface. Cytomine is a RESTful application. It means that the data stored and managed by Cytomine can be obtained through specific URLs. Contrary to the graphical interface, these URLs only provide relevant information data. To ease interaction with Cytomine, the Cytomine API client for Python encapsulates all the technical details relative to the HTTP API so that you can manipulate Cytomine resources without complexity.

Requirements

  • Python >=3.10, <3.13

Installation

cytomine-python-client is available on PyPi using pip:

pip install cytomine-python-client

For versions lower than 2.3.4, refer to manual installation guide.

Usage

See detailed usage documentation for the complete documentation.

Basic example

Three parameters are required to connect:

  • HOST: The full URL of Cytomine core (e.g. “http://demo.cytomine.be”).
  • PUBLIC_KEY: Your cytomine public key.
  • PRIVATE_KEY: Your cytomine private key.

First, the connection object has to be initialised.

from cytomine import Cytomine

host = "demo.cytomine.be"
public_key = "XXX" # check your own keys from your account page in the web interface
private_key = "XXX"

cytomine = Cytomine.connect(host, public_key, private_key)

The next sample code should print “Hello {username}” where {username} is replaced by your Cytomine username and print the list of available projects.

from cytomine.models import ProjectCollection

print(f"Hello {cytomine.current_user}")
projects = ProjectCollection().fetch()
print(projects)
for project in projects:
    print(project)

Other examples

License

Apache-2.0

Metadata

Release files for cytomine-python-client 4.4.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 cytomine-python-client 4.4.0
File Size Uploaded Provenance Actions
cytomine_python_client-4.4.0.tar.gz 32.3 kB Without provenance Details for cytomine_python_client-4.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cytomine-python-client 4.4.0
File Interpreter ABI Platform Actions
cytomine_python_client-4.4.0-py3-none-any.whl Python 3 none any Details for cytomine_python_client-4.4.0-py3-none-any.whl

Total release size: 68.7 kB

Release files / cytomine_python_client-4.4.0.tar.gz

Download URL cytomine_python_client-4.4.0.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
38b0f6c36b33bbb79cc22fe72fe87a8d112f438c008e57978558e400bac7411d
BLAKE2b-256 checksum
How to use checksums
74a359056dc0d4b0f71c7ca32fc0f497fe763f022d9ad781c512cd1565767aa1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / cytomine_python_client-4.4.0-py3-none-any.whl

Download URL cytomine_python_client-4.4.0-py3-none-any.whl
Size 36.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d108b0e00e7e851b60fb99ccd3a42b7be723c624de4d0b3627db072ef526c410
BLAKE2b-256 checksum
How to use checksums
9daf5c2fa26e5dc40e6fea8ace19b57eb77f107d234759999430e6a6f1530828
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for cytomine-python-client 4.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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