Skip to main content
![POLITICO](https://rawgithub.com/The-Politico/src/master/images/logo/badge.png)

# census_pgeoloader

Command line utility to download Census TIGER/Line shapefiles by state from the U.S. Census Bureau and aggregate them into a single table in a PostGIS-enabled database.

# Requirements

Uses [shp2pgsql](http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg). Assumes PostgreSQL + PostGIS.

# To install

```bash
$ pip install census_pgeoloader
```

# To use

Pass a connection URI to your PostgreSQL database as well as the states you'd like to aggregate. This will dowload tract-level shapefiles by default.

```bash
$ pgeoloader postgres://postgres@localhost:5432/database KS MO TX VA ...
```

Valid values for states are FIPS codes, postal abbreviations or names. Pass `+` to collect all states.

# Options

```bash
Options:
-t, --table TEXT Name of table to create in DB. Default is
"census_shapes".
-p, --temp TEXT Directory to download files to. Default is
"./shapefiles"
-y, --year TEXT Year. Default is "2016".
-g, --geo [tract|group|block] Geographic unit. Default is "tract".
-s, --srid TEXT Specify an SRID transform, e.g., "4269:4326".
Default is "4269".
--help Show this message and exit.
```

#### Notes:

- `--table` Drops any existing table by that name in the database.
- `--geo` Can pull tracts, block groups or blocks.
- `--srid` Default SRID should be 4269, but you can specify a transform with this option as available in [shp2pgsql](http://www.bostongis.com/pgsql2shp_shp2pgsql_quickguide.bqg).

©2017 POLITICO


Metadata

Release files for census-pgeoloader 0.2.0

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

Source distribution (sdist)

Source distribution for census-pgeoloader 0.2.0
File Size Uploaded Provenance
census_pgeoloader-0.2.0.tar.gz 3.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for census-pgeoloader 0.2.0
File Interpreter ABI Platform
census_pgeoloader-0.2.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 9.6 kB

Release files / census_pgeoloader-0.2.0.tar.gz

Download URL census_pgeoloader-0.2.0.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
89ddbb81ad7703804be7b0d1c99f10165fd71e3084b74024ed9d2d453b918886
BLAKE2b-256 checksum
How to use checksums
b1d769f6a4b583fdcec6a789b3439298b03e61cc80a04e2bacb05a199a76bd2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / census_pgeoloader-0.2.0-py2.py3-none-any.whl

Download URL census_pgeoloader-0.2.0-py2.py3-none-any.whl
Size 6.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
325c748212ec62a6e01d46475b714a75f7b11817de884bec574cef2a697703e7
BLAKE2b-256 checksum
How to use checksums
ca0ca12501cdfff0fca1c950bc289e95aa79f2e7f8af5d640976513e7158f08f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for census-pgeoloader 0.2.0

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.

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