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: CONTRIBUTING.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
### With Rye
4
4
5
-
We use [Rye](https://rye-up.com/) to manage dependencies so we highly recommend [installing it](https://rye-up.com/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
5
+
We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
6
6
7
7
After installing Rye, you'll just have to run this command:
Alternatively, you can build from source and install the wheel file:
@@ -117,7 +117,7 @@ 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/stainless-sdks/TEMP_open-transit-python/actions/workflows/publish-pypi.yml). This requires 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/stainless-sdks/open-transit-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
@@ -53,36 +71,36 @@ Functionality between the synchronous and asynchronous clients is otherwise iden
53
71
54
72
## Using types
55
73
56
-
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:
74
+
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:
57
75
58
-
- Serializing back into JSON, `model.model_dump_json(indent=2, exclude_unset=True)`
59
-
- Converting to a dictionary, `model.model_dump(exclude_unset=True)`
76
+
- Serializing back into JSON, `model.to_json()`
77
+
- Converting to a dictionary, `model.to_dict()`
60
78
61
79
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`.
62
80
63
81
## Handling errors
64
82
65
-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `open_transit.APIConnectionError` is raised.
83
+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `onebusaway.APIConnectionError` is raised.
66
84
67
85
When the API returns a non-success status code (that is, 4xx or 5xx
68
-
response), a subclass of `open_transit.APIStatusError` is raised, containing `status_code` and `response` properties.
86
+
response), a subclass of `onebusaway.APIStatusError` is raised, containing `status_code` and `response` properties.
69
87
70
-
All errors inherit from `open_transit.APIError`.
88
+
All errors inherit from `onebusaway.APIError`.
71
89
72
90
```python
73
-
importopen_transit
74
-
fromopen_transitimportOpenTransit
91
+
importonebusaway
92
+
fromonebusawayimportOneBusAway
75
93
76
-
client =OpenTransit()
94
+
client =OneBusAway()
77
95
78
96
try:
79
-
client.agencies_with_coverage.list()
80
-
exceptopen_transit.APIConnectionError as e:
97
+
client.agencies_with_coverage.retrieve()
98
+
exceptonebusaway.APIConnectionError as e:
81
99
print("The server could not be reached")
82
100
print(e.__cause__) # an underlying Exception, likely raised within httpx.
83
-
exceptopen_transit.RateLimitError as e:
101
+
exceptonebusaway.RateLimitError as e:
84
102
print("A 429 status code was received; we should back off a bit.")
85
-
exceptopen_transit.APIStatusError as e:
103
+
exceptonebusaway.APIStatusError as e:
86
104
print("Another non-200-range status code was received")
87
105
print(e.status_code)
88
106
print(e.response)
@@ -110,16 +128,16 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
110
128
You can use the `max_retries` option to configure or disable retry settings:
agencies_with_coverage = response.parse() # get the object that `agencies_with_coverage.list()` would have returned
188
-
print(agencies_with_coverage)
205
+
agencies_with_coverage = response.parse() # get the object that `agencies_with_coverage.retrieve()` would have returned
206
+
print(agencies_with_coverage.code)
189
207
```
190
208
191
-
These methods return an [`APIResponse`](https://github.com/stainless-sdks/tree/main/src/open_transit/_response.py) object.
209
+
These methods return an [`APIResponse`](https://github.com/stainless-sdks/open-transit-python/tree/main/src/onebusaway/_response.py) object.
192
210
193
-
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/tree/main/src/open_transit/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
211
+
The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/open-transit-python/tree/main/src/onebusaway/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
194
212
195
213
#### `.with_streaming_response`
196
214
@@ -199,7 +217,7 @@ The above interface eagerly reads the full response body when you make the reque
199
217
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
200
218
201
219
```python
202
-
with client.agencies_with_coverage.with_streaming_response.list() as response:
220
+
with client.agencies_with_coverage.with_streaming_response.retrieve() as response:
203
221
print(response.headers.get("X-My-Header"))
204
222
205
223
for line in response.iter_lines():
@@ -210,7 +228,7 @@ The context manager is required so that the response will reliably be closed.
210
228
211
229
### Making custom/undocumented requests
212
230
213
-
This library is typed for convenient access the documented API.
231
+
This library is typed for convenient access to the documented API.
214
232
215
233
If you need to access undocumented endpoints, params, or response properties, the library can still be used.
216
234
@@ -252,10 +270,10 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
@@ -278,7 +296,7 @@ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) con
278
296
279
297
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
280
298
281
-
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/TEMP_open-transit-python/issues) with questions, bugs, or suggestions.
299
+
We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/open-transit-python/issues) with questions, bugs, or suggestions.
This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
6
+
7
+
To report a security issue, please contact the Stainless team at security@stainlessapi.com.
8
+
9
+
## Responsible Disclosure
10
+
11
+
We appreciate the efforts of security researchers and individuals who help us maintain the security of
12
+
SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible
13
+
disclosure practices by allowing us a reasonable amount of time to investigate and address the issue
14
+
before making any information public.
15
+
16
+
## Reporting Non-SDK Related Security Issues
17
+
18
+
If you encounter security issues that are not directly related to SDKs but pertain to the services
19
+
or products provided by One Bus Away please follow the respective company's security reporting guidelines.
20
+
21
+
### One Bus Away Terms and Policies
22
+
23
+
Please contact dev-feedback@open-transit.com for any questions or concerns regarding security of our services.
24
+
25
+
---
26
+
27
+
Thank you for helping us keep the SDKs and systems they interact with secure.
0 commit comments