parsagon 0.14.15__tar.gz → 0.14.17__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.
Files changed (38) hide show
  1. {parsagon-0.14.15 → parsagon-0.14.17}/PKG-INFO +1 -1
  2. {parsagon-0.14.15 → parsagon-0.14.17}/pyproject.toml +1 -1
  3. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/__init__.py +1 -0
  4. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/assistant.py +8 -8
  5. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/executor.py +14 -1
  6. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/PKG-INFO +1 -1
  7. {parsagon-0.14.15 → parsagon-0.14.17}/README.md +0 -0
  8. {parsagon-0.14.15 → parsagon-0.14.17}/setup.cfg +0 -0
  9. {parsagon-0.14.15 → parsagon-0.14.17}/src/__init__.py +0 -0
  10. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/api.py +0 -0
  11. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/create.py +0 -0
  12. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/custom_function.py +0 -0
  13. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/edit.py +0 -0
  14. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/exceptions.py +0 -0
  15. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui/__init__.py +0 -0
  16. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui/controller.py +0 -0
  17. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui/menu.py +0 -0
  18. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui/window.py +0 -0
  19. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/gui_entry.py +0 -0
  20. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/highlights.js +0 -0
  21. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/main.py +0 -0
  22. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/print.py +0 -0
  23. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/runs.py +0 -0
  24. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/secrets.py +0 -0
  25. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/settings.py +0 -0
  26. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/__init__.py +0 -0
  27. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/api_mocks.py +0 -0
  28. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/conftest.py +0 -0
  29. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_executor.py +0 -0
  30. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_invalid_args.py +0 -0
  31. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_pipeline_operations.py +0 -0
  32. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_print.py +0 -0
  33. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon/tests/test_secrets.py +0 -0
  34. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/SOURCES.txt +0 -0
  35. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/dependency_links.txt +0 -0
  36. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/entry_points.txt +0 -0
  37. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/requires.txt +0 -0
  38. {parsagon-0.14.15 → parsagon-0.14.17}/src/parsagon.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: parsagon
3
- Version: 0.14.15
3
+ Version: 0.14.17
4
4
  Summary: Allows you to create browser automations with natural language
5
5
  Author-email: Sandy Suh <sandy@parsagon.io>
6
6
  Project-URL: Homepage, https://parsagon.io
@@ -16,7 +16,7 @@ line-length = 120
16
16
 
17
17
  [project]
18
18
  name = "parsagon"
19
- version = "0.14.15"
19
+ version = "0.14.17"
20
20
  description = "Allows you to create browser automations with natural language"
21
21
  readme = "README.md"
22
22
  requires-python = ">=3.8"
@@ -3,3 +3,4 @@ from parsagon.create import create_program as create
3
3
  from parsagon.runs import run, batch_runs
4
4
  from parsagon.api import get_str_about_data, get_bool_about_data, get_json_about_data
5
5
  from parsagon.assistant import get_page_html, get_page_text
6
+ from parsagon.executor import Executor
@@ -65,11 +65,11 @@ def assist(verbose=False):
65
65
  break
66
66
 
67
67
 
68
- def get_page_html(url, headless=False, use_uc=False, timeout=None):
68
+ def get_page_html(url, headless=False, use_uc=False, page_load_timeout=None, script_timeout=None):
69
69
  browser_print(f"Checking what {url} looks like...")
70
- executor = Executor("", headless=headless, use_uc=use_uc)
71
- if timeout:
72
- executor.driver.set_page_load_timeout(timeout)
70
+ executor = Executor(
71
+ "", headless=headless, use_uc=use_uc, page_load_timeout=page_load_timeout, script_timeout=script_timeout
72
+ )
73
73
  try:
74
74
  executor.goto(url)
75
75
  html = executor.get_visible_html()
@@ -78,11 +78,11 @@ def get_page_html(url, headless=False, use_uc=False, timeout=None):
78
78
  return html
79
79
 
80
80
 
81
- def get_page_text(url, headless=False, use_uc=False, timeout=None):
81
+ def get_page_text(url, headless=False, use_uc=False, page_load_timeout=None, script_timeout=None):
82
82
  browser_print(f"Checking what {url} looks like...")
83
- executor = Executor("", headless=headless, use_uc=use_uc)
84
- if timeout:
85
- executor.driver.set_page_load_timeout(timeout)
83
+ executor = Executor(
84
+ "", headless=headless, use_uc=use_uc, page_load_timeout=page_load_timeout, script_timeout=script_timeout
85
+ )
86
86
  try:
87
87
  executor.goto(url)
88
88
  text = executor.driver.execute_script("return document.body.innerText;")
@@ -64,7 +64,16 @@ class Executor:
64
64
  Executes code produced by GPT with the proper context. Records custom_function usage along the way.
65
65
  """
66
66
 
67
- def __init__(self, task, headless=False, infer=False, use_uc=False, function_bank={}):
67
+ def __init__(
68
+ self,
69
+ task,
70
+ headless=False,
71
+ infer=False,
72
+ use_uc=False,
73
+ page_load_timeout=None,
74
+ script_timeout=None,
75
+ function_bank={},
76
+ ):
68
77
  self.task = task
69
78
  self.headless = headless
70
79
  self.function_bank = function_bank
@@ -79,6 +88,10 @@ class Executor:
79
88
  chrome_options = webdriver.ChromeOptions()
80
89
  chrome_options.add_argument("--start-maximized")
81
90
  self.driver = webdriver.Chrome(service=ChromeService(driver_executable_path), options=chrome_options)
91
+ if page_load_timeout:
92
+ self.driver.set_page_load_timeout(page_load_timeout)
93
+ if script_timeout:
94
+ self.driver.set_script_timeout(script_timeout)
82
95
  self.max_elem_ids = defaultdict(int)
83
96
  self.execution_context = {
84
97
  "custom_assert": self.custom_assert,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: parsagon
3
- Version: 0.14.15
3
+ Version: 0.14.17
4
4
  Summary: Allows you to create browser automations with natural language
5
5
  Author-email: Sandy Suh <sandy@parsagon.io>
6
6
  Project-URL: Homepage, https://parsagon.io
File without changes
File without changes
File without changes