Metadata-Version: 2.3
Name: bento-sts
Version: 0.1.16
Summary: Bento Simple Terminology Server
License: Apache-2.0
Author: Mark Benson
Author-email: mark.benson@nih.gov
Maintainer: Mark A. Jensen
Maintainer-email: mark.jensen@nih.gov
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: Apache Software License
Requires-Dist: Bootstrap-Flask (>=1.5.2)
Requires-Dist: Flask-Moment (>=0.5.2)
Requires-Dist: Flask-Paginate (>=2021.10.29)
Requires-Dist: Flask-WTF (>=0.14.3)
Requires-Dist: Jinja2 (>=2.11.3)
Requires-Dist: MarkupSafe (>=1.1.1)
Requires-Dist: PyYAML (>=5.4.1)
Requires-Dist: WTForms (>=2.1)
Requires-Dist: WTForms-Components (>=0.10.5)
Requires-Dist: Werkzeug (==3.0.6)
Requires-Dist: babel (>=2.17.0,<3.0.0)
Requires-Dist: bento-meta (>=0.2.16,<0.3.0)
Requires-Dist: certifi (>=2025.4.26,<2026.0.0)
Requires-Dist: cryptography (>=45.0.3,<46.0.0)
Requires-Dist: flask (>=2.3.2,<3.0.0)
Requires-Dist: flask-testing (>=0.8.1,<0.9.0)
Requires-Dist: guess-language-spirit (>=0.5.3)
Requires-Dist: gunicorn (>=20.1.0)
Requires-Dist: idna (>=2.6)
Requires-Dist: importlib_resources (>=5.4.0)
Requires-Dist: itsdangerous (>=0.24)
Requires-Dist: jsonschema (<4.11.0)
Requires-Dist: mako (>=1.3.10,<2.0.0)
Requires-Dist: neo4j (>=4.1)
Requires-Dist: pytest (>=8.0.0)
Requires-Dist: pytest-docker (>=3.1.1)
Requires-Dist: pytest-flask (>=1.3.0,<2.0.0)
Requires-Dist: pytest-mock (>=3.14.0,<4.0.0)
Requires-Dist: python-dateutil (>=2.6.1)
Requires-Dist: python-dotenv (>=0.15.0)
Requires-Dist: python-editor (>=1.0.3)
Requires-Dist: pytz (>=2017.2)
Requires-Dist: requests (>=2.32.4)
Requires-Dist: setuptools (>=80.9.0,<81.0.0)
Requires-Dist: six (>=1.15.0)
Requires-Dist: tornado (>=6.5.1,<7.0.0)
Requires-Dist: urllib3 (>=2.5.0,<3.0.0)
Requires-Dist: visitor (>=0.1.3)
Project-URL: Bug Tracker, https:/github.com/CBIIT/bento-sts/issues
Project-URL: Homepage, https://github.com/CBIIT/bento-sts
Description-Content-Type: text/markdown

# bento-sts

Simple Terminology Service for [Bento MDB](https://github.com/CBIIT/bento-mdb).

The STS provides a web-based UI and a RESTful API for
browsing and accessing graph data models and associated controlled
vocabulary. See [https://cbiit.github.io/bento-meta/](https://cbiit.github.io/bento-meta/)
for an overview of the backend Metamodel Database (MDB). 

## Install

    pip install bento-sts

## Run

In the run directory, provide a `.env` file, with your appropriate
values for the environment variables given the the example file
[bento-sts.env.eg](./python/bento-sts.env.eg).

For testing:

    flask --app "bento_sts.sts:create_app()" run

For production, consider using
[gunicorn](https://docs.gunicorn.org/en/latest/index.html). [./src](./src)
contains two gunicorn config file examples, for development and production.

    gunicorn -c gunicorn.conf.dev.py

will start STS on a gunicorn server at http://localhost:8000.


## Dev Install

To work on bento-sts, make sure you have [Poetry](https://python-poetry.org/):

    pip install poetry

Then use it from the python working directory to install dependencies into a virtualenv:

    cd bento-sts/python
    poetry install

## Dev Model Database for Testing

The easiest way to provide a backend graph database for a local STS is to use Docker.
The following will get a workable model database running for STS development:

    docker pull maj1/test-mdb
    docker run -d -p7687:7687 --env NEO4J_AUTH=none --name test-mdb maj1/test-mdb

Then set the following in your src/.env file:

    NEO4J_MDB_URI=bolt://localhost:7867
    NEO4J_MDB_USER=neo4j
    NEO4J_MDB_PASS=neo4j
    STS_LOGFILE=./sts.log

## Run Local STS

Once the database is running and configured, start the local STS as follows:

    cd bento-sts/python/src
    poetry run flask --app "bento_sts.sts:create_app()" run

You should be able to see the frontend on your machine at http://localhost:5000.

## API Docs

The API is documented in an [OpenAPI (Swagger) schema](/swagger/swagger.yaml). 

Docker is probably the easiest way to run a local Swagger server. 
This will bring up a Swagger server at port 6000:

    # from the repo root, run...
    docker run -p 6000:8080 -e SWAGGER_JSON=/work/swagger.json -v ${PWD}/swagger:/work docker.swagger.io/swaggerapi/swagger-ui

(see [https://swagger.io/docs/open-source-tools/swagger-ui/usage/installation/](https://swagger.io/docs/open-source-tools/swagger-ui/usage/installation/))

