geocode_sparcs is a program for geocoding health data from New York State’s Statewide Planning and Research Cooperative System (SPARCS) with a local installation of Pelias. It might also be useful as a Pelias wrapper for other regions and datasets, but for now at least, the focus is on SPARCS. The various kinds of fallback logic and string munging the program implements are specifically to improve performance on SPARCS.
Install geocode_sparcs via pip with the command pip install geocode_sparcs. Python dependencies are automatically installed, but you’ll need to set up Pelias with the instructions for Pelias on Docker. You can use the provided Pelias project directory; just be sure to set DATA_DIR in .env to where you want to store all the data. Setting up Pelias with this configuration can take a few hours of downloading and processing.
Once Pelias is up, you can geocode with the command python3 -m geocode_sparcs, passing in addresses to geocode through standard input. Each address should be a JSON object on its own line (per JSON Lines) with the keys line1, city, and zip. The values should all be strings (even zip) and are presumed to come from the columns PAT_ADDR_LINE1, PAT_ADDR_CITY, and PAT_ADDR_ZIP5 in a SPARCS_LOCATION file; it is also assumed that you already checked that PAT_ADDR_ST is equal to NY for each case. Here’s an example (with addresses that aren’t actually from SPARCS, since that’s protected health information):
$ echo '{"line1": "405 East 42nd St", "city": "New York", "zip": "10017"}' >>input.txt
$ echo '{"line1": "351 Northern Blvd", "city": "Albany", "zip": "12204"}' >>input.txt
$ python3 -m geocode_sparcs <input.txt
The output is also in JSON Lines. By default, the first features result from Pelias for each input is returned without further processing. See python3 -m geocode_sparcs --help for command-line options.
Metadata
Release files for geocode-sparcs 0.2.2
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 |
|---|---|---|---|---|
| geocode_sparcs-0.2.2.tar.gz | 5.6 kB | Without provenance | Details for geocode_sparcs-0.2.2.tar.gz |
Release files / geocode_sparcs-0.2.2.tar.gz
| Download URL | geocode_sparcs-0.2.2.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6347e44584860e7a9ebda2b38b19cc7dd0a55ff542d33bb439a8629e1e261df8
|
|
BLAKE2b-256 checksum How to use checksums |
f9f474287f23e019f6f80d5b5203ad54760f93e5a9bd8a14dd9f6b934e8abe45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Security for geocode-sparcs 0.2.2
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.