Numerical economics and research utilities.
Project description
PyTools
py_tools is a research-oriented Python toolkit for numerical economics, time series, estimation, and dataset loading utilities.
Installation
Install from PyPI:
pip install dgreenwald-py-tools
Or clone the repository and install in editable mode:
pip install -e .
Optional extras:
pip install "dgreenwald-py-tools[ml]" # scikit-learn, patsy
pip install "dgreenwald-py-tools[datasets]" # pandas-datareader, python-dotenv
pip install "dgreenwald-py-tools[scraping]" # requests, beautifulsoup4, lxml
pip install "dgreenwald-py-tools[nlp]" # nltk
pip install "dgreenwald-py-tools[mpi]" # mpi4py
pip install "dgreenwald-py-tools[dev]" # pytest, ruff
If you use dataset loaders, set:
export PY_TOOLS_DATA_DIR=/path/to/data
Or create a .env file in the repository root (or a parent directory):
PY_TOOLS_DATA_DIR=/path/to/data
py_tools.datasets will load .env automatically when python-dotenv is installed
(included in the datasets extra).
Quick Start
from py_tools import data, time_series, state_space
# Example: call a utility function from a core module
# (see module docstrings/source for full APIs)
You can also import dataset loaders through:
from py_tools import datasets
available = datasets.list_datasets()
df = datasets.load_dataset("fred", codes=["UNRATE"])
Module Overview
| Import path | Contents |
|---|---|
py_tools.time_series |
Kalman filter, state-space models, VAR/BVAR, HMMs |
py_tools.econometrics |
NLS/GMM, bootstrap, local projections, high-dimensional FE |
py_tools.bayesian |
MCMC sampling, prior distributions |
py_tools.numerical |
Root-finding, Chebyshev approximation |
py_tools.datasets |
Loaders for ~38 economic data sources |
py_tools.data |
Data manipulation, aggregation, matching |
py_tools.econ |
Discrete choice, yield curves, AIM solver |
py_tools.plot |
Plotting utilities |
py_tools.config |
Named model specification registry |
py_tools.scraping |
HTML scraping and text utilities |
py_tools.compute |
MPI array distribution |
Development
pip install -e ".[dev]"
python -m pytest # run tests
ruff check . # lint
Contributing
- Keep changes focused and commit one logical change at a time.
- Follow repository coding and workflow guidelines in
AGENTS.md. - Prefer adding deterministic tests in
tests/for new behavior.
License
MIT — see LICENSE.
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 dgreenwald_py_tools-0.1.0.tar.gz.
File metadata
- Download URL: dgreenwald_py_tools-0.1.0.tar.gz
- Upload date:
- Size: 263.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00b643dc3bc90e7c92840428ebd7676c63bfa8e56eac8b4086551a84ce887471
|
|
| MD5 |
a3628d305235958efbe4c63e16a3e564
|
|
| BLAKE2b-256 |
476c9569b6614610a05148704c8c099b4058ad5ae6158c8e77a9181f8da82fd9
|
File details
Details for the file dgreenwald_py_tools-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dgreenwald_py_tools-0.1.0-py3-none-any.whl
- Upload date:
- Size: 272.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9b668194a7298ed72b9eee97503c5ac8fb017e1b73a527568b1234f059b9d4d
|
|
| MD5 |
801228a7e940dc951d0f1620ebed22ba
|
|
| BLAKE2b-256 |
ec21d95409576f125b5ee8b925e4b560d0fb75b5751037b781473edd4b9ebdc0
|