Skip to content

Commit a96b6b8

Browse files
committed
fix - make get_document_values accept single year
1 parent 5c4f268 commit a96b6b8

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ Alternatively, we can use the __get_document_values__ function as in the follow
183183
rc.get_document_values(series = [1,2], jurisdiction = 38, year = 2019)
184184
```
185185

186-
Note that for document-level queries, a full date (not just the year) is often required. See the __get_series__ function for specifics by jurisdiction.
186+
See the __get_series__ function for specifics by jurisdiction.
187187

188188
### Version
189189

@@ -224,7 +224,7 @@ There are two different ways to download data retrieved from RegCensusAPI:
224224
2. As of version 0.2.0, the __get_values__ function includes a `download` argument, which allows the user to simply download a csv of the data in the same line as the API call. See below for an example of this call.
225225

226226
```
227-
rc.get_values(series = [1,28,33,36], jurisdiction = 38, date = [2010, 2019], download='regdata2010to2019.csv')
227+
rc.get_values(series = [1,28,33,36], jurisdiction = 38, year = [2010, 2019], download='regdata2010to2019.csv')
228228
```
229229

230230
[1]:https://api.quantgov.org/swagger-ui.html

regcensus/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ def get_document_values(*args, **kwargs):
251251
252252
Simply returns get_values() with summary=False
253253
"""
254+
if type(kwargs["year"]) == list:
255+
print_error({"message" : "Only single year can be passed."})
256+
return
254257
return get_values(*args, **kwargs, summary=False)
255258

256259

0 commit comments

Comments
 (0)