Skip to main content

Python API implementation of PSI fytotron API

Project description

PSI Fytotron API implementation

PyPI version


Photon System Instruments (PSI) develivers equipment accross 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

Unfortunately currently only available on test pypi, installable with: python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple psi-fytotron pip install psi-fytotron
Build and tested with python 3.8 on windows 10
Cross platform support for Linux, macOS and Windows

Example implementation

Uses a .env file with the following fields:

URL: <"http://<ip-address/path>:<poort>/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]
    

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

psi_fytotron-0.1.63.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

psi_fytotron-0.1.63-py3-none-any.whl (39.1 kB view details)

Uploaded Python 3

File details

Details for the file psi_fytotron-0.1.63.tar.gz.

File metadata

  • Download URL: psi_fytotron-0.1.63.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for psi_fytotron-0.1.63.tar.gz
Algorithm Hash digest
SHA256 e8d25dbdc11a59ebf7c41dac3bda02279aa0b4a5a1952622136d756139b51657
MD5 9fa15d6ba349e9970084930f81369a50
BLAKE2b-256 7114c15bfe7ca33e560874ea4463ecf37072884720b9bc1c83a68f4c8f65e8b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for psi_fytotron-0.1.63.tar.gz:

Publisher: release.yml on NPEC-NL/PSI-Fytotron-API

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file psi_fytotron-0.1.63-py3-none-any.whl.

File metadata

  • Download URL: psi_fytotron-0.1.63-py3-none-any.whl
  • Upload date:
  • Size: 39.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for psi_fytotron-0.1.63-py3-none-any.whl
Algorithm Hash digest
SHA256 f3390a3ed8fd78b780a91e7fd18a58aceec348069712e05af90839d2f4f7221f
MD5 78b19ff61ee8f098131d0f9d9f5c0e39
BLAKE2b-256 11a4cdd19c5810eab348a2f2d8db5034e12109b11de5f985775ab7b96f90e124

See more details on using hashes here.

Provenance

The following attestation bundles were made for psi_fytotron-0.1.63-py3-none-any.whl:

Publisher: release.yml on NPEC-NL/PSI-Fytotron-API

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page