fastspec 0.2.8__tar.gz → 0.2.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fastspec-0.2.8 → fastspec-0.2.9}/PKG-INFO +1 -1
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec/__init__.py +3 -1
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec/gql.py +2 -1
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec/oapi.py +2 -1
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec.egg-info/PKG-INFO +1 -1
- {fastspec-0.2.8 → fastspec-0.2.9}/LICENSE +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/README.md +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec/_modidx.py +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec/spec.py +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec.egg-info/SOURCES.txt +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec.egg-info/dependency_links.txt +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec.egg-info/entry_points.txt +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec.egg-info/requires.txt +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/fastspec.egg-info/top_level.txt +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/pyproject.toml +0 -0
- {fastspec-0.2.8 → fastspec-0.2.9}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastspec
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Dynamic OpenAPI, Discovery, and GraphQL spec client for Python — turn any API spec into a fully-typed async client with attribute chaining, streaming, and file uploads
|
|
5
5
|
Author-email: Kerem Turgutlu <keremturgutlu@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -256,8 +256,9 @@ def _repr_markdown_(self:GqlFrag): return f'```text\n{self!r}\n```\n\n{inspect.g
|
|
|
256
256
|
|
|
257
257
|
# %% ../nbs/05_gql.ipynb #9c52696f
|
|
258
258
|
def _unwrap(data, steps):
|
|
259
|
-
for nm, _, raw in steps:
|
|
259
|
+
for i, (nm, _, raw) in enumerate(steps):
|
|
260
260
|
if data is None: return None
|
|
261
|
+
if isinstance(data, (list, L)): return L(_unwrap(o, steps[i:]) for o in data)
|
|
261
262
|
data = data[nm]
|
|
262
263
|
if raw: break
|
|
263
264
|
return data
|
|
@@ -17,6 +17,7 @@ from fastcore.apisurface import snake, sanitized_params, mk_sig, mk_doc, mk_grou
|
|
|
17
17
|
|
|
18
18
|
from .spec import OpSpec, SpecParser
|
|
19
19
|
from fasttransport.core import AsyncTransport,SyncTransport
|
|
20
|
+
from fasttransport.errors import APIError
|
|
20
21
|
|
|
21
22
|
|
|
22
23
|
# %% ../nbs/04_oapi.ipynb #6b2f1057
|
|
@@ -212,7 +213,7 @@ def _upload(self:OpFunc, media, media_type, *, headers, query, route, body):
|
|
|
212
213
|
if hasattr(media, 'read'): media = media.read()
|
|
213
214
|
ctype = media_type or mimetypes.guess_type(fname or '')[0] or 'application/octet-stream'
|
|
214
215
|
url = _path(self.media_url, route_params=route)
|
|
215
|
-
return then(self.client.request(
|
|
216
|
+
return then(self.client.request(self.verb, url, headers={**headers, 'X-Upload-Content-Type': ctype}, params={**query, 'uploadType': 'resumable'}, json=body, raw=True),
|
|
216
217
|
~Self.headers['location'], partial(self.client.request, 'PUT', headers={'Content-Type': ctype}, content=media), dict2obj)
|
|
217
218
|
|
|
218
219
|
# %% ../nbs/04_oapi.ipynb #a45f810a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fastspec
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Dynamic OpenAPI, Discovery, and GraphQL spec client for Python — turn any API spec into a fully-typed async client with attribute chaining, streaming, and file uploads
|
|
5
5
|
Author-email: Kerem Turgutlu <keremturgutlu@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|