Skip to main content

A unified financial data fetching engine for Stocks, Crypto, and Forex.

Project description

Finda 🔍

Finda is a powerful, unified financial data fetching engine designed to simplify access to historical market data. It seamlessly integrates multiple providers—Dukascopy, Binance, and Alpaca—into a single, robust interface for retrieving OHLCV (Open, High, Low, Close, Volume) and Tick data.

Whether you are building a backtesting engine, a trading bot, or a market analysis tool, Finda ensures you get the data you need by automatically falling back to alternative providers if your primary source is unavailable.

🚀 Key Features

  • Unified API: One function call to rule them all. Forget about managing different client libraries for stocks, crypto, and forex.
  • Smart Fallback System: Automatically retries with different providers (Dukascopy → Binance → Alpaca) to ensure high data availability.
  • Multi-Asset Support:
    • Forex: High-quality data via Dukascopy.
    • Crypto: Extensive coverage via Binance and Alpaca.
    • Stocks: US Equity data via Alpaca.
  • Flexible Timeframes: Supports standard formats like 1m, 1h, 1d, as well as provider-specific formats.
  • FastAPI Service: Comes with a built-in REST API for easy integration into microservices architectures.

🛠️ Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/finda.git
    cd finda
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Set up Environment Variables: Create a .env file in the root directory to configure your API keys (optional, but recommended for Alpaca):

    ALPACA_API_KEY=your_api_key
    ALPACA_SECRET_KEY=your_secret_key
    

📖 Usage

Python Library

You can use finda directly in your Python scripts:

from finda.ohlcv_fetcher import fetch_unified_ohclv
from finda.tick_fetcher import fetch_unified_tick

# Fetch OHLCV Data (Auto-fallback)
# Returns: (opens, highs, lows, closes, volumes, times)
data = fetch_unified_ohclv(
    symbol="BTC/USDT",
    user_tf="1h",
    user_start="2023-01-01-00-00-00",
    user_end="2023-01-02-00-00-00",
    api_key="your_alpaca_key",
    secret_key="your_alpaca_secret"
)

# Fetch Tick Data
# Returns: (provider_name, (bid, ask, bid_vol, ask_vol, real_vol, times))
provider, ticks = fetch_unified_tick(
    symbol="EUR/USD",
    user_tf="tick",
    user_start="2023-01-01-12-00-00",
    user_end="2023-01-01-13-00-00"
)

REST API

Start the server:

uvicorn main:app --reload

Endpoints:

  • GET /ohlcv: Fetch OHLCV candles.
    • symbol: e.g., BTC/USDT
    • tf: e.g., 1h
    • start: YYYY-MM-DD-HH-MM-SS
    • end: YYYY-MM-DD-HH-MM-SS
  • GET /tick: Fetch tick data.

🧪 Testing

Finda comes with a comprehensive test suite to ensure reliability.

# Run deep unified tests
python tests/unified_deep_test.py

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT 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

finda-0.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

finda-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: finda-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for finda-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bd02910b8d901a654f39ef4da3cc05b2f397551cf45ebc95b26f47b30bfab2b0
MD5 3158598af1bf28903b076f0019b3486b
BLAKE2b-256 577369dc3c266cb3c20411aaa45ea97a185fc11a7de1f7a28e2588cb26a1b837

See more details on using hashes here.

File details

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

File metadata

  • Download URL: finda-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for finda-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd4c3c589b4d12ab27003d9db2423c26499dc1617f37e293ce2cd9dcfc2fdac5
MD5 1286a30f4cf346d37f7e472c7ecc42c3
BLAKE2b-256 6105720aa07de7b7eefb9a8dd6bafae314a54d3ea0335cd40ab3694c655a8e75

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