Metadata-Version: 2.3
Name: stpstone
Version: 1.0.4
Summary: 
License: MIT
Author: Guilherme Rodrigues
Author-email: 55053188+guilhermegor@users.noreply.github.com
Requires-Python: >=3.12.8,<4.0.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: asyncio (==3.4.3)
Requires-Dist: backoff (==2.2.1)
Requires-Dist: basicauth (==1.0.0)
Requires-Dist: boto (==2.49.0)
Requires-Dist: bs4 (==0.0.2)
Requires-Dist: businesstimedelta (==1.0.1)
Requires-Dist: cvxopt (==1.3.2)
Requires-Dist: ftfy (==6.3.1)
Requires-Dist: investpy (==1.0.8)
Requires-Dist: joblib (==1.4.2)
Requires-Dist: keyring (==25.6.0)
Requires-Dist: lxml (==5.3.0)
Requires-Dist: mlxtend (==0.23.4)
Requires-Dist: more-itertools (==10.6.0)
Requires-Dist: nelson-siegel-svensson (==0.5.0)
Requires-Dist: numpy (==2.2.2)
Requires-Dist: numpy-financial (==1.0.0)
Requires-Dist: pandas (==2.2.3)
Requires-Dist: pathlib (==1.0.1)
Requires-Dist: plotly (==6.0.0)
Requires-Dist: psycopg (==3.2.4)
Requires-Dist: py7zr (==0.22.0)
Requires-Dist: pycurl (==7.45.4)
Requires-Dist: pymsteams (==0.2.5)
Requires-Dist: pymysql (==1.1.1)
Requires-Dist: pyodbc (==5.2.0)
Requires-Dist: pypdf (==5.2.0)
Requires-Dist: pytest (==8.3.4)
Requires-Dist: python-dateutil (==2.9.0.post0)
Requires-Dist: pytz (==2025.1)
Requires-Dist: pywin32 (==308) ; sys_platform == "win32"
Requires-Dist: pyyaml (==6.0.2)
Requires-Dist: requests (==2.32.3)
Requires-Dist: scikit-learn (==1.6.1)
Requires-Dist: seaborn (==0.13.2)
Requires-Dist: selenium (==4.28.1)
Requires-Dist: sendgrid (==6.11.0)
Requires-Dist: slack (>=0.0.2,<0.0.3)
Requires-Dist: sqlalchemy (==1.4.54)
Requires-Dist: statsmodels (==0.14.4)
Requires-Dist: sympy (==1.13.3)
Requires-Dist: tabula-py (>=2.10.0,<3.0.0)
Requires-Dist: unidecode (==1.3.8)
Requires-Dist: urllib3 (==2.3.0)
Requires-Dist: validate-docbr (==1.10.0)
Requires-Dist: wget (==3.2)
Requires-Dist: workalendar (==17.0.0)
Requires-Dist: xlwt (==1.3.0)
Requires-Dist: yfinance (==0.2.52)
Description-Content-Type: text/markdown

![alt text](img/logo_stpstone.png)

* Stylized name, shortened spelling of stepping stone;
* A Python framework for ingesting and interpreting structured and unstructured financial data, designed to optimize quantitative methods in financial markets.

## Key Features

* Data Extraction: Retrieve market data from various sources such as B3, CVM, and BACEN (Olinda);
* Quantitative Methods: Supports a range of quantitative techniques, including portfolio optimization, risk management, and financial modeling;
* Derivatives Pricing: Implements both closed-form solutions (e.g., Black-Scholes model) and open-form, iterative methods (e.g., Binomial Tree model) for pricing derivatives;
* Data Treatment: Tools for cleaning, structuring, and transforming raw financial data into usable formats for analysis;
* Data Loading: Seamlessly integrates with databases such as PostgreSQL, MySQL, and SQLite.

## Project Structure

    stpstone
    ├── airflow
    │   └── plugins.py
    ├── cals
    │   ├── br_bzdays.py
    │   ├── handling_dates.py
    │   └── usa_bzdays.py
    ├── charts
    │   ├── general_funcs.py
    │   ├── prob_and_stats.py
    │   ├── risk_management.py
    │   ├── stock_market.py
    │   └── tsir.py
    ├── cloud_clients
    │   └── aws_s3.py
    ├── document_numbers
    │   └── br.py
    ├── dsa
    │   └── trees
    │       └── b_tree.py
    ├── equity_consolidation
    │   └── banks.py
    ├── finance
    │   ├── anbima
    │   │   ├── abimadata_api.py
    │   │   ├── anbima_mtm.py
    │   │   ├── anbima_stats.py
    │   │   └── anbimadev.py
    │   ├── auditing
    │   │   └── earnings_manipulation.py
    │   ├── b3
    │   │   ├── cei.py
    │   │   ├── core.py
    │   │   ├── inoa.py
    │   │   ├── line.py
    │   │   ├── margin_simulator.py
    │   │   ├── market_data.py
    │   │   ├── search_by_trading.py
    │   │   └── up2data_web.py
    │   ├── comdinheiro
    │   │   └── api_request.py
    │   ├── cvm
    │   │   ├── cvm_data.py
    │   │   └── cvm_web.py
    │   ├── dadosdemercado_site
    │   │   └── api_request.py
    │   ├── debentures
    │   │   └── pricing.py
    │   ├── derivatives
    │   │   ├── forward.py
    │   │   ├── futures.py
    │   │   └── options
    │   │       ├── american.py
    │   │       └── european.py
    │   ├── financial_risk
    │   │   ├── capital_risk.py
    │   │   ├── liquidity_risk.py
    │   │   ├── market_risk.py
    │   │   └── yield_risk.py
    │   ├── macroeconomics
    │   │   ├── br_macro.py
    │   │   ├── global_rates.py
    │   │   ├── usa_macro.py
    │   │   └── world_gov_bonds.py
    │   ├── performance_apprraisal
    │   │   ├── company_return.py
    │   │   └── financial_math.py
    │   ├── reuters
    │   │   └── api_request.py
    │   ├── spot
    │   │   └── stocks.py
    │   └── tesouro_direto
    │       ├── calculadora.py
    │       └── consulta_dados.py
    ├── geography
    │   └── br.py
    ├── handling_data
    │   ├── dicts.py
    │   ├── folders.py
    │   ├── html.py
    │   ├── img.py
    │   ├── json.py
    │   ├── lists.py
    │   ├── lxml.py
    │   ├── numbers.py
    │   ├── object.py
    │   ├── pd.py
    │   ├── pdf.py
    │   ├── pickle.py
    │   ├── str.py
    │   ├── tgz.py
    │   ├── txt.py
    │   └── xml.py
    ├── llms
    │   └── gpt.py
    ├── loggs
    │   ├── create_logs.py
    │   └── db_logs.py
    ├── meta
    │   └── validate_pm.py
    ├── microsoft_apps
    │   ├── cmd.py
    │   ├── excel.py
    │   ├── onedrive.py
    │   ├── outlook.py
    │   └── windows_os.py
    ├── multithreading
    │   └── mp_helper.py
    ├── opening_config
    │   └── setup.py
    ├── pool_conn
    │   ├── dabricksCLI.py
    │   ├── databricks.py
    │   ├── generic.py
    │   ├── mongodb.py
    │   ├── mysql.py
    │   ├── postgresql.py
    │   ├── redis.py
    │   ├── session.py
    │   ├── sqlite.py
    │   └── sqlserver.py
    ├── quantitative_methods
    │   ├── calculus.py
    │   ├── classification.py
    │   ├── data_cleaning.py
    │   ├── eda.py
    │   ├── features_selecting.py
    │   ├── fit_assessment.py
    │   ├── interpolation.py
    │   ├── linear_algebra.py
    │   ├── prob_distributions.py
    │   ├── regression.py
    │   ├── root.py
    │   ├── sequences.py
    │   ├── statistical_description.py
    │   └── statistical_inference.py
    ├── sendgrid
    │   └── handling_sendgrid.py
    ├── settings
    │   ├── _global_slots.py
    │   ├── anbima.yaml
    │   ├── b3.yaml
    │   ├── br_macro.yaml
    │   ├── br_treasury.yaml
    │   ├── comdinheiro.yaml
    │   ├── generic.yaml
    │   ├── global_rates.yaml
    │   ├── inoa.yaml
    │   ├── llms.yaml
    │   ├── microsoft_apps.yaml
    │   ├── session.yaml
    │   ├── usa_macro.yaml
    │   └── world_gov_bonds.yaml
    ├── trading_platforms
    │   └── mt5.py
    ├── typeform_sdk_master
    │   ├── CHANGELOG.md
    │   ├── CONTRIBUTING.md
    │   ├── LICENSE
    │   ├── MANIFEST.in
    │   ├── README.md
    │   ├── requirements-dev.txt
    │   ├── setup.cfg
    │   ├── setup.py
    │   └── typeform
    │       ├── __init__.py
    │       ├── client.py
    │       ├── constants.py
    │       ├── dealing_tf.py
    │       ├── forms.py
    │       ├── responses.py
    │       ├── test
    │       │   ├── __init__.py
    │       │   ├── fixtures.py
    │       │   ├── suite.py
    │       │   ├── test_client.py
    │       │   ├── test_forms.py
    │       │   └── test_responses.py
    │       └── utils.py
    └── webhooks
        ├── slack.py
        └── teams.py




## Getting Started

These instructions will get you a copy of the project running on your local machine for development and testing purposes.

### Prerequisites

* Python ^3.12

### Installing

#### PyPi.org

```bash
(bash)

# latest version
pip install stpstone
```

* Available at: https://pypi.org/project/stpstone/

#### Local Machine Version

* Git clone

* Pyenv for Python ^3.12.8 local installation:

```powershell
(PowerShell)

Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/pyenv-win/pyenv-win/master/pyenv-win/install-pyenv-win.ps1" -OutFile "./install-pyenv-win.ps1"; &"./install-pyenv-win.ps1"
```

```bash
(bash)

echo installing local version of python within project
cd "complete/path/to/project"
pyenv install 3.12.8
pyenv versions
pyenv global 3.12.8
pyenv local 3.12.8
```

* Activate poetry .venv
```bash
(bash)

echo defining local pyenv version
pyenv global 3.12.8
pyenv which python
poetry env use "COMPLETE_PATH_PY_3.12.8"
echo check python version running locally
poetry run py --version

echo installing poetry .venv
poetry init
poery install --no-root

echo running current .venv
poetry shell
poetry add <package name, optionally version>
poetry run <module.py>
```

## Running the Tests

* EDA - Exploratory Data Analysis:
```(bash)

(bash)

cd "complete/path/to/project"
poetry run python stpstone.tests.eda.py

```

* European / American Options:
```(bash)

(bash)

cd "complete/path/to/project"
poetry run python tests.european-american-options.py

```

* Markowitz Portfolios:
```(bash)

(bash)

cd "complete/path/to/project"
poetry run python tests.markowitz-portfolios.py

```


## Authors

**Guilherme Rodrigues** 
* [GitHub](https://github.com/guilhermegor)
* [LinkedIn](https://www.linkedin.com/in/guilhermegor/)

## License


## Acknowledgments

* Hat tip to anyone whose code was used
* Inspiration
* etc

## Inspirations

* [Gist](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2)
