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
+38-8Lines changed: 38 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,33 @@ A Python client library for the [Dynata Demand API](https://developers.dynata.co
6
6
7
7
## Setup
8
8
9
-
The client requires environment variables to be set for the Dynata Demand API credentials. These can be found in `.env-example`.
9
+
You can install the Demand API client with:
10
+
11
+
pip install dynatademand
12
+
13
+
You can provide your Demand API credentials in a couple of ways. They can be set in the environment (a sample config is provided in `.env-example`) or you can provide them while creating the client object.
10
14
11
15
## Example Usage
12
16
13
-
demandapi = DemandAPIClient()
17
+
```python
18
+
# You can optionally provide your credentials here instead of environment variables.
# Any function requiring one or more IDs should be provided as positional arguments.
23
+
demandapi.get_project(7)
24
+
25
+
# Provide query parameters as keyword-arguments.
26
+
demandapi.get_projects(state="LAUNCHED")
27
+
28
+
# Functions that send data in a request body accept a python dictionary.
29
+
# Your data will be validated against the schemas provided in the Demand API documentation.
30
+
project_data = {
31
+
'title': 'My New Survey',
32
+
...
33
+
}
34
+
demandapi.create_project(project_data)
35
+
```
16
36
17
37
## Supported API Functions
18
38
@@ -64,12 +84,22 @@ Information on [contributing](CONTRIBUTING.md).
64
84
65
85
## Testing
66
86
67
-
To run the tests,
87
+
To run the tests, you will need to install the development requirements to your environment. It's recommended to create a virtual environment for your installation to avoid any package conflicts.
0 commit comments