Skip to main content
downloads

The-GeoLiberator-Python-Module

This module is an address parser. It takes in an address as an argument and outputs a standardized version. Otherwise, 'OTHER' will be the result if the parser fails. "It is alike a liberal because it takes in any variant addresses indiscriminately. And it is a liberator because it liberates the addresses from their inconsistencies." (Note: This module does not do address validation but it will parse any address you throw at it to the best of its ability. Especially NYC addresses.)

Usage:

To start, import with your desired handle to call upon the module with ease. The function parse_address() returns the value while geoLiberate() prints the value.

import GeoLiberator as GL

GL.parse_address("123 Example St, NY 01234", "address") # 'address' to parse the address
# Returns: '123 EXAMPLE STREET'

GL.geoLiberate("123 Example St, NY 01234", "full") # 'full' to parse the full address
# Prints: 123 EXAMPLE STREET, NEW YORK 01234

GL.geoLiberate("123 Example St, NY 01234", "number") # 'number' to parse the address house number
# Prints: 123

GL.geoLiberate("123 Example St, NY 01234", "street") # 'street' to parse the street name
# Prints: EXAMPLE STREET

The first argument is any address of data type string.

The second argument, 'parse', as you may have noticed, determines what gets parsed. (Note: if no argument given, parses address by default)

  • "address" - Address (only)
  • "full" - Full Address (including state and zipcode)
  • "number" - House Number
  • "street" - Street Name
  • "state" - State
  • "zipcode" - Zipcode

The following function's first argument is a file containing a list of addresses. It automatically loops through the rows and parses each address.

GL.autoGeoLiberate("file.txt", "street", "output_file_name.txt") # 'street' to parse full street name
#If no output file name given, program will print all parsed addresses

Let's say 'file.txt' contains the following:

123 Bob Rd
321 N Johnson Aven
123-4 2nd St

Output would look like this:

BOB ROAD
NORTH JOHNSON AVENUE
2nd STREET

For that really lengthy list of addresses in a file, it's reccommended to use autoGeoLiberate() in your program and run it in a cli with the flag --status(-S for short) to monitor the module's progress. Like so:

python my_program.py --status

For developmental purposes:

address_object = GL.GeoLiberator("123 Example St") # Create a 'GeoLiberator Object' with address as an argument
#This new address object can then be parsed using the dot operator like so:
address_object.full_address() # includes state and zipcode
address_object.getAddress()
address_object.getAddressNum()
address_object.getStreet()

These member functions return a string value.

Member Function Parameters:

getAddress(log = '')

The 'log' parameter is for entering in a file name to append all address results to a log file. (Note: these functions will always return a value)

Copyright

Copyright (c) 2020 The Python Packaging Authority. Released under the MIT License.

Release files for GeoLiberator 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GeoLiberator 0.3.7
File Size Uploaded
GeoLiberator-0.3.7.tar.gz 9.1 kB Details

Release files / GeoLiberator-0.3.7.tar.gz

Download URL GeoLiberator-0.3.7.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
33d97efe421effa90e928116d42c5badee09173624887e0f33361cd10e396fdf
BLAKE2b-256 checksum
How to use checksums
7d003eb8866f0f534ae56a117b46476bdc976b0b1dd5398f619c6babf8b8692b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.3.7 This release

1 release file

0.3.6

1 release file

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

0.1.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page