Pyap is an MIT Licensed text processing library, written in Python, for detecting and parsing addresses using regular expressions. It currently supports US, Canadian, and British address formats. The library is at version 0.3.1, with its last release in September 2020, indicating a slow release cadence or maintenance status for the original package, though forks exist.
pip install pyapVerified import paths — ran on the pinned version, not inferred.
The quickstart demonstrates how to import the `pyap` library and use its `parse` function to extract addresses from a given text string. It highlights specifying the `country` parameter for accurate parsing and iterating through the results to access both the full address string and its parsed components as a dictionary.
For new projects or enhanced capabilities, evaluate `pyap2` (or other forks) instead of the original `pyap` package. If staying with `pyap`, be aware of potential lack of updates.
Always post-validate parsed addresses, especially for critical applications. Consider integrating with a geocoding service to verify the existence and accuracy of detected addresses.
Ensure you always pass a `country` argument (e.g., `country='US'`, `country='CA'`, `country='GB'`) to `pyap.parse()`. Consult the documentation or source code for the exact list of supported country codes.
Always specify the `country` parameter, e.g., `pyap.parse(text, country='US')`.
Use one of the supported country codes: 'US' (United States), 'CA' (Canada), or 'GB' (Great Britain). For other countries, this library does not provide support.
Iterate through the list of addresses or access a specific element by index before calling `as_dict()`. For example: `addresses = pyap.parse(text, country='US')` followed by `for address in addresses: print(address.as_dict())` or `if addresses: print(addresses[0].as_dict())`.
No dependency data recorded yet.