Skip to main content
LoCaSt

Local Candle Store - A module to download price candles from exchanges and store them in a database.

Intro

LoCaSt handles candle data in a very straight forward manner:

  • There is one underlying Candle type to hold the relevant data of a price candle.
  • A group of such Candle objects is collected into a cluster, which is simply a List[Candle].
  • These clusters are written into an sqlite database and can be updated as needed.

Cluster

A cluster is a list of candle objects, representing a time series of price data. Per exchange (e.g.: dydx v4), market (e.g.: ETH) and resolution (e.g.: One minute), there can be exactly one cluster in the database. A cluster can be interacted with in the following ways.

Currently implemented

Features

  • Create cluster
  • Retrieve cluster
  • Retrieve n newest candles of a cluster
  • Update cluster
  • Delete cluster
  • Get info about cluster
    • newest candle
    • oldest candle
    • size of cluster (amount of candles it entails)
    • wether it is up to date or not
  • ... more to come

Exchanges

  • dydx v4

Storage Technologies

  • Sqlite

Examples

In the notebooks directory there are examples of the already implemented exchanges (starting with "example_"). This is a good starting point to try out and play around.

Collaboration

Here are some ideas and guidelines for collaboration.

Goals

  • Implement additional exchanges
  • Implement additional storage technologies, if desired
  • Improve code quality and maintainability
  • Help each other out and have a great time adding features :-)

Branches

There are two branches:

  • Main:
    • Expects pull requests from collaborators.
    • Pushing will trigger a unit test workflow
  • Release:
    • Is handled by maintainer to merge main into and update version number
    • Pushing will trigger the same unit test workflow and additionally publish to pypi.org

Code

This project tries to maintain readable and simple code.

Basic principles like DRY and separation of concerns are mandatory - but following patterns dogmatically is not desired at all.

In fact this project shall be a collaborative effort in which developers interested in it, can learn from each other and discuss their ideas and solutions.

Appart from that it is a tool for anybody who needs historic and current candle data available locally, without the hassle of talking to exchange APIs.

Contribute

To contribute, just make pull requests on main.

There are COLLABORATION markers throughout the test suite to mark and explain places that are relevant for new implementations. The general idea is to not require new implementations to come up with their unit and/or integration tests, but rather include their mock and production implementations through parametrization and fixtures in the existing test suite. This has the advantage of not having to write tests again and again but also enforces the behavior of new implementations to be identical to existing ones.

For example if we implement a new candle fetcher for the 1inch API, it can be implemented in what ever way is best - but it should behave exactly the same as the existing dydx implementations, which is enforced by the typing annotations and then verified by the parametrized test suite.

Of course if new test cases arise, they most certainly should be implemented for all existing implementations as well or at least deserve their own test file per exchange implementation.

Metadata

Release files for locast 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for locast 0.2.0
File Size Uploaded Provenance Actions
locast-0.2.0.tar.gz 16.2 kB Without provenance Details for locast-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for locast 0.2.0
File Interpreter ABI Platform Actions
locast-0.2.0-py3-none-any.whl Python 3 none any Details for locast-0.2.0-py3-none-any.whl

Total release size: 41.2 kB

Release files / locast-0.2.0.tar.gz

Download URL locast-0.2.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4ef57224bce8c3f207b3c56fd454498f3bfaf08cff75879a18210e57db32ee0c
BLAKE2b-256 checksum
How to use checksums
8c01b5a17d5bd75127812d40877ad4f821d5ce6aa24c4c24f430fad3e2c0c844
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.16 Linux/7.0.0-1019-azure

Release files / locast-0.2.0-py3-none-any.whl

Download URL locast-0.2.0-py3-none-any.whl
Size 25.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f922b00e953406db7f19693aab267057529b9ac404b8e9f404171ad3b0c5bc31
BLAKE2b-256 checksum
How to use checksums
84b7d6b894aa5077a5262b9d1a09bc6ba3f2e383aa432c3433ad2542695b8de9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.5.1 CPython/3.12.16 Linux/7.0.0-1019-azure

Security for locast 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page