Skip to main content

Address parser for City of Philadelphia addresses

Project description

passyunk

Address parser and standardizer for the City of Philadelphia

Installation

pip install git+https://github.com/CityOfPhiladelphia/passyunk

If you have been granted access to the private data files, you can install the passyunk_automation package at the same time by running

pip install "passyunk[private] @ git+https://github.com/CityOfPhiladelphia/passyunk"

To find where passyunk is installed, from the command line run

python
import passyunk
passyunk.__file__

Usage

Quickstart

from passyunk.parser import PassyunkParser
p = PassyunkParser()
parsed = p.parse('1234 MARKET ST')
standardized_address = parsed['components']['output_address']

Parser.parse(address)

Takes an address, standardizes it, and returns a dictionary of address components.

{
  "components": {
    "address": {
      "addr_suffix": null,
      "addrnum_type": "N",
      "fractional": null,
      "full": "1234",
      "high": null,
      "high_num": null,
      "high_num_full": null,
      "isaddr": true,
      "low": "1234",
      "low_num": 1234,
      "parity": "E"
    },
    "address_unit": {
      "unit_num": null,
      "unit_type": null
    },
    "base_address": "1234 MARKET ST",
    "cl_addr_match": "A",
    "cl_responsibility": "STATE",
    "cl_seg_id": "440394",
    "election": {
      "blockid": "24021362",
      "precinct": "0528"
    },
    "floor": {
      "floor_num": null,
      "floor_type": null
    },
    "mailing": {
      "bldgfirm": "MARKET STREET BLDG",
      "matchdesc": "Multiple Zip4 Matches",
      "uspstype": "H",
      "zip4": "3721",
      "zipcode": "19107"
    },
    "output_address": "1234 MARKET ST",
    "street": {
      "full": "MARKET ST",
      "is_centerline_match": true,
      "name": "MARKET",
      "parse_method": "CL1",
      "postdir": null,
      "predir": null,
      "score": null,
      "street_code": "53560",
      "suffix": "ST"
    },
    "street_2": {
      "full": null,
      "is_centerline_match": false,
      "name": null,
      "parse_method": null,
      "postdir": null,
      "predir": null,
      "score": null,
      "street_code": null,
      "suffix": null
    }
  },
  "input_address": "1234 market street",
  "type": "address"
}

Data Updates

The data in the folder folder passyunk/pdata is public; the files centerline.csv and centerline_streets.csv are refreshed on a continual basis, and each data update will create a new version tag for this repository in the format '1.x.0'.

The private data is housed in the separate passyunk_automation package, where files are updated on a monthly basis. Each private data update will result in a new private version tag for this repository in the format '1.y.0+private'.

Thus the version 1.4.0 refers solely to the 4th public data update while the version 1.4.0+private refers solely to the 4th private data update. No public data will be updated in a new private data version nor vice-versa, so 1.4.0 and 1.4.0+private have no connection to each other, breaking a rule of SemVer syntax. However, 1.4.0 does contain updated public data compared to 1.3.0, and 1.4.0+private does contain updated private data compared to 1.3.0+private.

When passyunk is first imported into a python script, it will warn the user if the module's public data version is less than the latest public data version tag on GitHub. Similarly, if it detects that passyunk_automation has been installed, it will perform the same check for the private data version. The module will still work fine even if the data is out-of-date.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

passyunk-2.32.0.tar.gz (659.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

passyunk-2.32.0-py3-none-any.whl (665.7 kB view details)

Uploaded Python 3

File details

Details for the file passyunk-2.32.0.tar.gz.

File metadata

  • Download URL: passyunk-2.32.0.tar.gz
  • Upload date:
  • Size: 659.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for passyunk-2.32.0.tar.gz
Algorithm Hash digest
SHA256 e72276e1f17316748488307a2006ee58516371f8480512c17a105a51870770b2
MD5 48b9640b6c52090e02f68bbc06296753
BLAKE2b-256 bc86156f36f0c10adfa153bcc723582bc887d10810324199db4971f5a6ef9785

See more details on using hashes here.

File details

Details for the file passyunk-2.32.0-py3-none-any.whl.

File metadata

  • Download URL: passyunk-2.32.0-py3-none-any.whl
  • Upload date:
  • Size: 665.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for passyunk-2.32.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ede078296fd9f2f7a2cc398a1f1a7e7edb3d76c2d0b8b1f440bc649c000d812
MD5 ddea6ee280865b497aa4f38af795995c
BLAKE2b-256 ddc930a751665ee5a9401f4ac73defea20bd3e17a3f21b2328ea0d3c93a49080

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page