Enigma

class pandas_datareader.enigma.EnigmaReader(dataset_id=None, api_key=None, retry_count=5, pause=0.75, session=None, base_url='https://public.enigma.com/api')

Collects current snapshot of Enigma data located at the specified data set ID and returns a pandas DataFrame.

Parameters
  • dataset_id (str) – Enigma dataset UUID.

  • api_key (str, optional) – Enigma API key. If not provided, the environmental variable ENIGMA_API_KEY is read.

  • retry_count (int, default 5) – Number of times to retry query request.

  • pause (float, default 0.1) – Time, in seconds, of the pause between retries.

  • session (Session, default None) – requests.sessions.Session instance to be used.

  • base_url (str, optional (defaults to https://public.enigma.com/api)) – Alternative Enigma endpoint to be used.

Examples

Download current snapshot for the following Florida Inspections Dataset: https://public.enigma.com/datasets/bedaf052-5fcd-4758-8d27-048ce8746c6a

>>> import pandas_datareader as pdr
>>> df = pdr.get_data_enigma('bedaf052-5fcd-4758-8d27-048ce8746c6a')

In the event that ENIGMA_API_KEY does not exist in your env, the key can be supplied as the second argument or as the keyword argument api_key

>>> df = EnigmaReader(dataset_id='bedaf052-5fcd-4758-8d27-048ce8746c6a',
...                   api_key='INSERT_API_KEY').read()
close()

Close network session

property default_start_date

Default start date for reader. Defaults to 5 years before current date

get_current_snapshot_id(dataset_id)

Get ID of the most current snapshot of a dataset

get_dataset_metadata(dataset_id)

Get the Dataset Model of this EnigmaReader’s dataset https://docs.public.enigma.com/resources/dataset/index.html

get_snapshot_export(snapshot_id)

Return raw CSV of a dataset

property params

Parameters to use in API calls

read()

Read data

property url

API URL