Metadata-Version: 2.4
Name: financial_engine
Version: 0.1.0
Summary: A time-machine style financial backtesting and ratio analysis engine
Home-page: https://github.com/yourusername/financial-engine
Author: Raj Adhikari
Author-email: Raj Adhikari <adhikarirajj07@gmail.com>
License: Proprietary
Project-URL: Homepage, https://github.com/r-adhikari97/financial-engine
Project-URL: Issues, https://github.com/r-adhikari97/financial-engine/issues
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas
Requires-Dist: python-dotenv
Requires-Dist: aioboto3
Requires-Dist: motor
Requires-Dist: boto3
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# 📊 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.

---

## ✨ Features

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

---

## 🚀 Installation

```bash
pip install financial-engine
```

### Step-by-step

1. Create and activate a virtual environment:

   ```bash
   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:

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

   ```bash
   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

```python
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)
```

---

## 🧪 Testing

To test in a local project:

1. Create a `.env` file with valid AWS and Mongo credentials.
2. Install development dependencies:
   ```bash
   pip install -r requirements.txt
   ```
3. Run your test script using the API.

---
