You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-1Lines changed: 26 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
_The current version of RegCensusAPI is only compatible with Python 3.6 and newer._
2
+
1
3
# RegCensus API
2
4
3
5
## Introduction
@@ -13,7 +15,7 @@ The RegCensus Python library is pip installable:
13
15
$ pip install regcensus
14
16
```
15
17
16
-
Once installed, import the library, using the following (using the `rc` alias to more easily use the library):
18
+
Once installed, import the library, using the following (use the `rc` alias to more easily use the library):
17
19
18
20
```
19
21
import regcensus as rc
@@ -100,6 +102,8 @@ The __get_values__ function is the primary function for obtaining RegData from t
100
102
* filtered (optional) - specify if poorly-performing industry results should be excluded. Default is True.
101
103
* summary (optional) - specify if summary results should be returned, instead of document-level results. Default is True.
102
104
* country (optional) - specify if all values for a country's jurisdiction ID should be returned. Default is False.
105
+
* industryType (optional): level of NAICS industries to include. Default is '3-Digit'.
106
+
* download (optional): if not False, a path location for a downloaded csv of the results.
103
107
* verbose (optional) - value specifying how much debugging information should be printed for each function call. Higher number specifies more information, default is 0.
104
108
105
109
In the example below, we are interested in the total number of restrictions and total number of words for the US (get_jurisdictions(38)) for the period 2010 to 2019.
@@ -108,6 +112,14 @@ In the example below, we are interested in the total number of restrictions and
108
112
rc.get_values(series = [1,2], jurisdiction = 38, date = [2010, 2019])
109
113
```
110
114
115
+
### Get all Values for a Country
116
+
117
+
The `country` argument can be used to get all values for one or multiple series for a specific national jurisdiction. The following line will get you a summary of the national and state-level restriction counts for the United States from 2016 to 2019:
There are two different ways to download data retrieved from RegCensusAPI:
186
+
187
+
1. Use the pandas `df.to_csv(outpath)` function, which allows the user to download a csv of the data, with the given outpath. See the pandas [documentation][3] for more features.
188
+
189
+
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.
0 commit comments