Skip to content

Commit f79ef9f

Browse files
committed
Update Docs and DataReader Wrapper
1 parent 8ee6e89 commit f79ef9f

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

docs/source/remote_data.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,18 @@ Available expiry dates can be accessed from the ``expiry_dates`` property.
202202
Enigma
203203
======
204204

205-
Access datasets from `Enigma <https://app.enigma.io>`__,
205+
Access datasets from `Enigma <https://public.enigma.com>`__,
206206
the world's largest repository of structured public data.
207207

208+
Datasets are unique identified by the ``uuid4`` at the end of a dataset's web address.
209+
For example, the following code downloads USDA Food Recall Data from https://public.enigma.com/datasets/292129b0-1275-44c8-a6a3-2a0881f24fe1.
210+
208211
.. ipython:: python
209212
210213
import os
211214
import pandas_datareader as pdr
212215
213-
df = pdr.get_data_enigma('enigma.trade.ams.toxic.2015', os.getenv('ENIGMA_API_KEY'))
216+
df = pdr.get_data_enigma('292129b0-1275-44c8-a6a3-2a0881f24fe1', os.getenv('ENIGMA_API_KEY'))
214217
df.columns
215218
216219
.. _remote_data.quandl:

pandas_datareader/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def DataReader(name, data_source=None, start=None, end=None,
137137
session=session).read()
138138

139139
elif data_source == "enigma":
140-
return EnigmaReader(datapath=name, api_key=access_key).read()
140+
return EnigmaReader(dataset_id=name, api_key=access_key).read()
141141

142142
elif data_source == "fred":
143143
return FredReader(symbols=name, start=start, end=end,

pandas_datareader/enigma.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,8 @@ def __init__(self,
5656

5757
self._dataset_id = dataset_id
5858
if not isinstance(self._dataset_id, compat.string_types):
59-
# TODO: test if string is valid UUID
6059
raise ValueError(
61-
"The Enigma dataset_id must be a UUID4 string (ex: "
60+
"The Enigma dataset_id must be a string (ex: "
6261
"'bedaf052-5fcd-4758-8d27-048ce8746c6a')")
6362

6463
headers = {
@@ -106,7 +105,7 @@ def get_current_snapshot_id(self, dataset_id):
106105

107106
def get_dataset_metadata(self, dataset_id):
108107
"""Get the Dataset Model of this EnigmaReader's dataset
109-
<Add Link to Model Docs>
108+
https://docs.public.enigma.com/resources/dataset/index.html
110109
"""
111110
url = "datasets/{0}?row_limit=0".format(dataset_id)
112111
response = self._get(url)

pandas_datareader/tests/test_enigma.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
class TestEnigma(object):
1313

1414
@property
15-
def dataset_id():
15+
def dataset_id(self):
1616
"""
17-
USDA Food Recall Archive
17+
USDA Food Recall Archive - 1996
1818
Selected for being a relatively small dataset.
1919
https://public.enigma.com/datasets/292129b0-1275-44c8-a6a3-2a0881f24fe1
2020
"""

0 commit comments

Comments
 (0)