A time-machine style financial backtesting and ratio analysis engine
Project description
📊 Financial Engine
Originally Developed by : Raj Adhikari
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
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # or .venv\Scripts\activate on Windows
-
Create a
.envfile in the root of your project:MONGO_URI= MONGO_DATABASE= MONGO_COLLECTION= AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= BUCKET_NAME=
-
Install the package:
pip install financial-engine
🐍 Requirements
- Python ≥ 3.10
- 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 |
get_ratios_range_multiple() |
Fetch financial ratios for multiple comapnies 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file financial_engine-0.1.4.tar.gz.
File metadata
- Download URL: financial_engine-0.1.4.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b927e49f71b8b49969bfedb33e459d0d1643edc81d1422431b75a79d52f9ff4
|
|
| MD5 |
098bc05def6a8b2b57bc82ac72ad2884
|
|
| BLAKE2b-256 |
0bdf979f1e30456134bdde58054448fe672e84aaaa05f42f7747f75510ae60c4
|
File details
Details for the file financial_engine-0.1.4-py3-none-any.whl.
File metadata
- Download URL: financial_engine-0.1.4-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c990414afa0b9b283432e76509f72e92b29cdd9ef3836be2d431d06e3717091
|
|
| MD5 |
d35460fddaaf1cc34b9ac4bbb3ee9242
|
|
| BLAKE2b-256 |
afccb199b504e4b33a9da06a427c966d60fbd93f4ce38489df48539f486bd1df
|