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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastspec
3
- Version: 0.2.8
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
@@ -4,4 +4,6 @@ Modules:
4
4
 
5
5
  - `fastspec.gql`: Build GraphQL queries by field-checked attribute chaining, reuse distilled schemas, and combine queries into batched requests"""
6
6
 
7
- __version__ = "0.2.8"
7
+ __version__ = "0.2.9"
8
+
9
+
@@ -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('POST', url, headers={**headers, 'X-Upload-Content-Type': ctype}, params={**query, 'uploadType': 'resumable'}, json=body, raw=True),
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.8
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