Skip to main content

A time-machine style financial backtesting and ratio analysis engine

Project description

📊 Financial Engine

A time-machine for market data — replay and analyze historical financial data for one or more companies across single or multiple dates.

Built to backtest strategies, calculate financial ratios, and accelerate data analysis using a smart caching mechanism.


📦 Changelog

See full CHANGELOG.md


✨ Features

  • 📈 Calculate financial ratios on-demand
  • 🔁 Perform rolling computations for line items
  • ⚡ Caching mechanism for fast range-date processing

🚀 Installation

pip install financial-engine

Step-by-step

  1. Create and activate a virtual environment:

    python -m venv .venv
    source .venv/bin/activate  # or .venv\Scripts\activate on Windows
    
  2. Create a .env file in the root of your project:

    MONGO_URI=
    MONGO_DATABASE=
    MONGO_COLLECTION=
    AWS_ACCESS_KEY_ID=
    AWS_SECRET_ACCESS_KEY=
    BUCKET_NAME=
    
  3. Install the package:

    pip install financial-engine
    

🐍 Requirements

  • Python ≥ 3.9
  • Compatible with major OS environments (Linux, Windows, Mac)

🛠 Implemented Methods

Method Description
get_ratios() Get financial ratios for a single company on a specific date
get_ratios_range() Fetch financial ratios for a company across a date range

📦 Usage Example

from financial_engine.core.engine import FinancialEngine

fe = FinancialEngine()

ratios_df = await fe.get_ratios_range(
    alpha_code="RELIANCE",
    start_date="2023-01-01",
    end_date="2023-01-15"
)
print(ratios_df)

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

financial_engine-0.1.2.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

financial_engine-0.1.2-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file financial_engine-0.1.2.tar.gz.

File metadata

  • Download URL: financial_engine-0.1.2.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for financial_engine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 845eae4a0831a84665fc18ad1e8f74b403db8c46754954fc12517942a964a8ed
MD5 66b32f65daa0fab7e1cb42fdd9a9e477
BLAKE2b-256 81582054952bbac3e392210bf8cbe65a6005a1d84ffc7c02b26f9842305d5856

See more details on using hashes here.

File details

Details for the file financial_engine-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for financial_engine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 90a35cbb2c6ff9d2dc9953d5c7cf38d5f1370754549a5979bfc0355c6a27eaf1
MD5 b776b00c137020e1433d4a850262be35
BLAKE2b-256 22bd6ee7f49294c23faeccee1d20202a6d57c42a4c91ba3be7b91021ed991735

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