curl2python 0.1.1__tar.gz → 0.1.2__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.
- {curl2python-0.1.1/src/curl2python.egg-info → curl2python-0.1.2}/PKG-INFO +1 -1
- {curl2python-0.1.1 → curl2python-0.1.2}/pyproject.toml +1 -1
- {curl2python-0.1.1 → curl2python-0.1.2/src/curl2python.egg-info}/PKG-INFO +1 -1
- curl2python-0.1.2/src/curl_converter/__init__.py +3 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/src/curl_converter/cli.py +2 -2
- {curl2python-0.1.1 → curl2python-0.1.2}/src/curl_converter/extract_configs.py +3 -3
- {curl2python-0.1.1 → curl2python-0.1.2}/src/curl_converter/using_playwright.py +1 -1
- curl2python-0.1.1/src/curl_converter/__init__.py +0 -3
- {curl2python-0.1.1 → curl2python-0.1.2}/LICENSE +0 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/README.md +0 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/setup.cfg +0 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/src/curl2python.egg-info/SOURCES.txt +0 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/src/curl2python.egg-info/dependency_links.txt +0 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/src/curl2python.egg-info/entry_points.txt +0 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/src/curl2python.egg-info/requires.txt +0 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/src/curl2python.egg-info/top_level.txt +0 -0
- {curl2python-0.1.1 → curl2python-0.1.2}/tests/test_converter.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import argparse
|
|
2
|
-
from .extract_configs import
|
|
2
|
+
from .extract_configs import curl_to_python
|
|
3
3
|
|
|
4
4
|
def main():
|
|
5
5
|
parser = argparse.ArgumentParser(description="Convert curl to Python requests")
|
|
@@ -7,7 +7,7 @@ def main():
|
|
|
7
7
|
|
|
8
8
|
args = parser.parse_args()
|
|
9
9
|
|
|
10
|
-
result =
|
|
10
|
+
result = curl_to_python(args.curl)
|
|
11
11
|
|
|
12
12
|
print(result)
|
|
13
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import ast
|
|
2
|
-
from using_playwright import
|
|
2
|
+
from .using_playwright import get_python_script
|
|
3
3
|
def extract_request_details(code):
|
|
4
4
|
tree = ast.parse(code)
|
|
5
5
|
|
|
@@ -56,9 +56,9 @@ def extract_request_details(code):
|
|
|
56
56
|
Visitor().visit(tree)
|
|
57
57
|
return result
|
|
58
58
|
|
|
59
|
-
def
|
|
59
|
+
def curl_to_python(curl_text):
|
|
60
60
|
# Example usage
|
|
61
|
-
code =
|
|
61
|
+
code = get_python_script(curl_text)
|
|
62
62
|
|
|
63
63
|
details = extract_request_details(code)
|
|
64
64
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from playwright.sync_api import sync_playwright
|
|
2
2
|
|
|
3
|
-
def
|
|
3
|
+
def get_python_script(curl_text):
|
|
4
4
|
with sync_playwright() as p:
|
|
5
5
|
browser = p.chromium.launch(headless=True) # must be False
|
|
6
6
|
context = browser.new_context(permissions=["clipboard-read", "clipboard-write"])
|
|
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
|