Finzome_Assignments
Solutions to the Task 1&2 in the assigned Finzome Challenge
Financial Data Volatility Calculation (Task 1)
This repository contains Python code for calculating daily and annualized volatility from a financial dataset. The dataset is expected to be in CSV format, and the calculations are performed using Python with the help of Pandas and NumPy libraries.
Table of Contents
Introduction
The purpose of this project is to provide a Python script for calculating daily and annualized volatility from a given financial data. It uses standard financial formulas and makes use of Pandas and NumPy for efficient calculations.
Calculations
The key calculations performed by the script include:
Daily Returns:
Daily Volatility:
Annualized Volatility:
Tech Stack
Python
Pandas
NumPy
Usage
Clone the repository: git clone https://github.com/Ojas21/Finzome_Assignments.git cd Finzome_Assignment
Adding the path:
python Ojas21/Finzome_Assignments.py
Sample Dataset
The sample dataset used for testing the script is available in the data directory. You can replace it with your own financial dataset. by including your file path in the variable of the same name.
Financial Data Daily & Annualized Volatility Calculation (Task 2)
This repository contains a FastAPI-based web service for computing daily and annualized volatility from a CSV file with financial data.
Table of Contents
Introduction
The python file is a web service that calculates daily and annualized volatility from a given financial dataset in CSV format. It uses FastAPI, a modern, fast & high-performance web framework for building APIs with Python 3.7+.
Features
Daily and Annualized Volatility Calculation: The service calculates daily returns, daily volatility, and annualized volatility based on a financial dataset.
Tech Stack
FastAPI
Pandas
NumPy
uvicorn
Installation
Clone the repository: git clone https://github.com/Ojas21/Finzome_Assignments.git cd Finzome_Assignment
Usage
Run the FastAPI server: uvicorn main:app --reload
Open the FastAPI documentation in your browser: http://127.0.0.1:8000/docs
HTTP Endpoint
Endpoint: /compute_volatility Method: POST Parameters: file (type: file) - CSV file containing financial data. file_path (type: string) - Path to the CSV file (optional if using file upload).
Sample cURL Request
curl -X 'POST' \ 'http://127.0.0.1:8000/compute_volatility' \ -H 'accept: application/json' \ -H 'Content-Type: multipart/form-data' \ -F 'file=@path/to/your/financial_data.csv;type=text/csv'
License
This project is licensed under the MIT License.