Skip to main content

Unified OHLCV fetching for crypto, forex, and equities with multi-provider support and technical indicators

Project description

Candlecraft

PyPI CI Python 3.10+ License: MIT

Unified OHLCV fetching for crypto, forex, and equities — one Python API, multiple data providers, packaged technical indicators.

Stable beta — used in production market-making workflows at 3poch Labs. Powers data for MarketMakingMegaMachine.

Install

pip install candlecraft

30-second example

from candlecraft import fetch_ohlcv, load_indicator

candles = fetch_ohlcv("BTCUSDT", "1h", limit=24)
rsi = load_indicator("rsi")(candles)

print(f"Latest close: {candles[-1].close}")
print(f"Latest RSI: {rsi[-1]['rsi']}")

Features

  • Single fetch_ohlcv() for crypto, forex, and equities
  • Auto provider selection (Binance for crypto, Twelve Data for forex/equity)
  • Typed OHLCV dataclass with validation
  • Rate-limit handling (raise or sleep strategies)
  • 10 technical indicators included in the package (pip install works)

Providers

Provider Asset classes API keys
Binance Crypto Optional (public API supported)
Twelve Data Crypto, Forex, Equity TWELVEDATA_SECRET required
from candlecraft import Provider, fetch_ohlcv

candles = fetch_ohlcv("EUR/USD", "1d", provider=Provider.TWELVEDATA, limit=30)

Indicators

from candlecraft import list_indicators, load_indicator

print(list_indicators())
# ['adx', 'atr', 'bollinger', 'ema', 'macd', 'obv', 'rsi', 'sma', 'stochastic', 'vwap']

macd = load_indicator("macd")
result = macd(candles)

CLI

git clone https://github.com/alfredalpino/Candlecraft.git
cd Candlecraft
pip install -e ".[dev]"

python pull_ohlcv.py --symbol BTCUSDT --timeframe 1h --limit 10 --indicator rsi

Development

pip install -e ".[dev]"
pytest -m "not integration"    # unit tests (no API keys)
pytest -m integration          # live API tests (keys required)
ruff check candlecraft tests

Documentation

Related projects

License

MIT — see LICENSE.

Project details


Download files

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

Source Distribution

candlecraft-0.2.0.tar.gz (25.7 kB view details)

Uploaded Source

Built Distribution

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

candlecraft-0.2.0-py3-none-any.whl (25.2 kB view details)

Uploaded Python 3

File details

Details for the file candlecraft-0.2.0.tar.gz.

File metadata

  • Download URL: candlecraft-0.2.0.tar.gz
  • Upload date:
  • Size: 25.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for candlecraft-0.2.0.tar.gz
Algorithm Hash digest
SHA256 1aeca53d0a415645927217c7552a04ff0cb5cef7e1b3ea7bc8d3e7eb6b37fe4c
MD5 ad6a38b53602971de68c90d41b5cb9c9
BLAKE2b-256 31356c927984b1b9aece25d1213acb17f362f8f9519359d52b78f0aec1f1052a

See more details on using hashes here.

Provenance

The following attestation bundles were made for candlecraft-0.2.0.tar.gz:

Publisher: publish.yml on alfredalpino/Candlecraft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file candlecraft-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: candlecraft-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 25.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for candlecraft-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9f06f7545300dd2999066c4a3659cf3c9a2b0e8299c645a73a3e941f0daaf2f0
MD5 3707a86adbb3b73c48ae1adfce75e27f
BLAKE2b-256 b93d17204505f08cbc01ba20b2ea449320d99255d75baa824db6c7e8dc82a468

See more details on using hashes here.

Provenance

The following attestation bundles were made for candlecraft-0.2.0-py3-none-any.whl:

Publisher: publish.yml on alfredalpino/Candlecraft

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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