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.

GitHub release

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

Release files for cytomine-python-client 4.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 cytomine-python-client 4.3.0
File Size Uploaded
cytomine_python_client-4.3.0.tar.gz 33.0 kB Details

Built distribution (wheel)

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

Total release size: 76.5 kB

Release files / cytomine_python_client-4.3.0.tar.gz

Download URL cytomine_python_client-4.3.0.tar.gz
Size 33.0 kB
Tags Source
SHA-256 checksum
How to use checksums
1f77b427e7f4d67a491e83a867b6f2a715f0c4e804ed4ca948873c1f434fb647
BLAKE2b-256 checksum
How to use checksums
8fd40df64139759cd822faf2bf712b6292688340ecb893b2f18ebf900f6872c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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.3.0-py3-none-any.whl

Download URL cytomine_python_client-4.3.0-py3-none-any.whl
Size 43.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
552d72be5bd8a29af8193ccf604838194c7080e1b30f0c3a51604c1ad445dc9e
BLAKE2b-256 checksum
How to use checksums
7d224b769daea6af596e0c60013beb839bf74d5828370eaa8237dc6ffe97e68c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","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 history Release notifications | RSS feed

This release

4.3.0 This release

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.1.0

1 release file

3.0.0

1 release file

2.4.1

1 release file

2.4.0

1 release file

2.3.4

1 release file

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