Skip to main content

House Price Indices with Python

Project description

hpiPy

PyPI - Version License GitHub Actions Codecov Code Style black

hpiPy simplifies and standardizes the creation of house price indices in Python.

The package provides tools to evaluate index quality through predictive accuracy, volatility, and revision metrics—enabling meaningful comparisons across different methods and estimators. It focuses on the most widely used approaches: repeat sales and hedonic pricing models, with support for base, robust, and weighted estimators where applicable. The package also includes a random forest–based method with partial dependence plots for post-model interpretability, as well as a neural network approach that separates property-specific and market-level effects to jointly estimate quality and index components from property-level data. Based on hpiR.

Quick Start

To install hpipy from PyPI using pip:

pip install hpipy

Example

A basic example of creating a house price index:

import pandas as pd
from hpipy.price_index import RepeatTransactionIndex

# Load prepared data.
df = pd.read_csv("data/ex_sales.csv", parse_dates=["sale_date"])

# Create an index.
hpi = RepeatTransactionIndex.create_index(
    trans_data=df,
    date="sale_date",
    price="sale_price",
    prop_id="pinx",
    trans_id="sale_id",
    estimator="robust",
    log_dep=True,
    smooth=True,
    periodicity="M",
)

Documentation

An installation guide, API documentation, and examples can be found in the documentation.

Running the Tests

  1. Create a virtual environment (we recommend uv):
uv venv
  1. Install base and development dependencies:
uv pip install --requirements pyproject.toml --extra dev
  1. Run the test suite:
pytest

Acknowledgements

Based on the hpiR package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hpipy-0.1.0.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hpipy-0.1.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file hpipy-0.1.0.tar.gz.

File metadata

  • Download URL: hpipy-0.1.0.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for hpipy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8029c9eb51240b859187eb3f190e00979a6327bc459f188b2559221359d34a2
MD5 e864da4b6486c8bb5a28380c0fa8bf3b
BLAKE2b-256 2955a45f45a4bfc2f6592989e02c0791c2e593dbfec82fa2470d8073da3f17eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for hpipy-0.1.0.tar.gz:

Publisher: publish.yml on reidjohnson/hpipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hpipy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hpipy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for hpipy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d679870225508414dfc4425182f4748d5b395b83a4ccc2966f3dfe52a14c293
MD5 5fb4e639fa66283f148f668e49510977
BLAKE2b-256 d99b9a2592b983734cf203868e5fe13439fdb66192af8bd644acf534c1374e4c

See more details on using hashes here.

Provenance

The following attestation bundles were made for hpipy-0.1.0-py3-none-any.whl:

Publisher: publish.yml on reidjohnson/hpipy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page