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: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,13 @@
1
1
# Changelog
2
2
3
+
## 0.20.0 (2024-05-06)
4
+
5
+
Full Changelog: [v0.19.0...v0.20.0](https://github.com/Dataherald/dataherald-python/compare/v0.19.0...v0.20.0)
6
+
7
+
### Features
8
+
9
+
***api:** update via SDK Studio ([#52](https://github.com/Dataherald/dataherald-python/issues/52)) ([84b46e9](https://github.com/Dataherald/dataherald-python/commit/84b46e9a1aa8046a1b8c909669c746f95ef6c567))
10
+
3
11
## 0.19.0 (2024-02-28)
4
12
5
13
Full Changelog: [v0.18.0...v0.19.0](https://github.com/Dataherald/dataherald-python/compare/v0.18.0...v0.19.0)
Most tests will require you to [setup a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
85
+
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
86
86
87
87
```bash
88
88
# you will need npm installed
89
-
npx prism path/to/your/openapi.yml
89
+
npx prism mock path/to/your/openapi.yml
90
90
```
91
91
92
92
```bash
@@ -117,9 +117,9 @@ the changes aren't made through the automated pipeline, you may want to make rel
117
117
118
118
### Publish with a GitHub workflow
119
119
120
-
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/Dataherald/dataherald-python/actions/workflows/publish-pypi.yml). This will require a setup organization or repository secret to be set up.
120
+
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/Dataherald/dataherald-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
121
121
122
122
### Publish manually
123
123
124
-
If you need to manually release a package, you can run the `bin/publish-pypi` script with an`PYPI_TOKEN` set on
124
+
If you need to manually release a package, you can run the `bin/publish-pypi` script with a`PYPI_TOKEN` set on
Copy file name to clipboardExpand all lines: README.md
+45-14Lines changed: 45 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,16 @@ The Dataherald Python library provides convenient access to the Dataherald REST
6
6
application. The library includes type definitions for all request params and response fields,
7
7
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
8
8
9
+
It is generated with [Stainless](https://www.stainlessapi.com/).
10
+
9
11
## Documentation
10
12
11
13
The REST API documentation can be found [on dataherald.readthedocs.io](https://dataherald.readthedocs.io/en/latest/). The full API of this library can be found in [api.md](api.md).
12
14
13
15
## Installation
14
16
15
17
```sh
18
+
# install from PyPI
16
19
pip install dataherald
17
20
```
18
21
@@ -21,12 +24,9 @@ pip install dataherald
21
24
The full API of this library can be found in [api.md](api.md).
22
25
23
26
```python
24
-
import os
25
27
from dataherald import Dataherald
26
28
27
29
client = Dataherald(
28
-
# This is the default and can be omitted
29
-
api_key=os.environ.get("DATAHERALD_API_KEY"),
30
30
# defaults to "production".
31
31
environment="staging",
32
32
)
@@ -48,13 +48,10 @@ so that your API Key is not stored in source control.
48
48
Simply import `AsyncDataherald` instead of `Dataherald` and use `await` with each API call:
49
49
50
50
```python
51
-
import os
52
51
import asyncio
53
52
from dataherald import AsyncDataherald
54
53
55
54
client = AsyncDataherald(
56
-
# This is the default and can be omitted
57
-
api_key=os.environ.get("DATAHERALD_API_KEY"),
58
55
# defaults to "production".
59
56
environment="staging",
60
57
)
@@ -75,10 +72,10 @@ Functionality between the synchronous and asynchronous clients is otherwise iden
75
72
76
73
## Using types
77
74
78
-
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev), which provide helper methods for things like:
75
+
Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
79
76
80
-
- Serializing back into JSON, `model.model_dump_json(indent=2, exclude_unset=True)`
81
-
- Converting to a dictionary, `model.model_dump(exclude_unset=True)`
77
+
- Serializing back into JSON, `model.to_json()`
78
+
- Converting to a dictionary, `model.to_dict()`
82
79
83
80
Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
84
81
@@ -128,7 +125,7 @@ Error codes are as followed:
128
125
129
126
### Retries
130
127
131
-
Certain errors are automatically retried 0 times by default, with a short exponential backoff.
128
+
Certain errors are automatically retried 2 times by default, with a short exponential backoff.
132
129
Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
133
130
429 Rate Limit, and >=500 Internal errors are all retried by default.
0 commit comments