census-cb
census-cb is a wrapper for downloading and processing Cartography Boundaries from the US Census Bureau. It stands for Census Cartographic Boundaries; apparently that's confusing (but, like most things, it made sense at the time).
The goal of census-cb is to provide an easy way to get GIS information created by the United States Census Bureau. There's a wide variety of cartographic files availbable for download, such as state and county lines, voting district, Tribal subdivisions, and more!
Entity Information
There are a designated set of entities available for download from the census bureau. Each year of available data has a specific set of available entities, and the shape of these entities may change from year to year. You can find a full list pdf of available entities for download on the US Census Bureau site.
Installation
Install using pip
pip install census-cb
Usage
# Create a Boundary File for the desired entity
bf = BoundaryFile(2020, 'us', 'state', '500k')
# Create a processor for downloading and unpacking the data; this processor will return a GeoDataFrame
cbfp = CBFProcessor('gdf')
# Downloads and extracts the Boundary File.
cbfp.process_data(bf)
Examples
Download and display the state boudnaries from the US Census Bureau.
# Create a Boundary File for the US State Lines
state_boundary_file = BoundaryFile(2020, 'us', 'state', '500k')
# Create a processor that returns a GeoDataFrame
cbfp = CBFProcessor('gdf')
# Get the Data
state_lines = cbfp.process_data(state_boundary_file)
# See the Data
state_lines.plot()
state_lines.head()
| geometry | STATEFP | STATENS | AFFGEOID | GEOID | STUSPS | NAME | LSAD | ALAND | AWATER | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | MULTIPOLYGON (((144.64538 13.23627, 144.64716 ... | 66 | 01802705 | 0400000US66 | 66 | GU | Guam | 00 | 543555847 | 934337453 |
| 1 | MULTIPOLYGON (((-94.71830 29.72885, -94.71721 ... | 48 | 01779801 | 0400000US48 | 48 | TX | Texas | 00 | 676680588914 | 18979352230 |
| 2 | MULTIPOLYGON (((-86.95617 45.35549, -86.95463 ... | 55 | 01779806 | 0400000US55 | 55 | WI | Wisconsin | 00 | 140292246684 | 29343721650 |
| 3 | MULTIPOLYGON (((-71.28802 41.64558, -71.28647 ... | 44 | 01219835 | 0400000US44 | 44 | RI | Rhode Island | 00 | 2677759219 | 1323691129 |
| 4 | MULTIPOLYGON (((-72.03683 41.24984, -72.03496 ... | 36 | 01779796 | 0400000US36 | 36 | NY | New York | 00 | 122049520861 | 19256750161 |
To Do
- provide some better functionality for editing Entity Information after a BoundaryFile object is declared.
Metadata
Release files for census-cb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| census-cb-0.1.0.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| census_cb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.2 kB
Release files / census-cb-0.1.0.tar.gz
| Download URL | census-cb-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
59533d84a232ef29df24a623478b7d5f3e98a51908ac7280df779c87f0a185bf
|
|
BLAKE2b-256 checksum How to use checksums |
2b9da892192d166a03ad9a9e929cdc889083f57e506d76957a0c8a02ae240383
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10
|
Release files / census_cb-0.1.0-py3-none-any.whl
| Download URL | census_cb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
930c1c3a748d94a466345305645687df825ca2f54666ab9eff83720fb9e2bd11
|
|
BLAKE2b-256 checksum How to use checksums |
cae38434e13db4a629321a45e227a0ecc821718e6e8a2208f54eedff9ab355d3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.10
|