ssc_codegen 0.32.1__tar.gz → 0.32.3__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.
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/PKG-INFO +1 -1
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/pyproject.toml +1 -1
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/request_spec.py +13 -2
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/http_libs/aiohttp.py +3 -3
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/.gitignore +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/LICENSE +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/README.md +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/_logging.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/array.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/base.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/cast.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/control.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/extract.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/helpers.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/jsondef.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/module.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/predicate_containers.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/predicate_ops.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/regex.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/rest.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/selectors.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/string.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/struct.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/typedef.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/ast/types.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/contexts.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/expressions.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/format.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/linter.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/module_handler.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/predicates.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/reader.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/rest_artifacts.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/struct_parser.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/core/type_checking.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/exceptions.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/explore.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/generation/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/generation/builder.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/generation/runtime.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/health.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/main.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/naming.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/parsers/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/parsers/curl.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/parsers/http.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/regex_utils.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/http_libs/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/http_libs/base.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/http_libs/nethttp.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/literals.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/regex.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/rest.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/runtime.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/golang/visitor.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/javascript/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/javascript/http_libs/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/javascript/http_libs/axios.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/javascript/http_libs/base.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/javascript/http_libs/fetch.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/javascript/rest.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/javascript/visitor.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/profile.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/html_libs/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/html_libs/base.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/html_libs/bs4.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/html_libs/lxml.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/html_libs/parsel.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/html_libs/slax.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/http_libs/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/http_libs/base.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/http_libs/httpx.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/http_libs/requests.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/rest.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/python/visitor.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/resolver.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/spec.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/traversal/__init__.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/traversal/context.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/traversal/utils.py +0 -0
- {ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/traversal/walker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ssc_codegen
|
|
3
|
-
Version: 0.32.
|
|
3
|
+
Version: 0.32.3
|
|
4
4
|
Summary: Python-dsl code converter to html parser for web scraping
|
|
5
5
|
Project-URL: Documentation, https://github.com/vypivshiy/selector_schema_codegen#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/vypivshiy/selector_schema_codegen/issues
|
|
@@ -62,10 +62,21 @@ def parse_to_http(payload: str) -> RequestHttp:
|
|
|
62
62
|
|
|
63
63
|
method: str = kwargs.get("method", "GET").upper()
|
|
64
64
|
full_url: str = kwargs.get("url", "")
|
|
65
|
-
|
|
65
|
+
raw_params: dict = kwargs.get("params", {})
|
|
66
|
+
# Bare-value query form like ``?32-{{username}}`` (no ``=``) makes
|
|
67
|
+
# parse_qs classify the whole token as a dict KEY with empty value.
|
|
68
|
+
# Dict keys are never tokenized downstream, so the placeholder would be
|
|
69
|
+
# lost from both the URL and the signature. When that happens, keep the
|
|
70
|
+
# full URL so PlaceholderTemplate.parse(url) can tokenize it and skip the
|
|
71
|
+
# params dict. Proper ``key=...`` form yields clean keys → params path.
|
|
72
|
+
if any(PlaceholderSpec.search(k) for k in raw_params):
|
|
73
|
+
url = full_url
|
|
74
|
+
params: dict = {}
|
|
75
|
+
else:
|
|
76
|
+
url = _strip_query(full_url)
|
|
77
|
+
params = raw_params
|
|
66
78
|
headers: dict = kwargs.get("headers", {})
|
|
67
79
|
cookies: dict = kwargs.get("cookies", {})
|
|
68
|
-
params: dict = kwargs.get("params", {})
|
|
69
80
|
|
|
70
81
|
# ── body ─────────────────────────────────────────────────────────────────
|
|
71
82
|
body_kind = "empty"
|
|
@@ -41,7 +41,7 @@ class AioHttpStrategy(HttpLibStrategy):
|
|
|
41
41
|
lines.append(f"{i3}_resp.raise_for_status()")
|
|
42
42
|
if response_path:
|
|
43
43
|
accessor = "".join(f"[{p!r}]" for p in response_path.split("."))
|
|
44
|
-
lines.append(f"{i3}_data = await _resp.json()")
|
|
44
|
+
lines.append(f"{i3}_data = await _resp.json(content_type=None)")
|
|
45
45
|
if response_join:
|
|
46
46
|
lines.append(
|
|
47
47
|
f"{i3}_body = {response_join!r}.join(_data{accessor})"
|
|
@@ -133,7 +133,7 @@ class AioHttpStrategy(HttpLibStrategy):
|
|
|
133
133
|
" status = resp.status",
|
|
134
134
|
" headers = {k.lower(): v for k, v in resp.headers.items()}",
|
|
135
135
|
" try:",
|
|
136
|
-
" body = await resp.json()",
|
|
136
|
+
" body = await resp.json(content_type=None)",
|
|
137
137
|
" except Exception:",
|
|
138
138
|
" body = None",
|
|
139
139
|
f" except {exc} as exc:",
|
|
@@ -165,7 +165,7 @@ class AioHttpStrategy(HttpLibStrategy):
|
|
|
165
165
|
" status = resp.status",
|
|
166
166
|
" headers = {k.lower(): v for k, v in resp.headers.items()}",
|
|
167
167
|
" try:",
|
|
168
|
-
" body = await resp.json()",
|
|
168
|
+
" body = await resp.json(content_type=None)",
|
|
169
169
|
" except Exception:",
|
|
170
170
|
" body = None",
|
|
171
171
|
f" except {exc} as exc:",
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
{ssc_codegen-0.32.1 → ssc_codegen-0.32.3}/ssc_codegen/targets/javascript/http_libs/__init__.py
RENAMED
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|