Metadata-Version: 2.1
Name: pyfinq
Version: 0.2.0
Summary: 🔬 Enabling seamless quantitative finance solutions.
Home-page: https://github.com/wilhelmagren/finq
License: MIT
Keywords: finance,nasdaq,investment,yahoo-finance,data-science,time-series,analysis,optimization,data-analysis,quantiative-finance,portfolio-optimization,portfolio-management
Author: Wilhelm Ågren
Author-email: wilhelmagren98@gmail.com
Requires-Python: >=3.9,<3.13
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: matplotlib (>=3.8.0,<4.0.0)
Requires-Dist: numpy (>=1.26.0,<2.0.0)
Requires-Dist: openpyxl (>=3.1.2,<4.0.0)
Requires-Dist: pandas (>=2.1.1,<3.0.0)
Requires-Dist: pyrate-limiter (>=2.8.0,<3.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: requests-cache (>=1.1.0,<2.0.0)
Requires-Dist: requests-ratelimiter (==0.4.2)
Requires-Dist: tqdm (>=4.66.1,<5.0.0)
Requires-Dist: yfinance (>=0.2.31,<0.3.0)
Project-URL: Bug tracker, https://github.com/wilhelmagren/finq/issues
Project-URL: Repository, https://github.com/wilhelmagren/finq
Description-Content-Type: text/markdown

<div align="center">
<br/>
<div align="left">
<br/>
<p align="center">
<a href="https://github.com/wilhelmagren/finq">
<img align="center" width=75% src="docs/images/finq-banner.png"></img>
</a>
</p>
</div>

[![PyPI - Version](https://img.shields.io/pypi/v/pyfinq)](https://pypi.org/project/pyfinq)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![codecov](https://codecov.io/gh/wilhelmagren/finq/graph/badge.svg?token=9QTX90NYYG)](https://codecov.io/gh/wilhelmagren/finq)

[![CI](https://github.com/wilhelmagren/finq/actions/workflows/ci.yml/badge.svg)](https://github.com/wilhelmagren/finq/actions/workflows/ci.yml)
[![Tests](https://github.com/wilhelmagren/finq/actions/workflows/tests.yml/badge.svg)](https://github.com/wilhelmagren/finq/actions/workflows/tests.yml)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Lint style: Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)

</div>

## 🔎 Overview
The goal of *finq* is to provide an all-in-one Python library for **quantitative portfolio analysis and optimization** on historical and real-time financial data.

**NOTE:** Features are currently being determined and developed continuously. The repo is undergoing heavy modifications and could introduce **breaking changes** up until first major release. Current version is **v0.2.0**.

## 📦 Installation
Either clone this repository and perform a local install with [poetry](https://github.com/python-poetry/poetry/tree/master) accordingly
```
git clone https://github.com/wilhelmagren/finq.git
cd finq
poetry install
```
or install the most recent release from the Python Package Index (PyPI).
```
pip install pyfinq
```

## 🚀 Example usage
The standard way to define a custom dataset is to provide a list of security names and
their related ticker symbols,

```python
from finq.datasets import CustomDataset

names = ["Alfa Laval", "Boliden", "SEB A", "Sv. Handelsbanken A"]
symbols = ["ALFA.ST", "BOL.ST", "SEB-A.ST", "SHB-A.ST"]

dataset = CustomDataset(names, symbols, save=True)
dataset.fetch_data("3y") \
    .fix_missing_data() \
    .verify_data()

dataset.visualize(log_scale=True)
...
```

or if you don't know the syntax of the ticker symbols that you want, you can pass in a
valid NASDAQ index name and try and fetch its related ticker components. We can also
call the function `.run(period)` which performs the three steps the above cell does
(fetching, fixing, and verifying).
```python
from finq.datasets import CustomDataset

dataset = CustomDataset(nasdaq_index='NDX', save=False)
dataset.run("1y")

closing_prices = dataset.as_numpy("Close")
...
```

## 📋 License
All code is to be held under a general MIT license, please see [LICENSE](https://github.com/wilhelmagren/finq/blob/main/LICENSE) for specific information.

