census-map-downloader
Easily download U.S. census maps
Installation
pipenv install census-map-downloader
Command line usage
Usage: censusmapdownloader [OPTIONS] COMMAND [ARGS]...
Easily download U.S. census maps
Options:
--data-dir TEXT The folder where you want to download the data
--year INTEGER The vintage of data to download. By default it gets the
latest year. Not all data are available for every year.
--help Show this message and exit.
Commands:
blocks Download blocks
congress-carto Download cartographic congressional districts
counties Download counties
counties-carto Download cartographic counties
countysubdivision Download cartographic county subdivisions
legislative-lower-carto Download cartographic state legislative...
legislative-upper-carto Download cartographic state legislative...
places Download places
states-carto Download cartographic states
tracts Download tracts
zctas Download ZCTAs
Examples
Here's an example of downloading all counties
censusmapdownloader counties
You can specify the download directory with --data-dir
censusmapdownloader --data-dir ./my-special-folder/ counties
Contributing
Install dependencies for development
pipenv install --dev
Run tests
pipenv run python test.py
Adding additional years to a dataset
Downloader classes for different geography types are defined in modules of {code}census_map_downloader.geotypes. For example, the downloader for counties is {code}census_map_downloader.geotypes.counties.CountiesDownloader.
If the URL and fields in a shapefile are the same as those for years that are already supported, you can just add the year to the {code}YEAR_LIST attribute.
If the fields are the same, but the URL changes between groups of years, add logic to the {code}url property method of the downloader classes to alter the URL based on {code}self.year.
If the fields and URL change from year to year, consider creating classes for each year and delegating to {code}census_map_downloader.geotypes.tracts.TractsDownloader is an example of a class that uses this approach.
Developing the CLI
The command-line interface is implemented using Click and setuptools. To install it locally for development inside your virtual environment, run the following installation command, as prescribed by the Click documentation.
pipenv run pip install --editable .
Links
Metadata
Release files for census-map-downloader 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| census-map-downloader-0.1.3.tar.gz | 62.2 kB | Without provenance | Details for census-map-downloader-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| census_map_downloader-0.1.3-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for census_map_downloader-0.1.3-py2.py3-none-any.whl |
Total release size: 79.3 kB
Release files / census-map-downloader-0.1.3.tar.gz
| Download URL | census-map-downloader-0.1.3.tar.gz |
|---|---|
| Size | 62.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a9ced681eabad946e85c6891822fbaa2e1c75f5747cd11faa3cb6ce5caea8d7
|
|
BLAKE2b-256 checksum How to use checksums |
e1aaea005ebf9bde4e9c03079408360a105653f275e6285a8e00be9e5dbb1113
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / census_map_downloader-0.1.3-py2.py3-none-any.whl
| Download URL | census_map_downloader-0.1.3-py2.py3-none-any.whl |
|---|---|
| Size | 17.1 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7261f1c77c3f132d1337d52a3a80178dac45b5814904d91a7ce7bd939b1c6a87
|
|
BLAKE2b-256 checksum How to use checksums |
698c1db6e73e61b785954fd3b6bcfb1f546ee27d23695805eeaa62a7a4e7926e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Security for census-map-downloader 0.1.3
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.