parsagon 0.14.33__tar.gz → 0.14.35__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.33 → parsagon-0.14.35}/PKG-INFO +3 -1
  2. {parsagon-0.14.33 → parsagon-0.14.35}/pyproject.toml +3 -1
  3. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/executor.py +17 -0
  4. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon.egg-info/PKG-INFO +3 -1
  5. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon.egg-info/requires.txt +2 -0
  6. {parsagon-0.14.33 → parsagon-0.14.35}/README.md +0 -0
  7. {parsagon-0.14.33 → parsagon-0.14.35}/setup.cfg +0 -0
  8. {parsagon-0.14.33 → parsagon-0.14.35}/src/__init__.py +0 -0
  9. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/__init__.py +0 -0
  10. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/api.py +0 -0
  11. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/assistant.py +0 -0
  12. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/create.py +0 -0
  13. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/custom_function.py +0 -0
  14. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/edit.py +0 -0
  15. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/exceptions.py +0 -0
  16. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/gui/__init__.py +0 -0
  17. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/gui/controller.py +0 -0
  18. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/gui/menu.py +0 -0
  19. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/gui/window.py +0 -0
  20. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/gui_entry.py +0 -0
  21. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/highlights.js +0 -0
  22. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/main.py +0 -0
  23. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/print.py +0 -0
  24. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/runs.py +0 -0
  25. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/secrets.py +0 -0
  26. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/settings.py +0 -0
  27. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/tests/__init__.py +0 -0
  28. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/tests/api_mocks.py +0 -0
  29. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/tests/conftest.py +0 -0
  30. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/tests/test_executor.py +0 -0
  31. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/tests/test_invalid_args.py +0 -0
  32. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/tests/test_pipeline_operations.py +0 -0
  33. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/tests/test_print.py +0 -0
  34. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon/tests/test_secrets.py +0 -0
  35. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon.egg-info/SOURCES.txt +0 -0
  36. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon.egg-info/dependency_links.txt +0 -0
  37. {parsagon-0.14.33 → parsagon-0.14.35}/src/parsagon.egg-info/entry_points.txt +0 -0
  38. {parsagon-0.14.33 → parsagon-0.14.35}/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.33
3
+ Version: 0.14.35
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
@@ -21,6 +21,8 @@ Requires-Dist: webdriver-manager==4.0.2
21
21
  Requires-Dist: jsonpath-ng==1.5.3
22
22
  Requires-Dist: simplejson==3.19.1
23
23
  Requires-Dist: pypdf==4.2.0
24
+ Requires-Dist: python-dateutil==2.9.0.post0
25
+ Requires-Dist: html2text==2024.2.26
24
26
  Provides-Extra: dev
25
27
  Requires-Dist: pytest==7.3.2; extra == "dev"
26
28
  Requires-Dist: pytest-mock==3.11.1; extra == "dev"
@@ -16,7 +16,7 @@ line-length = 120
16
16
 
17
17
  [project]
18
18
  name = "parsagon"
19
- version = "0.14.33"
19
+ version = "0.14.35"
20
20
  description = "Allows you to create browser automations with natural language"
21
21
  readme = "README.md"
22
22
  requires-python = ">=3.8"
@@ -44,6 +44,8 @@ dependencies = [
44
44
  'jsonpath-ng==1.5.3',
45
45
  'simplejson==3.19.1',
46
46
  'pypdf==4.2.0',
47
+ 'python-dateutil==2.9.0.post0',
48
+ 'html2text==2024.2.26',
47
49
  ]
48
50
 
49
51
  [project.optional-dependencies]
@@ -1,5 +1,6 @@
1
1
  from collections import defaultdict
2
2
  import copy
3
+ import dateutil.parser
3
4
  import glob
4
5
  import json
5
6
  import logging
@@ -9,6 +10,7 @@ import psutil
9
10
  import time
10
11
  from urllib.parse import urljoin
11
12
 
13
+ import html2text
12
14
  from lxml import etree
13
15
  import lxml.html
14
16
  from pypdf import PdfReader
@@ -150,6 +152,7 @@ class Executor:
150
152
  "get_json_about_data": get_json_about_data,
151
153
  "get_serp_data": get_serp_data,
152
154
  "get_pdf_text": self.get_pdf_text,
155
+ "str_to_iso8601": self.str_to_iso8601,
153
156
  }
154
157
  self.custom_functions = {}
155
158
  self.infer = infer
@@ -587,6 +590,12 @@ class Executor:
587
590
  elem = self._id_to_elem(elem_id)
588
591
  return elem.get_attribute("innerText")
589
592
 
593
+ def get_inner_markdown(self, window_id):
594
+ if self.driver.current_window_handle != window_id:
595
+ self.driver.switch_to.window(window_id)
596
+ html = self.driver.execute_script("return document.body.innerHTML;")
597
+ return html2text.html2text(html)
598
+
590
599
  def scrape_data(self, schema, window_id, call_id):
591
600
  """
592
601
  Scrapes data from the current page.
@@ -671,6 +680,14 @@ class Executor:
671
680
  os.remove(most_recent_file)
672
681
  return text
673
682
 
683
+ def str_to_iso8601(self, s):
684
+ while s:
685
+ try:
686
+ return dateutil.parser.parse(s).isoformat()
687
+ except dateutil.parser._parser.ParserError:
688
+ s = " ".join(s.split()[:-1])
689
+ return ""
690
+
674
691
  def execute(self, code):
675
692
  loc = {}
676
693
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: parsagon
3
- Version: 0.14.33
3
+ Version: 0.14.35
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
@@ -21,6 +21,8 @@ Requires-Dist: webdriver-manager==4.0.2
21
21
  Requires-Dist: jsonpath-ng==1.5.3
22
22
  Requires-Dist: simplejson==3.19.1
23
23
  Requires-Dist: pypdf==4.2.0
24
+ Requires-Dist: python-dateutil==2.9.0.post0
25
+ Requires-Dist: html2text==2024.2.26
24
26
  Provides-Extra: dev
25
27
  Requires-Dist: pytest==7.3.2; extra == "dev"
26
28
  Requires-Dist: pytest-mock==3.11.1; extra == "dev"
@@ -11,6 +11,8 @@ webdriver-manager==4.0.2
11
11
  jsonpath-ng==1.5.3
12
12
  simplejson==3.19.1
13
13
  pypdf==4.2.0
14
+ python-dateutil==2.9.0.post0
15
+ html2text==2024.2.26
14
16
 
15
17
  [dev]
16
18
  pytest==7.3.2
File without changes
File without changes
File without changes