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 altair as alt
import pandas as pd
from hpipy.price_index import RepeatTransactionIndex
from hpipy.utils.plotting import plot_index

# 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,
    prop_id="pinx",
    trans_id="sale_id",
    price="sale_price",
    date="sale_date",
    periodicity="M",
    estimator="robust",
    log_dep=True,
    smooth=True,
)

# Visualize the index.
with alt.renderers.enable("browser"):
    plot_index(hpi, smooth=True).properties(title="Example Index").show()

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.1.tar.gz (1.7 MB 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.1-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: hpipy-0.1.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for hpipy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 70c49b6e624e06e826d0d64375684f0bc511c3d085ec4870d36f8fd6e00c656f
MD5 546f748c24e21711f12cf4a5f58bb780
BLAKE2b-256 ecdf887ffc63d0b73eb8fe3fecd2a62c49d46cf0b494be289e945545105f0f6b

See more details on using hashes here.

Provenance

The following attestation bundles were made for hpipy-0.1.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for hpipy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 379eb979f26f7e9108022df868a5af4b3c5d2eb92895521220bf177d3d4b3896
MD5 fda4a930ab65165f94f5f8d4dcdee7eb
BLAKE2b-256 dc27c5b78d0b2972dc64fbca9aa62a4579282e1c86a5cc68234d069d6d4bd320

See more details on using hashes here.

Provenance

The following attestation bundles were made for hpipy-0.1.1-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