{"id":37063657,"url":"https://github.com/romi/plantdb","last_synced_at":"2026-01-14T07:16:53.615Z","repository":{"id":37866695,"uuid":"187591641","full_name":"romi/plantdb","owner":"romi","description":"Database to host and serve images and processed data.","archived":false,"fork":false,"pushed_at":"2025-12-16T10:25:15.000Z","size":10760,"stargazers_count":2,"open_issues_count":14,"forks_count":2,"subscribers_count":11,"default_branch":"dev","last_synced_at":"2025-12-19T23:39:38.510Z","etag":null,"topics":["database"],"latest_commit_sha":null,"homepage":"https://romi.github.io/plantdb/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/romi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-05-20T07:39:38.000Z","updated_at":"2025-11-13T20:41:33.000Z","dependencies_parsed_at":"2023-10-17T04:58:10.597Z","dependency_job_id":"a5524df5-407d-4887-99c2-2455885756a1","html_url":"https://github.com/romi/plantdb","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/romi/plantdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romi%2Fplantdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romi%2Fplantdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romi%2Fplantdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romi%2Fplantdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/romi","download_url":"https://codeload.github.com/romi/plantdb/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/romi%2Fplantdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412776,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database"],"created_at":"2026-01-14T07:16:53.086Z","updated_at":"2026-01-14T07:16:53.606Z","avatar_url":"https://github.com/romi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [![ROMI_logo](docs/assets/images/ROMI_logo_green_25.svg)](https://romi-project.eu) / plantdb\n\n[![Licence](https://img.shields.io/github/license/romi/plantdb?color=lightgray)](https://www.gnu.org/licenses/lgpl-3.0.en.html)\n[![Python Version](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fromi%2Fplantdb%2Frefs%2Fheads%2Fdev%2Fsrc%2Fcommons%2Fpyproject.toml\u0026logo=python\u0026logoColor=white)]()\n[![GitHub branch check runs](https://img.shields.io/github/check-runs/romi/plantdb/dev)](https://github.com/romi/plantdb)\n\n| Package         | PyPI                                                                                                                                    | Conda                                                                                                                                                                                   |\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| plantdb.commons | [![PyPI - Version](https://img.shields.io/pypi/v/plantdb.commons?logo=pypi\u0026logoColor=white)](https://pypi.org/project/plantdb.commons/) | [![Conda - Version](https://img.shields.io/conda/vn/romi-eu/plantdb.commons?logo=anaconda\u0026logoColor=white\u0026label=romi-eu\u0026color=%2344A833)](https://anaconda.org/romi-eu/plantdb.commons) |\n| plantdb.server  | [![PyPI - Version](https://img.shields.io/pypi/v/plantdb.server?logo=pypi\u0026logoColor=white)](https://pypi.org/project/plantdb.server/)   | [![Conda - Version](https://img.shields.io/conda/vn/romi-eu/plantdb.server?logo=anaconda\u0026logoColor=white\u0026label=romi-eu\u0026color=%2344A833)](https://anaconda.org/romi-eu/plantdb.server)   |\n| plantdb.client  | [![PyPI - Version](https://img.shields.io/pypi/v/plantdb.client?logo=pypi\u0026logoColor=white)](https://pypi.org/project/plantdb.client/)   | [![Conda - Version](https://img.shields.io/conda/vn/romi-eu/plantdb.client?logo=anaconda\u0026logoColor=white\u0026label=romi-eu\u0026color=%2344A833)](https://anaconda.org/romi-eu/plantdb.client)   |\n\n\n## Overview\n\nPlantDB is a library for the ROMI (Robotics for Microfarms) plant database ecosystem.\nIt is designed for plant and agricultural research facilities and robotics labs that require lightweight plant data management infrastructure.\n\nIt consists of three components:\n\n1. `plantdb.commons`: provides a **Python API** for interacting with plant data\n2. `plantdb.server`: provides the _server-side_ REST API to interact with plant data\n3. `plantdb.client`: provides the _client-side_ REST API to interact with plant data\n\nFor comprehensive documentation of the _PlantImager_ project, visit: [https://docs.romi-project.eu/plant_imager/](https://docs.romi-project.eu/plant_imager/)\n\nAPI documentation for the `plantdb` library is available at: [https://romi.github.io/plantdb/](https://romi.github.io/plantdb/)\n\n### `plantdb.commons`\nCore shared library for the ROMI plant database ecosystem.\n\nThis package provides common utilities and base functionality used by both server and client components.\n\nFeatures include:\n- Data management\n- Common data models and schemas\n- File system operations and validation\n- Logging and debugging tools\n- Data format specifications and validators\n\n### `plantdb.server`\nServer-side component of the ROMI plant database system.\n\nProvides a robust REST API server implementation for managing plant phenotyping data.\n\nFeatures include:\n- File system database management\n- Data synchronization services\n- Command-line tools for database management\n\n### `plantdb.client`\nClient-side database library for the ROMI plant database ecosystem.\n\nThis package provides a Python interface for interacting with ROMI's plant database system,\nenabling efficient storage, retrieval, and management of plant-related data.\n\nFeatures include:\n- REST API integration\n- Data validation\n- Streamlined access to plant phenotyping data.\n\n\n## Environment Setup\n\nWe strongly recommend using isolated environments to install ROMI libraries.\nThis documentation uses `conda` as both an environment and package manager.\nIf you don't have`miniconda3` installed, please refer to the [official documentation](https://docs.conda.io/en/latest/miniconda.html).\n\nThe `plantdb` packages are available through:\n\n- `pip`: from [PyPI](https://pypi.org/)\n- `conda`: from the `romi-eu` channel on [anaconda.org](https://anaconda.org/romi-eu)\n\nTo create a new conda environment for PlantDB:\n``` shell\nconda create -n plantdb 'python=3.10' ipython\n```\n\n## Installation\n\n### For Users\n\nActivate your environment and install the packages using either `pip` or `conda`:\n\n#### Using pip:\n``` shell\nconda activate plantdb  # activate your environment first!\npip install plantdb.commons plantdb.server plantdb.client\n```\n\n#### Using conda:\n``` shell\nconda activate plantdb  # activate your environment first!\nconda install -c romi-eu plantdb plantdb.server plantdb.client\n```\n\n### For Developers\n\nTo install the library for development, you first have to clone the repository:\n``` shell\ngit clone https://github.com/romi/plantdb.git -b dev  # clone the 'dev' branch\ncd plantdb\nconda activate plantdb  # activate your environment first!\n```\n\nThen you may proceed to install the following components:\n#### Core library:\n``` shell\npython -m pip install -e src/commons/.[io]\n```\n\n#### Client-side library:\n``` shell\npython -m pip install -e src/client/.\n```\n\n#### Server-side library:\n``` shell\npython -m pip install -e src/server/.\n```\n\n**Info**:\n\u003e The `-e` flag installs the source in \"developer mode,\" allowing code changes to take effect without re-installation.\n\n\n### Running Tests\n\nInstall testing tools:\n``` shell\npython -m pip install -e .[test]\n```\n\nRun tests:\n\n- All tests with verbose output:\n  ``` shell\n  nose2 -s tests/ -v\n  ```\n\n- Tests with coverage report:\n  ``` shell\n  nose2 -s tests/ --with-coverage\n  ```\n\n## Getting started\n\n### Set up a local database\n\n1. You need to create a directory where to put the data, *e.g.* `/data/ROMI_DB` and add a file called `romidb`:\n   ```shell\n   mkdir -p /data/ROMI_DB\n   touch /data/ROMI_DB/romidb\n   ```\n2. Then define its location in an environment variable `ROMI_DB`:\n   ```shell\n   export ROMI_DB=/data/ROMI_DB\n   ```\n\n**Info**:\n\u003e To make this setting permanent, add the export command to your `~/.bashrc` or `~/.profile` file.\n\n\n### Example datasets\n\nTo populate your database with example datasets, you may use the `shared_fsdb` CLI as follows:\n\n```shell\nshared_fsdb $ROMI_DB --dataset all\n```\n\n### Docker image\n\nA docker image, named `roboticsmicrofarms/plantdb`, is distributed by the ROMI group.\nIf you want to use it, simply do:\n\n```shell\ndocker run -p 5000:5000 -v $ROMI_DB:/myapp/db -it roboticsmicrofarms/plantdb\n```\n\n**Obviously, you have to install docker first!**\n\n## Usage\n\n### Python API\n\nHere is a minimal example how to use the `plantdb` library in Python:\n\n```python\n# Get the environment variable $ROMI_DB\nimport os\n\ndb_path = os.environ['ROMI_DB']\n# Use it to connect to DB:\nfrom plantdb.commons.fsdb import FSDB\n\ndb = FSDB(db_path)\ndb.connect()\n# Access to a dataset named `real_plant` (from the example database)\ndataset = db.get_scan(\"real_plant\")\n# Get the 'images' fileset contained in this dataset\nimg_fs = dataset.get_fileset('images')\n```\n\nFor detailed documentation of the Python API, visit: [Python API Documentation](https://romi.github.io/plantdb/reference.html).\n\n### Serve the REST API\n\n#### Development Mode\n\nTo start the REST API in development mode using `fsdb_rest_api`, run:\n\n```shell\nfsdb_rest_api -db $ROMI_DB\n```\n\nYou should see output similar to this:\n\n```\nn scans = 5\n * Serving Flask app \"fsdb_rest_api\" (lazy loading)\n * Environment: production\n   WARNING: This is a development server. Do not use it in a production deployment.\n   Use a production WSGI server instead.\n * Debug mode: off\n * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)\n```\n\nOpen your favorite browser and navigate to:\n\n- scans: [http://0.0.0.0:5000/scans](http://0.0.0.0:5000/scans)\n- 'real_plant_analyzed' dataset: [http://0.0.0.0:5000/scans/real_plant_analyzed](http://0.0.0.0:5000/scans/real_plant_analyzed)\n\nFor detailed documentation of the REST API, visit: [REST API Documentation](https://romi.github.io/plantdb/webapi.html).\n\n\n### Transfer datasets between databases\nTo transfer datasets from one database to another, you may use the PlantDB Synchronization UI.\n\n#### 1. Install conda libraries\nIf not done already, create a new conda environment and install necessary packages:\n```shell\nconda create -n plantdb 'python=3.10' ipython plantdb.commons plantdb.client dash dash-bootstrap-components paramiko\n```\n\n#### 2. Start the PlantDB Synchronization App\nYou may now start the PlantDB Synchronization App:\n```shell\nconda activate plantdb\nsync_app\n```\n\n#### Production Mode\n\nTo serve in a production environment, we recommend building a Docker image.\n\n1. **Create a new volume** (e.g., `romi_db`):\n   ```shell\n   docker volume create romi_db\n   ```\n\n2. **Initialize the database**:\n   ```shell\n   docker run --rm \\\n     -v romi_db:/myapp/db \\\n     --user romi \\\n     roboticsmicrofarms/plantdb:latest \\\n     touch /myapp/db/romidb\n   ```\n\n3. **Build the Docker image** using the provided script:\n   ```shell\n   ./docker/build.sh -t latest\n   ```\n\n4. **Start a Docker container**:\n   ```shell\n   docker run --name plantdb_server \\\n     -d \\\n     -p 5000:5000 \\\n     -v romi_db:/myapp/db \\\n     --user romi \\\n     -e PLANTDB_API_PREFIX='/plantdb'\n     roboticsmicrofarms/plantdb:latest \\\n     uwsgi --http :5000 --module plantdb.server.cli.wsgi:application --callable application --master\n   ```\n\nIf you want to bind mount a local database, replace `-v romi_db:/myapp/db` with `-v /path/to/db:/myapp/db`.\nThe served database will be accessible at [http://localhost:5000/plantdb/scans](http://localhost:5000/plantdb/scans).\n\nNote: we use NGINX reverse proxy and locate the database behind the '/plantdb' prefix, hence the `-e PLANTDB_API_PREFIX='/plantdb'`.\n\n## Developers \u0026 contributors\n\n### Unitary tests\n\nSome tests are defined in the `tests` directory.\nWe use `nose2` to call them as follows:\n\n```shell\nnose2 -v -C\n```\n\nNotes:\n\n- the configuration file used by `nose2` is `unittests.cfg`\n- the `-C` option generate a coverage report, as defined by the `.coveragerc` file.\n- this requires the `nose2` \u0026 `coverage` packages listed in the `requirements.txt` file.\n\nYou first have to install the library from sources as explained [here](#installation-from-sources).\n\n### Conda packaging\n\nStart by installing the required `conda-build` \u0026 `anaconda-client` conda packages in the `base` environment as follows:\n\n```shell\nconda install -n base conda-build anaconda-client\n```\n\n#### Build a conda package\n\nTo build the `plantdb` conda packages, from the root directory of the repository and the `base` conda environment, run:\n\n1. Build the packages locally without uploading\n    ```shell\n    for pkg in commons server client; do\n      echo \"Building plantdb-$pkg package...\"\n      export ROMI_SUBPACKAGE=$pkg\n      conda build conda/recipe/ -c conda-forge --no-anaconda-upload\n    done\n    ```\n\n2. Test installing the built packages\n    After building, conda will show the path to the built package. You can install it to verify it works:\n    ```shell\n    # Create a test environment\n    conda create -n plantdb_test python=3.10 -y\n    conda activate plantdb_test\n    \n    # Install the locally built package\n    # Replace with actual path from conda build output\n    conda install -y -c conda-forge --use-local plantdb.commons\n    conda install -y --use-local plantdb.client\n    conda install -y --use-local plantdb.server\n    \n    # Install optional dependencies to run the PlantDB Sync App\n    conda install -y -c conda-forge dash dash-bootstrap-components paramiko\n   \n    # Test importing the packages\n    python -c \"import plantdb.commons; print('Successfully imported plantdb.commons')\"\n    python -c \"import plantdb.server; print('Successfully imported plantdb.server')\"\n    python -c \"import plantdb.client; print('Successfully imported plantdb.client')\"\n    \n    # Clean up\n    conda deactivate\n    conda env remove -n plantdb_test\n    ```\n\n**Note:**\nIf you encounter issues, you can use the --debug flag for more verbose output when building the package.\n```shell\nconda build conda/recipe/commons --debug --no-anaconda-upload\n```\n\n#### Render the recipe\nIf you are struggling with some of the modifications you made to the recipe,\nnotably when using environment variables or Jinja2 stuffs, you can always render the recipe with:\n\n```shell\nconda render conda/recipe/\n```\n\nThe official documentation for\n`conda-render` can be found [here](https://docs.conda.io/projects/conda-build/en/stable/resources/commands/conda-render.html).\n\n#### Upload a conda package\n\nTo upload the built packages, you need a valid account (here\n`romi-eu`) on [anaconda.org](www.anaconda.org) \u0026 to log ONCE\nwith `anaconda login`, then:\n\n```shell\nanaconda upload ~/miniconda3/conda-bld/linux-64/plantdb*.tar.bz2 --user romi-eu\n```\n\n#### Clean builds\n\nTo clean the source and build intermediates:\n\n```shell\nconda build purge\n```\n\nTo clean **ALL** the built packages \u0026 build environments:\n\n```shell\nconda build purge-all\n```\n\n### Docker `build.sh` \u0026 `run.sh` scripts\n\nTo facilitate the use of docker, we created two scripts, `build.sh` \u0026 `run.sh`, located in the `docker` folder in the\nsources.\n\nTo build a new `roboticsmicrofarms/plantdb` image, from the root folder, simply do:\n\n```shell\n./docker/build.sh\n```\n\nTo run the latest `roboticsmicrofarms/plantdb` image, from the root folder, simply do:\n\n```shell\n./docker/run.sh\n```\n\nUse the `-h` option to get help on using the scripts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromi%2Fplantdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fromi%2Fplantdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fromi%2Fplantdb/lists"}