Skip to content

Commit 3a289a4

Browse files
Merge pull request #23 from OneBusAway/release-please--branches--main--changes--next
release: 0.1.0-alpha.6
2 parents d4367ba + 29aa840 commit 3a289a4

24 files changed

Lines changed: 596 additions & 119 deletions

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.5"
2+
".": "0.1.0-alpha.6"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 15
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-ac10a054ead5e711bd033b417891c1769d631135029ca5bd91e6584420403ee2.yml
1+
configured_endpoints: 16
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/open-transit%2Fopen-transit-7a71bec90a568b0dbefc3d81206069d9759259460cffa0543b162f6835be1e9a.yml

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 0.1.0-alpha.6 (2024-07-29)
4+
5+
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/OneBusAway/python-sdk/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
6+
7+
### Features
8+
9+
* **api:** OpenAPI spec update via Stainless API ([#22](https://github.com/OneBusAway/python-sdk/issues/22)) ([54e9f2a](https://github.com/OneBusAway/python-sdk/commit/54e9f2aefaf7a88392bf23ec3301efd2191013a7))
10+
* **api:** OpenAPI spec update via Stainless API ([#25](https://github.com/OneBusAway/python-sdk/issues/25)) ([64e3e43](https://github.com/OneBusAway/python-sdk/commit/64e3e4396b25d8d80ddee38ec99cda8409b0f597))
11+
12+
13+
### Chores
14+
15+
* **internal:** add type construction helper ([#24](https://github.com/OneBusAway/python-sdk/issues/24)) ([92184d0](https://github.com/OneBusAway/python-sdk/commit/92184d0e99d1ed3b9ccc13adf5aaa7bc6ddb334b))
16+
317
## 0.1.0-alpha.5 (2024-07-28)
418

519
Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/OneBusAway/python-sdk/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)

api.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@ Methods:
2828

2929
- <code title="get /api/where/agency/{agencyID}.json">client.agency.<a href="./src/onebusaway/resources/agency.py">retrieve</a>(agency_id) -> <a href="./src/onebusaway/types/agency_retrieve_response.py">AgencyRetrieveResponse</a></code>
3030

31+
# VehiclesForAgency
32+
33+
Types:
34+
35+
```python
36+
from onebusaway.types import VehiclesForAgencyListResponse
37+
```
38+
39+
Methods:
40+
41+
- <code title="get /api/where/vehicles-for-agency/{agencyID}.json">client.vehicles_for_agency.<a href="./src/onebusaway/resources/vehicles_for_agency.py">list</a>(agency_id, \*\*<a href="src/onebusaway/types/vehicles_for_agency_list_params.py">params</a>) -> <a href="./src/onebusaway/types/vehicles_for_agency_list_response.py">VehiclesForAgencyListResponse</a></code>
42+
3143
# Config
3244

3345
Types:

examples/vehicles_for_agency.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import onebusaway
2+
3+
4+
def main_sync() -> None:
5+
client = onebusaway.OnebusawaySDK(api_key="TEST")
6+
7+
agency_id = "40"
8+
agency = client.vehicles_for_agency.list(agency_id)
9+
10+
if agency.data and agency.data.list:
11+
print(agency.data.list)
12+
else:
13+
print("Agency data or list is None.")
14+
15+
16+
if __name__ == "__main__":
17+
main_sync()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "onebusaway"
3-
version = "0.1.0-alpha.5"
3+
version = "0.1.0-alpha.6"
44
description = "The official Python library for the onebusaway-sdk API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/onebusaway/_base_client.py

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -124,16 +124,14 @@ def __init__(
124124
self,
125125
*,
126126
url: URL,
127-
) -> None:
128-
...
127+
) -> None: ...
129128

130129
@overload
131130
def __init__(
132131
self,
133132
*,
134133
params: Query,
135-
) -> None:
136-
...
134+
) -> None: ...
137135

138136
def __init__(
139137
self,
@@ -166,8 +164,7 @@ def has_next_page(self) -> bool:
166164
return False
167165
return self.next_page_info() is not None
168166

169-
def next_page_info(self) -> Optional[PageInfo]:
170-
...
167+
def next_page_info(self) -> Optional[PageInfo]: ...
171168

172169
def _get_page_items(self) -> Iterable[_T]: # type: ignore[empty-body]
173170
...
@@ -903,8 +900,7 @@ def request(
903900
*,
904901
stream: Literal[True],
905902
stream_cls: Type[_StreamT],
906-
) -> _StreamT:
907-
...
903+
) -> _StreamT: ...
908904

909905
@overload
910906
def request(
@@ -914,8 +910,7 @@ def request(
914910
remaining_retries: Optional[int] = None,
915911
*,
916912
stream: Literal[False] = False,
917-
) -> ResponseT:
918-
...
913+
) -> ResponseT: ...
919914

920915
@overload
921916
def request(
@@ -926,8 +921,7 @@ def request(
926921
*,
927922
stream: bool = False,
928923
stream_cls: Type[_StreamT] | None = None,
929-
) -> ResponseT | _StreamT:
930-
...
924+
) -> ResponseT | _StreamT: ...
931925

932926
def request(
933927
self,
@@ -1152,8 +1146,7 @@ def get(
11521146
cast_to: Type[ResponseT],
11531147
options: RequestOptions = {},
11541148
stream: Literal[False] = False,
1155-
) -> ResponseT:
1156-
...
1149+
) -> ResponseT: ...
11571150

11581151
@overload
11591152
def get(
@@ -1164,8 +1157,7 @@ def get(
11641157
options: RequestOptions = {},
11651158
stream: Literal[True],
11661159
stream_cls: type[_StreamT],
1167-
) -> _StreamT:
1168-
...
1160+
) -> _StreamT: ...
11691161

11701162
@overload
11711163
def get(
@@ -1176,8 +1168,7 @@ def get(
11761168
options: RequestOptions = {},
11771169
stream: bool,
11781170
stream_cls: type[_StreamT] | None = None,
1179-
) -> ResponseT | _StreamT:
1180-
...
1171+
) -> ResponseT | _StreamT: ...
11811172

11821173
def get(
11831174
self,
@@ -1203,8 +1194,7 @@ def post(
12031194
options: RequestOptions = {},
12041195
files: RequestFiles | None = None,
12051196
stream: Literal[False] = False,
1206-
) -> ResponseT:
1207-
...
1197+
) -> ResponseT: ...
12081198

12091199
@overload
12101200
def post(
@@ -1217,8 +1207,7 @@ def post(
12171207
files: RequestFiles | None = None,
12181208
stream: Literal[True],
12191209
stream_cls: type[_StreamT],
1220-
) -> _StreamT:
1221-
...
1210+
) -> _StreamT: ...
12221211

12231212
@overload
12241213
def post(
@@ -1231,8 +1220,7 @@ def post(
12311220
files: RequestFiles | None = None,
12321221
stream: bool,
12331222
stream_cls: type[_StreamT] | None = None,
1234-
) -> ResponseT | _StreamT:
1235-
...
1223+
) -> ResponseT | _StreamT: ...
12361224

12371225
def post(
12381226
self,
@@ -1465,8 +1453,7 @@ async def request(
14651453
*,
14661454
stream: Literal[False] = False,
14671455
remaining_retries: Optional[int] = None,
1468-
) -> ResponseT:
1469-
...
1456+
) -> ResponseT: ...
14701457

14711458
@overload
14721459
async def request(
@@ -1477,8 +1464,7 @@ async def request(
14771464
stream: Literal[True],
14781465
stream_cls: type[_AsyncStreamT],
14791466
remaining_retries: Optional[int] = None,
1480-
) -> _AsyncStreamT:
1481-
...
1467+
) -> _AsyncStreamT: ...
14821468

14831469
@overload
14841470
async def request(
@@ -1489,8 +1475,7 @@ async def request(
14891475
stream: bool,
14901476
stream_cls: type[_AsyncStreamT] | None = None,
14911477
remaining_retries: Optional[int] = None,
1492-
) -> ResponseT | _AsyncStreamT:
1493-
...
1478+
) -> ResponseT | _AsyncStreamT: ...
14941479

14951480
async def request(
14961481
self,
@@ -1701,8 +1686,7 @@ async def get(
17011686
cast_to: Type[ResponseT],
17021687
options: RequestOptions = {},
17031688
stream: Literal[False] = False,
1704-
) -> ResponseT:
1705-
...
1689+
) -> ResponseT: ...
17061690

17071691
@overload
17081692
async def get(
@@ -1713,8 +1697,7 @@ async def get(
17131697
options: RequestOptions = {},
17141698
stream: Literal[True],
17151699
stream_cls: type[_AsyncStreamT],
1716-
) -> _AsyncStreamT:
1717-
...
1700+
) -> _AsyncStreamT: ...
17181701

17191702
@overload
17201703
async def get(
@@ -1725,8 +1708,7 @@ async def get(
17251708
options: RequestOptions = {},
17261709
stream: bool,
17271710
stream_cls: type[_AsyncStreamT] | None = None,
1728-
) -> ResponseT | _AsyncStreamT:
1729-
...
1711+
) -> ResponseT | _AsyncStreamT: ...
17301712

17311713
async def get(
17321714
self,
@@ -1750,8 +1732,7 @@ async def post(
17501732
files: RequestFiles | None = None,
17511733
options: RequestOptions = {},
17521734
stream: Literal[False] = False,
1753-
) -> ResponseT:
1754-
...
1735+
) -> ResponseT: ...
17551736

17561737
@overload
17571738
async def post(
@@ -1764,8 +1745,7 @@ async def post(
17641745
options: RequestOptions = {},
17651746
stream: Literal[True],
17661747
stream_cls: type[_AsyncStreamT],
1767-
) -> _AsyncStreamT:
1768-
...
1748+
) -> _AsyncStreamT: ...
17691749

17701750
@overload
17711751
async def post(
@@ -1778,8 +1758,7 @@ async def post(
17781758
options: RequestOptions = {},
17791759
stream: bool,
17801760
stream_cls: type[_AsyncStreamT] | None = None,
1781-
) -> ResponseT | _AsyncStreamT:
1782-
...
1761+
) -> ResponseT | _AsyncStreamT: ...
17831762

17841763
async def post(
17851764
self,

src/onebusaway/_client.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
class OnebusawaySDK(SyncAPIClient):
4949
agencies_with_coverage: resources.AgenciesWithCoverageResource
5050
agency: resources.AgencyResource
51+
vehicles_for_agency: resources.VehiclesForAgencyResource
5152
config: resources.ConfigResource
5253
current_time: resources.CurrentTimeResource
5354
stops_for_location: resources.StopsForLocationResource
@@ -119,6 +120,7 @@ def __init__(
119120

120121
self.agencies_with_coverage = resources.AgenciesWithCoverageResource(self)
121122
self.agency = resources.AgencyResource(self)
123+
self.vehicles_for_agency = resources.VehiclesForAgencyResource(self)
122124
self.config = resources.ConfigResource(self)
123125
self.current_time = resources.CurrentTimeResource(self)
124126
self.stops_for_location = resources.StopsForLocationResource(self)
@@ -250,6 +252,7 @@ def _make_status_error(
250252
class AsyncOnebusawaySDK(AsyncAPIClient):
251253
agencies_with_coverage: resources.AsyncAgenciesWithCoverageResource
252254
agency: resources.AsyncAgencyResource
255+
vehicles_for_agency: resources.AsyncVehiclesForAgencyResource
253256
config: resources.AsyncConfigResource
254257
current_time: resources.AsyncCurrentTimeResource
255258
stops_for_location: resources.AsyncStopsForLocationResource
@@ -321,6 +324,7 @@ def __init__(
321324

322325
self.agencies_with_coverage = resources.AsyncAgenciesWithCoverageResource(self)
323326
self.agency = resources.AsyncAgencyResource(self)
327+
self.vehicles_for_agency = resources.AsyncVehiclesForAgencyResource(self)
324328
self.config = resources.AsyncConfigResource(self)
325329
self.current_time = resources.AsyncCurrentTimeResource(self)
326330
self.stops_for_location = resources.AsyncStopsForLocationResource(self)
@@ -455,6 +459,7 @@ def __init__(self, client: OnebusawaySDK) -> None:
455459
client.agencies_with_coverage
456460
)
457461
self.agency = resources.AgencyResourceWithRawResponse(client.agency)
462+
self.vehicles_for_agency = resources.VehiclesForAgencyResourceWithRawResponse(client.vehicles_for_agency)
458463
self.config = resources.ConfigResourceWithRawResponse(client.config)
459464
self.current_time = resources.CurrentTimeResourceWithRawResponse(client.current_time)
460465
self.stops_for_location = resources.StopsForLocationResourceWithRawResponse(client.stops_for_location)
@@ -475,6 +480,7 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
475480
client.agencies_with_coverage
476481
)
477482
self.agency = resources.AsyncAgencyResourceWithRawResponse(client.agency)
483+
self.vehicles_for_agency = resources.AsyncVehiclesForAgencyResourceWithRawResponse(client.vehicles_for_agency)
478484
self.config = resources.AsyncConfigResourceWithRawResponse(client.config)
479485
self.current_time = resources.AsyncCurrentTimeResourceWithRawResponse(client.current_time)
480486
self.stops_for_location = resources.AsyncStopsForLocationResourceWithRawResponse(client.stops_for_location)
@@ -497,6 +503,7 @@ def __init__(self, client: OnebusawaySDK) -> None:
497503
client.agencies_with_coverage
498504
)
499505
self.agency = resources.AgencyResourceWithStreamingResponse(client.agency)
506+
self.vehicles_for_agency = resources.VehiclesForAgencyResourceWithStreamingResponse(client.vehicles_for_agency)
500507
self.config = resources.ConfigResourceWithStreamingResponse(client.config)
501508
self.current_time = resources.CurrentTimeResourceWithStreamingResponse(client.current_time)
502509
self.stops_for_location = resources.StopsForLocationResourceWithStreamingResponse(client.stops_for_location)
@@ -519,6 +526,9 @@ def __init__(self, client: AsyncOnebusawaySDK) -> None:
519526
client.agencies_with_coverage
520527
)
521528
self.agency = resources.AsyncAgencyResourceWithStreamingResponse(client.agency)
529+
self.vehicles_for_agency = resources.AsyncVehiclesForAgencyResourceWithStreamingResponse(
530+
client.vehicles_for_agency
531+
)
522532
self.config = resources.AsyncConfigResourceWithStreamingResponse(client.config)
523533
self.current_time = resources.AsyncCurrentTimeResourceWithStreamingResponse(client.current_time)
524534
self.stops_for_location = resources.AsyncStopsForLocationResourceWithStreamingResponse(

0 commit comments

Comments
 (0)