Skip to content

bug-or-feature/pst-flask-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pst-flask-api

A REST API for pysystemtrade metrics, created with Flask

  • read ony, designed to be useful for monitoring, metrics or telemetry
  • allows access to pysystemtrade data such as:
    • process status
    • capital
    • positions

pysystemtrade dependency

pysystemtrade is not published on the Python Package Index, so by default it is defined as a git dependency:

[tool.uv.sources]
pysystemtrade = { git = "https://github.com/robcarver17/pysystemtrade" }

But if you have the API app running on the same machine, you could define it as a local editable dependency instead

$ uv remove pysystemtrade
$ uv add --editable /home/user/path/to/pysystemtrade

quickstart

One way to pick up the pysystemtrade config is to use the PYSYS_PRIVATE_CONFIG_DIR environment variable, as described here

PYSYS_PRIVATE_CONFIG_DIR=/home/user/private_config_dir flask --app pst_flask_api run

Using this technique, the file could be the same file as used by pysystemtrade, or not. It can be anywhere you specify, but must be called private_config.yaml. The only config values needed are those for MongoDB, and path to Parquet files

mongo_host: 127.0.0.1
mongo_db: production
mongo_port: 27017
parquet_store: /home/user/data/parquet

So, if you are using the default mongo configuration, you would only need the parquet one

endpoints

About

REST API for pysystemtrade, built with Flask

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages