Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

population-exposure

CI PyPI Python License

population-exposure adds population estimates to hazard tables, polygons, and raster cells.

Install

pip install population-exposure

Python 3.11 or newer is required.

What the result estimates

assign_population() returns the estimated population represented by the selected source and reference year. Spatial hazards use coverage-weighted allocation; table hazards use exact key joins. It does not identify observed people, exact households, or who was present during an event. Boundary cells contribute according to their covered area; finer output grids redistribute source counts but do not add demographic detail. Source meaning, resolution, modeling choices, and hazard scale limit local inference.

For raster hazards, the conservation check is a numerical alignment check, not validation of the source and not an uncertainty interval. Report the source or release, population year and meaning, hazard date and threshold, allocation method, reprojection choice, incomplete support, and conservation difference when applicable.

Quick start

import pandas as pd

import population_exposure as pe

population_source = "illustrative counts"
population_year = "not applicable"
hazard = pd.DataFrame({"cell": ["A", "B"], "risk": ["high", "low"]})
population = pd.DataFrame({"cell": ["A", "B"], "population": [100, 200]})

exposed = pe.assign_population(hazard, population, cell_columns="cell")
print(f"{population_source} ({population_year}):")
print(exposed)

This toy table has no external population source or reference year. Replace it with a documented source and year for a real analysis.

Documentation

Read the full documentation for vector and raster workflows, population sources, and the API reference.

Project

Source code · Issue tracker · Contributing · Code of conduct · Changelog · MIT License

Download files

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

Source Distribution

population_exposure-0.1.0rc1.tar.gz (2.8 MB view details)

Uploaded Source

Built Distribution

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

population_exposure-0.1.0rc1-py3-none-any.whl (57.6 kB view details)

Uploaded Python 3

File details

Details for the file population_exposure-0.1.0rc1.tar.gz.

File metadata

  • Download URL: population_exposure-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for population_exposure-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 05843df310e3f43051abb9245f6c6b33cead30a7a90760bda4f627b57fea7946
MD5 ad540cafb8bd7b40d5f1db5c168f2804
BLAKE2b-256 9435e14917920578067f02681966bd21630bd0403c08fc673f7b28de0a6c72ac

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on palewire/population-exposure

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

File details

Details for the file population_exposure-0.1.0rc1-py3-none-any.whl.

File metadata

File hashes

Hashes for population_exposure-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 02a4e942e6a85b5dd734ddaf08867d3a0b1841b05df5d8ffec26fafc7ee6dd4f
MD5 b8acd29b102d7753c193a32b7442f1ab
BLAKE2b-256 17781800214739acbb4694616d420f4289256792f1b9658d0090a6439b6ae1d2

See more details on using hashes here.

Provenance

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

Publisher: publish.yml on palewire/population-exposure

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

Release history Release notifications | RSS feed

This release

0.1.0rc1 This release

2 files

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