Skip to main content

era_py

Helpers for the Python port of Empirical Research in Accounting: Tools and Methods.

The era_pl Polars API is used by era_pl_book and its companion materials. Install it with pip install "era-py[polars]" and import era_pl.

Website | Changelog

Install

pip install era-py
pip install "era-py[ibis]"
pip install "era-py[polars]"
pip install "era-py[tables]"

For repository development, prefer the checked-in virtual environment:

.venv/bin/python -m pytest

era-py provides two import paths:

  • import era_py is the base API built around pandas workflows. Install the ibis extra for the Ibis/Postgres event-study and WRDS helpers.
  • import era_pl is the Polars API and requires pip install "era-py[polars]".

Usage

from era_py import data_info, load_data, ols_dropcollinear

camp = load_data("camp_attendance")
camp_info = data_info("camp_attendance")

Use data_info(name) to inspect a dataset's description, provenance, shape, schema, and variable definitions without loading its observations. Use data_catalog() to return the same information for every packaged dataset.

Testing Optional Dependencies

For quick checks of optional extras without changing your local environment, use uv run --with ...:

PYTHONPATH=src uv run --with polars python -c "import era_pl; print(era_pl.__version__)"

This is useful for verifying the era_pl import path and other Polars-specific behavior without permanently installing polars into your project environment.

Website

The changelog is maintained in CHANGELOG.md and included in the website, so release notes need to be edited in only one place. The site uses Quarto and quartodoc, following the db2pq documentation setup. Build and publish with:

./scripts/build-docs.sh
./scripts/publish-docs.sh

See the documentation build instructions for setup details. The build reads source docstrings and packaged dataset metadata; it does not run external-data examples or require access to research databases.

Metadata

Release files for era-py 0.0.36

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for era-py 0.0.36
File Size Uploaded Provenance Actions
era_py-0.0.36.tar.gz 3.0 MB Without provenance Details for era_py-0.0.36.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for era-py 0.0.36
File Interpreter ABI Platform Actions
era_py-0.0.36-py3-none-any.whl Python 3 none any Details for era_py-0.0.36-py3-none-any.whl

Total release size: 6.0 MB

Release files / era_py-0.0.36.tar.gz

Download URL era_py-0.0.36.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
469f9022c1962fead60fe93597cd96f32d41df4b7163b568b07d977923266dd3
BLAKE2b-256 checksum
How to use checksums
393def621051131ac863c57cd2d80267b97a041a29113776c433cbdf90b59b1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Release files / era_py-0.0.36-py3-none-any.whl

Download URL era_py-0.0.36-py3-none-any.whl
Size 3.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
7bae470147198728ccb26c056b89a9c44a7dddd4cf02b547d0f6629a040bcb09
BLAKE2b-256 checksum
How to use checksums
a7d8880f76610847f85b057e225736c176b8d5821dd19fc0d44956c4e3ed037d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.11

Security for era-py 0.0.36

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.36 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page