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.3.tar.gz (12.9 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.3-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: financial_engine-0.1.3.tar.gz
  • Upload date:
  • Size: 12.9 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.3.tar.gz
Algorithm Hash digest
SHA256 103924c2567c0ef6a37f3f2d07dcb19c449a16a347fd6cd9683de56246c6110d
MD5 08d9f0592f33d415576d1337ca942f62
BLAKE2b-256 78c794205767152d8ad350297d8dd704b301402e6238971dd18180f7ed76e87a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for financial_engine-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4916a05beaf9311d34d1ab9e2287bbe99f40c5b95940a4b356f2041feca0507e
MD5 89f5937f971e13752d11795ce83ceb74
BLAKE2b-256 b544e96112ffb994c72c3e5b50d743b575ec79f8407d64344f377cafd527a1ab

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