• Python 94.3%
  • Dockerfile 4.9%
  • Shell 0.8%
Find a file
2025-09-09 16:21:36 +02:00
.github fix: change secret name to not conflict with GitHub 2025-03-11 15:58:57 -07:00
data data: update datamed artifact 2025-04-20 01:08:05 +00:00
src rewrite to api 2025-09-09 16:09:52 +02:00
tests fix: ci app-test 2025-02-26 01:20:10 -07:00
.dockerignore rewrite to api 2025-09-09 16:09:52 +02:00
.gitignore feat: add unit test workflow 2025-01-29 23:43:17 -08:00
app.py rewrite to api 2025-09-09 16:09:52 +02:00
docker-compose.yml fix port mapping to localhost 2025-09-09 16:21:36 +02:00
Dockerfile misc: switch prod to 8080 2025-09-09 16:11:54 +02:00
README.md misc: switch prod to 8080 2025-09-09 16:11:54 +02:00
requirements.txt rewrite to api 2025-09-09 16:09:52 +02:00
start.sh misc: switch prod to 8080 2025-09-09 16:11:54 +02:00

harm reduction api for substance information

quick start

# build and run
docker-compose up --build

# or run in background
docker-compose up -d --build

api will be available at http://localhost:8080

without docker

# install python 3.7+
pip install -r requirements.txt

# run
python app.py

api endpoints

  • GET / - api documentation
  • GET /api/substance/{slug} - get substance data from all sources
  • GET /api/substance/{slug}/sources/{source} - get substance data from specific source

examples

# get lsd data
curl http://localhost:8080/api/substance/lsd

# get lsd data from tripsit only
curl http://localhost:8080/api/substance/lsd/sources/tripsit

# get api docs
curl http://localhost:8080/

data sources

  • tripsit - community harm reduction database
  • psychonautwiki - research-based substance info

production

the docker setup includes:

  • gunicorn wsgi server
  • health checks
  • non-root user
  • optimized for production