Skip to main content

PSI Fytotron API implementation

PyPI version


Photon System Instruments (PSI) delivers equipment across the globe. Most of their cells are controlled by a fytotron PC, for which they also provide an optional API. To simplify the implementation and sharing of analysis workflows, we created an OpenAPI specification file and use the Openapi Generator to generate this package.

Installation & Usage

Install from PyPI:

pip install psi-fytotron

Build and tested with Python 3.9+
Cross-platform support for Linux, macOS and Windows

Example implementation

Uses a .env file with the following fields:

URL: http://<ip-address/path>:<port>/fyto/rest
TOKEN: <Fytotron API access token>

The environment files have one additional depency: pip install python-dotenv Example code: https://github.com/NPEC-NL/PSI-Fytotron-API/blob/main/example_implementation.py?plain=1#L2-L32

Contributing

We welcome contributions! If you encounter bugs, have feature requests, or want to suggest improvements, please create an issue and provide a clear description.

Setting up a Development Environment

Requires Python 3.9+

  1. Create a virtual environment (venv):
    python -m venv .venv
    
  2. Activate the venv:
    • On Windows:
      .venv\Scripts\activate
      
    • On macOS/Linux:
      source .venv/bin/activate
      
  3. Install the package with build and test dependencies:
    pip install .[build, test]
    

For developers

This repository contains a few workflows, they work as follows:

  • build client, is triggered by a commit and builds the python client from the specification file.
  • Build docs, triggered by the completion of build client uses mkdocs to create the documentation pages.
  • Test fytotron client, triggered by the completion of build client or by a pull request, runs the unittests on the repository.
  • release, can be triggered manually to create a release on testpypi or through a release to push to pypi. To install the release from testpypi, the following command can be used: python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple psi-fytotron

Updating the OpenAPI specification file

The API is automatically generated from the OpenAPI specification file with the openapi generator cli. The workflows automatically build the client and copy the files to the right folders.

Documentation

Build with mkdocs-material

Documentation for API Endpoints

All URIs are relative to https://localhost:8000/fyto/rest

Class Method HTTP request Description
FytotronApi getvar GET /getvar Returns the current value of the variable
FytotronApi info GET /info Returns all setpoints and actual values in the database.
FytotronApi monitor GET /monitor Returns the current status of the fytotron
FytotronApi setvar POST /setvar Set the setpoint value

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: X-Auth-Token
  • Location: HTTP header

Metadata

Release files for psi-fytotron 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psi-fytotron 0.2
File Size Uploaded Provenance Actions
psi_fytotron-0.2.tar.gz 42.4 kB With provenance Details for psi_fytotron-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for psi-fytotron 0.2
File Interpreter ABI Platform Actions
psi_fytotron-0.2-py3-none-any.whl Python 3 none any Details for psi_fytotron-0.2-py3-none-any.whl

Total release size: 81.7 kB

Release files / psi_fytotron-0.2.tar.gz

Download URL psi_fytotron-0.2.tar.gz
Size 42.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4fc80070b19cad2d30a17c9842762017afa2099cba3cc53e8463faef8a15e0f5
BLAKE2b-256 checksum
How to use checksums
04946f51941a5628bae04c9ef08c02080ae6791512f06d3371f77219f8f8ea2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Release files / psi_fytotron-0.2-py3-none-any.whl

Download URL psi_fytotron-0.2-py3-none-any.whl
Size 39.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65a06fb58f3319b7dd9b38aed68677d7abef137ca90918065a850c7797c42ce7
BLAKE2b-256 checksum
How to use checksums
9f14c0e424a196a76db0a459ea7495632efdc41c4636d97f1a78533c523d23df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

Security for psi-fytotron 0.2

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for psi_fytotron-0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 27, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files Full provenance

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