A python command line utility that generates CSVs of county-level population data for specified US states.
Project description
get-pop
.. image:: https://badge.fury.io/py/get-pop.svg :target: https://badge.fury.io/py/get-pop
.. image:: https://travis-ci.org/SimmonsRitchie/get-pop.svg?branch=master :target: https://travis-ci.org/SimmonsRitchie/get-pop
.. image:: https://readthedocs.org/projects/get-pop/badge/?version=latest :target: https://get-pop.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
A command line utility that generates CSVs of county-level population data for specified US states.
Data is based on 2019 U.S. census data.
The full documentation is hosted at Read the Docs <https://get-pop.readthedocs.io/en/latest/index.html>
_
Install
::
pip install get-pop
Basic usage
Command line
In the command line, enter the getpop command followed by the two letter postal code of one or more states.
Eg.:
::
getpop ny
Initializing getpop Selected states: ['ny'] Processing: New York getpop complete
Or:
::
getpop ny nj tx
Initializing getpop Selected states: ['ny', 'nj', 'tx'] Processing: New Jersey Processing: New York Processing: Texas getpop complete
To get CSVs for all states, enter:
::
getpop all
CSVs will be saved in a new directory called 'data' in the current working directory. See 'advanced usage' to override the location where CSVs are saved.
Programmatic
If you prefer, you can also import and call get-pop from within your python app:
::
from get_pop.get_pop import get_pop
states = ["ny","nj","tx","pa"]
get_pop(states)
Advanced usage
Command line
Getpop takes one or more two-letter state abbreviations as positional arguments in order to determine which state CSVs will be generated. Getpop's CLI also takes a handful of optional arguments that modify its actions.
--save-dir, --dir
TEXT. Path of directory where CSV files will be saved. Defaults to saving them in /data in the current working directory. If the directory you specify doesn't exist, getpop will create it.
--clear-dir, --cdir
Deletes all existing files in save_dir path. Defaults to false.
--help
Show this message and exit.
Here's an example that stores the CSVs in a directory in your current working directory called 'your_custom_directory' and clears any existing files in it if they exist.
::
getpop ny ca tx --save-dir ./your_custom_directory --clear-dir
License
MIT <https://choosealicense.com/licenses/mit/>
_
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file get_pop-1.94.6.tar.gz
.
File metadata
- Download URL: get_pop-1.94.6.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b3a45bd9ce83dbc1d9553ca0ba247eb486d9aa3257e8cd2a52a5a5e5371a4d4 |
|
MD5 | 34158c198a08eff8270186f4bd10e2c8 |
|
BLAKE2b-256 | e39026feb267e3a441150f25e648cb3201a465a8dc14db99cfd97ceb00e11aa2 |
File details
Details for the file get_pop-1.94.6-py3-none-any.whl
.
File metadata
- Download URL: get_pop-1.94.6-py3-none-any.whl
- Upload date:
- Size: 1.6 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef0b2d75defa1c56bceb2d030c511fd990b9a55923779b85e301db9a7aac1337 |
|
MD5 | 95d941780d82555adae31b26b905ad38 |
|
BLAKE2b-256 | 304ab68d55a6b2318ec36d9d41432e82bcbd806d2a24a9d91a476e61e41ee39f |