Skip to main content

jgt-pricedb

The persistence layer of the next-generation Price Service: bars live in a database with an incremental, anchor-based refresh — CSV files become an export, not the source of truth.

Lineage: implementation of the PDSP specifications reverse-engineered from the Caishen .NET stack — caishen/rispecs/PDSP/ (specs 70–77) — translated into the jgt ecosystem's shapes.

Structural Tension

  • Current reality: price data as flat CSVs ($JGTPY_DATA/pds/<INSTR>_<TF>.csv); every refresh rewrites whole files and downstream recomputes whole series.
  • Desired state: a database-backed store where refresh finds the anchor (the single forming bar per series) and writes only forward; downstream learns which bar changed and computes incrementally.

Decisions

  • Portable schema (SQLite for local-first dev, PostgreSQL for deployment); the anchor invariant is enforced by a partial unique index (UNIQUE(series_id) WHERE is_forming), not by application discipline.
  • No standalone importer. Backfill is the refresh engine's bootstrap path (PDSP spec 72, Algorithm C) fed by a source adapter. CsvSource reads the existing full/ CSVs through the exact same upsert path as BrokerSource live updates. The system can always rebuild itself from its own sources.
  • CSV compatibility export (PDSP spec 75 pattern): consumers (jgtpy, jgtml, jgt-data-server) keep reading the same file paths while the database becomes authoritative underneath. Nothing breaks on day one.
  • Redis pub/sub (already in the jgt-data-server stack) carries bar-completed events in Phase 4 — the role Rebus/MSMQ played in Caishen.
  • pyproject.toml with a static version — deliberately avoiding the setup.py circular-import pattern that blocks other jgt packages from installing in containers.

Phases

Phase Creates PDSP spec
1 Schema + store core + bootstrap-backfill through source adapters 70, 71, 72
2 Refresh CLI (jgtpdscli) replacing refresh_data.sh 72, 74
3 CSV export bridge — DB authoritative, downstream untouched 75
4 Redis events → incremental IDS/CDS recompute 73, 77
5 Serving from DB; indicator tables; strategy layer (SpiderDb heir) 76

Layout

  • rispecs/ — jgt-native specifications (the buildable truth; start here)
  • src/jgtpricedb/ — the library
  • docker-compose.yml — optional Postgres for deployment; SQLite needs nothing

Download files

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

Source Distribution

jgtpricedb-0.1.0.tar.gz (80.2 kB view details)

Uploaded Source

Built Distribution

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

jgtpricedb-0.1.0-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file jgtpricedb-0.1.0.tar.gz.

File metadata

  • Download URL: jgtpricedb-0.1.0.tar.gz
  • Upload date:
  • Size: 80.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.4

File hashes

Hashes for jgtpricedb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c2eaf539700631644221f96304f7fb03c8041c840a0a9f38a292d3ad5e0a9e29
MD5 e8f21496b3b336afa59de9aad523e8ae
BLAKE2b-256 d0c2dc071b4bd763cef2dd18c4a1169a114c37d09cd0592fe06e295cec44237f

See more details on using hashes here.

File details

Details for the file jgtpricedb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: jgtpricedb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.4

File hashes

Hashes for jgtpricedb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3130f745f2587e420da82488add6f8a1583b9f9106633b098e7d11740c2ba45
MD5 5252a3bf01cc49d4188e2417a96bf78f
BLAKE2b-256 e3233b05484ee6da1d9bd1e8e9ea6320289bfc4afa5257c1ba6e50f25464badb

See more details on using hashes here.

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