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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: curl2python
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Convert curl commands to Python requests code
5
5
  Author: Ayush Thakkar
6
6
  License: MIT
@@ -2,7 +2,7 @@
2
2
 
3
3
  [project]
4
4
  name = "curl2python"
5
- version = "0.1.1"
5
+ version = "0.1.2"
6
6
  description = "Convert curl commands to Python requests code"
7
7
  readme = "README.md"
8
8
  authors = [{name="Ayush Thakkar"}]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: curl2python
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Convert curl commands to Python requests code
5
5
  Author: Ayush Thakkar
6
6
  License: MIT
@@ -0,0 +1,3 @@
1
+ from .extract_configs import curl_to_python
2
+
3
+ __all__ = ["curl_to_python"]
@@ -1,5 +1,5 @@
1
1
  import argparse
2
- from .extract_configs import get_configs
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 = get_configs(args.curl)
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 curl_to_python
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 get_configs(curl_text):
59
+ def curl_to_python(curl_text):
60
60
  # Example usage
61
- code = curl_to_python(curl_text)
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 curl_to_python(curl_text):
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"])
@@ -1,3 +0,0 @@
1
- from .extract_configs import get_configs
2
-
3
- __all__ = ["get_configs"]
File without changes
File without changes
File without changes