Skip to main content

Client for the FastOpenData API service

Project description

FastOpenData Client

The Python client for FastOpenData.

To use this client to retrieve data, you must have an API key. You can use the client itself to get a free API key that's suitable for evaluation purposes:

>>> from fastopendata_client import FastOpenData
>>> api_key = FastOpenData.get_api_key('YOUR_EMAIL_ADDRESS')

Save your API key somewhere; you will use it each time you invoke the FastOpenData client. If you lose your key, you can call this method again with the same email address.

The free API key is rate limited and not suitable for production purposes. To subscribe to the FastOpenData service and receive a key that will provide unlimited access, please visit https://fastopendata.com. If you have questions about the service or your particular use-case, email zac@fastopendata.com.

The main class for this client is FastOpenData which is invoked like so:

>>> from fastopendata_client import FastOpenData
>>> session = FastOpenData(api_key="<YOUR_API_KEY>")
>>> data = session.request(free_form_query="123 Main Street, Tallahassee, FL, 12345")

data now contains a dictionary with all the data from the FastOpenData server.

If you have a Pandas dataframe, you can append new columns containing data from FastOpenData by calling FastOpenData.append_to_dataframe and specifying which columns contain address information. For example, if COLUMN_NAME contains unstructured address strings, you can do this:

>>> import pandas as pd
>>> from fastopendata_client import FastOpenData
>>> session = FastOpenData(api_key="<YOUR_API_KEY>")
>>> df = pd.DataFrame(...)
>>> session.append_to_dataframe(df, free_form_query=COLUMN_NAME)

Now df contains many new columns containing data from the FastOpenData server.

If your dataframe has columns containing structured address information, you can do:

>>> session.append_to_dataframe(
        df,
        address1=ADDRESS1_COLUMN,
        address2=ADDRESS2_COLUMN,
        city=CITY_COLUMN,
        state=STATE_COLUMN,
        zip_code=ZIP_CODE_COLUMN
    )

Note that you have the option of specifying either free_form_query or the column names for structured address data, but not both. Doing so will raise an exception.

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

fastopendata_client-0.0.33.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

fastopendata_client-0.0.33-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file fastopendata_client-0.0.33.tar.gz.

File metadata

File hashes

Hashes for fastopendata_client-0.0.33.tar.gz
Algorithm Hash digest
SHA256 bd19a3b5387784fda6d76a79562ebb7757363cea0fb9cbf98cdfba9eebff48c6
MD5 019be1d3d40d8b0aa1d76fdde00f65e2
BLAKE2b-256 f27b58fb880c1a475f3478c8072b3b1c267544490bd26f591deb134ff82a34cd

See more details on using hashes here.

File details

Details for the file fastopendata_client-0.0.33-py3-none-any.whl.

File metadata

File hashes

Hashes for fastopendata_client-0.0.33-py3-none-any.whl
Algorithm Hash digest
SHA256 f7ec61b0e562e32ee8b9d25472919581f76cf39ddd528892365b8eb6132f5cb9
MD5 53dbe20f809e574ea3e7d2e8bef02225
BLAKE2b-256 7ab57db12a5089771261f585d77311ba0b262305ccbedff4e4e6122389d7a5cd

See more details on using hashes here.

Supported by

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