retab 0.0.41__tar.gz → 0.0.42__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 (127) hide show
  1. retab-0.0.42/PKG-INFO +119 -0
  2. retab-0.0.42/README.md +76 -0
  3. {retab-0.0.41 → retab-0.0.42}/retab/client.py +5 -5
  4. {retab-0.0.41 → retab-0.0.42}/retab/resources/consensus/completions_stream.py +2 -2
  5. {retab-0.0.41 → retab-0.0.42}/retab/resources/documents/client.py +9 -8
  6. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/automations/endpoints.py +8 -4
  7. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/automations/links.py +2 -2
  8. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/automations/logs.py +2 -2
  9. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/automations/mailboxes.py +42 -31
  10. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/automations/outlook.py +25 -7
  11. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/automations/tests.py +7 -1
  12. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/client.py +2 -2
  13. {retab-0.0.41 → retab-0.0.42}/retab/types/automations/mailboxes.py +1 -1
  14. {retab-0.0.41 → retab-0.0.42}/retab/types/documents/extractions.py +2 -2
  15. {retab-0.0.41 → retab-0.0.42}/retab/types/documents/parse.py +3 -1
  16. {retab-0.0.41 → retab-0.0.42}/retab/types/extractions.py +34 -9
  17. retab-0.0.42/retab.egg-info/PKG-INFO +119 -0
  18. {retab-0.0.41 → retab-0.0.42}/setup.py +1 -1
  19. {retab-0.0.41 → retab-0.0.42}/tests/test_automations_mailboxes.py +1 -1
  20. retab-0.0.41/PKG-INFO +0 -418
  21. retab-0.0.41/README.md +0 -375
  22. retab-0.0.41/retab.egg-info/PKG-INFO +0 -418
  23. {retab-0.0.41 → retab-0.0.42}/pyproject.toml +0 -0
  24. {retab-0.0.41 → retab-0.0.42}/retab/__init__.py +0 -0
  25. {retab-0.0.41 → retab-0.0.42}/retab/_resource.py +0 -0
  26. {retab-0.0.41 → retab-0.0.42}/retab/py.typed +0 -0
  27. {retab-0.0.41 → retab-0.0.42}/retab/resources/__init__.py +0 -0
  28. {retab-0.0.41 → retab-0.0.42}/retab/resources/consensus/__init__.py +0 -0
  29. {retab-0.0.41 → retab-0.0.42}/retab/resources/consensus/client.py +0 -0
  30. {retab-0.0.41 → retab-0.0.42}/retab/resources/consensus/completions.py +0 -0
  31. {retab-0.0.41 → retab-0.0.42}/retab/resources/consensus/responses.py +0 -0
  32. {retab-0.0.41 → retab-0.0.42}/retab/resources/consensus/responses_stream.py +0 -0
  33. {retab-0.0.41 → retab-0.0.42}/retab/resources/documents/__init__.py +0 -0
  34. {retab-0.0.41 → retab-0.0.42}/retab/resources/documents/extractions.py +0 -0
  35. {retab-0.0.41 → retab-0.0.42}/retab/resources/evals.py +0 -0
  36. {retab-0.0.41 → retab-0.0.42}/retab/resources/evaluations/__init__.py +0 -0
  37. {retab-0.0.41 → retab-0.0.42}/retab/resources/evaluations/client.py +0 -0
  38. {retab-0.0.41 → retab-0.0.42}/retab/resources/evaluations/documents.py +0 -0
  39. {retab-0.0.41 → retab-0.0.42}/retab/resources/evaluations/iterations.py +0 -0
  40. {retab-0.0.41 → retab-0.0.42}/retab/resources/files.py +0 -0
  41. {retab-0.0.41 → retab-0.0.42}/retab/resources/finetuning.py +0 -0
  42. {retab-0.0.41 → retab-0.0.42}/retab/resources/jsonlUtils.py +0 -0
  43. {retab-0.0.41 → retab-0.0.42}/retab/resources/models.py +0 -0
  44. {retab-0.0.41 → retab-0.0.42}/retab/resources/openai_example.py +0 -0
  45. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/__init__.py +0 -0
  46. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/automations/__init__.py +0 -0
  47. {retab-0.0.41 → retab-0.0.42}/retab/resources/processors/automations/client.py +0 -0
  48. {retab-0.0.41 → retab-0.0.42}/retab/resources/prompt_optimization.py +0 -0
  49. {retab-0.0.41 → retab-0.0.42}/retab/resources/schemas.py +0 -0
  50. {retab-0.0.41 → retab-0.0.42}/retab/resources/secrets/__init__.py +0 -0
  51. {retab-0.0.41 → retab-0.0.42}/retab/resources/secrets/client.py +0 -0
  52. {retab-0.0.41 → retab-0.0.42}/retab/resources/secrets/external_api_keys.py +0 -0
  53. {retab-0.0.41 → retab-0.0.42}/retab/resources/secrets/webhook.py +0 -0
  54. {retab-0.0.41 → retab-0.0.42}/retab/resources/usage.py +0 -0
  55. {retab-0.0.41 → retab-0.0.42}/retab/types/__init__.py +0 -0
  56. {retab-0.0.41 → retab-0.0.42}/retab/types/ai_models.py +0 -0
  57. {retab-0.0.41 → retab-0.0.42}/retab/types/automations/__init__.py +0 -0
  58. {retab-0.0.41 → retab-0.0.42}/retab/types/automations/cron.py +0 -0
  59. {retab-0.0.41 → retab-0.0.42}/retab/types/automations/endpoints.py +0 -0
  60. {retab-0.0.41 → retab-0.0.42}/retab/types/automations/links.py +0 -0
  61. {retab-0.0.41 → retab-0.0.42}/retab/types/automations/outlook.py +0 -0
  62. {retab-0.0.41 → retab-0.0.42}/retab/types/automations/webhooks.py +0 -0
  63. {retab-0.0.41 → retab-0.0.42}/retab/types/browser_canvas.py +0 -0
  64. {retab-0.0.41 → retab-0.0.42}/retab/types/chat.py +0 -0
  65. {retab-0.0.41 → retab-0.0.42}/retab/types/completions.py +0 -0
  66. {retab-0.0.41 → retab-0.0.42}/retab/types/consensus.py +0 -0
  67. {retab-0.0.41 → retab-0.0.42}/retab/types/db/__init__.py +0 -0
  68. {retab-0.0.41 → retab-0.0.42}/retab/types/db/annotations.py +0 -0
  69. {retab-0.0.41 → retab-0.0.42}/retab/types/db/files.py +0 -0
  70. {retab-0.0.41 → retab-0.0.42}/retab/types/documents/__init__.py +0 -0
  71. {retab-0.0.41 → retab-0.0.42}/retab/types/documents/correct_orientation.py +0 -0
  72. {retab-0.0.41 → retab-0.0.42}/retab/types/documents/create_messages.py +0 -0
  73. {retab-0.0.41 → retab-0.0.42}/retab/types/evals.py +0 -0
  74. {retab-0.0.41 → retab-0.0.42}/retab/types/evaluations/__init__.py +0 -0
  75. {retab-0.0.41 → retab-0.0.42}/retab/types/evaluations/documents.py +0 -0
  76. {retab-0.0.41 → retab-0.0.42}/retab/types/evaluations/iterations.py +0 -0
  77. {retab-0.0.41 → retab-0.0.42}/retab/types/evaluations/model.py +0 -0
  78. {retab-0.0.41 → retab-0.0.42}/retab/types/events.py +0 -0
  79. {retab-0.0.41 → retab-0.0.42}/retab/types/inference_settings.py +0 -0
  80. {retab-0.0.41 → retab-0.0.42}/retab/types/jobs/__init__.py +0 -0
  81. {retab-0.0.41 → retab-0.0.42}/retab/types/jobs/base.py +0 -0
  82. {retab-0.0.41 → retab-0.0.42}/retab/types/jobs/batch_annotation.py +0 -0
  83. {retab-0.0.41 → retab-0.0.42}/retab/types/jobs/evaluation.py +0 -0
  84. {retab-0.0.41 → retab-0.0.42}/retab/types/jobs/finetune.py +0 -0
  85. {retab-0.0.41 → retab-0.0.42}/retab/types/jobs/prompt_optimization.py +0 -0
  86. {retab-0.0.41 → retab-0.0.42}/retab/types/jobs/webcrawl.py +0 -0
  87. {retab-0.0.41 → retab-0.0.42}/retab/types/logs.py +0 -0
  88. {retab-0.0.41 → retab-0.0.42}/retab/types/metrics.py +0 -0
  89. {retab-0.0.41 → retab-0.0.42}/retab/types/mime.py +0 -0
  90. {retab-0.0.41 → retab-0.0.42}/retab/types/modalities.py +0 -0
  91. {retab-0.0.41 → retab-0.0.42}/retab/types/pagination.py +0 -0
  92. {retab-0.0.41 → retab-0.0.42}/retab/types/predictions.py +0 -0
  93. {retab-0.0.41 → retab-0.0.42}/retab/types/schemas/__init__.py +0 -0
  94. {retab-0.0.41 → retab-0.0.42}/retab/types/schemas/enhance.py +0 -0
  95. {retab-0.0.41 → retab-0.0.42}/retab/types/schemas/evaluate.py +0 -0
  96. {retab-0.0.41 → retab-0.0.42}/retab/types/schemas/generate.py +0 -0
  97. {retab-0.0.41 → retab-0.0.42}/retab/types/schemas/layout.py +0 -0
  98. {retab-0.0.41 → retab-0.0.42}/retab/types/schemas/object.py +0 -0
  99. {retab-0.0.41 → retab-0.0.42}/retab/types/schemas/templates.py +0 -0
  100. {retab-0.0.41 → retab-0.0.42}/retab/types/secrets/__init__.py +0 -0
  101. {retab-0.0.41 → retab-0.0.42}/retab/types/secrets/external_api_keys.py +0 -0
  102. {retab-0.0.41 → retab-0.0.42}/retab/types/standards.py +0 -0
  103. {retab-0.0.41 → retab-0.0.42}/retab/utils/__init__.py +0 -0
  104. {retab-0.0.41 → retab-0.0.42}/retab/utils/_model_cards/anthropic.yaml +0 -0
  105. {retab-0.0.41 → retab-0.0.42}/retab/utils/_model_cards/auto.yaml +0 -0
  106. {retab-0.0.41 → retab-0.0.42}/retab/utils/_model_cards/gemini.yaml +0 -0
  107. {retab-0.0.41 → retab-0.0.42}/retab/utils/_model_cards/openai.yaml +0 -0
  108. {retab-0.0.41 → retab-0.0.42}/retab/utils/_model_cards/xai.yaml +0 -0
  109. {retab-0.0.41 → retab-0.0.42}/retab/utils/ai_models.py +0 -0
  110. {retab-0.0.41 → retab-0.0.42}/retab/utils/benchmarking.py +0 -0
  111. {retab-0.0.41 → retab-0.0.42}/retab/utils/chat.py +0 -0
  112. {retab-0.0.41 → retab-0.0.42}/retab/utils/display.py +0 -0
  113. {retab-0.0.41 → retab-0.0.42}/retab/utils/json_schema.py +0 -0
  114. {retab-0.0.41 → retab-0.0.42}/retab/utils/mime.py +0 -0
  115. {retab-0.0.41 → retab-0.0.42}/retab/utils/responses.py +0 -0
  116. {retab-0.0.41 → retab-0.0.42}/retab/utils/stream_context_managers.py +0 -0
  117. {retab-0.0.41 → retab-0.0.42}/retab/utils/usage/__init__.py +0 -0
  118. {retab-0.0.41 → retab-0.0.42}/retab/utils/usage/usage.py +0 -0
  119. {retab-0.0.41 → retab-0.0.42}/retab.egg-info/SOURCES.txt +0 -0
  120. {retab-0.0.41 → retab-0.0.42}/retab.egg-info/dependency_links.txt +0 -0
  121. {retab-0.0.41 → retab-0.0.42}/retab.egg-info/requires.txt +0 -0
  122. {retab-0.0.41 → retab-0.0.42}/retab.egg-info/top_level.txt +0 -0
  123. {retab-0.0.41 → retab-0.0.42}/setup.cfg +0 -0
  124. {retab-0.0.41 → retab-0.0.42}/tests/test_automations_links.py +0 -0
  125. {retab-0.0.41 → retab-0.0.42}/tests/test_documents_api.py +0 -0
  126. {retab-0.0.41 → retab-0.0.42}/tests/test_evaluations.py +0 -0
  127. {retab-0.0.41 → retab-0.0.42}/tests/test_preprocessor.py +0 -0
retab-0.0.42/PKG-INFO ADDED
@@ -0,0 +1,119 @@
1
+ Metadata-Version: 2.1
2
+ Name: retab
3
+ Version: 0.0.42
4
+ Summary: Retab official python library
5
+ Home-page: https://github.com/Retab-dev/retab
6
+ Author: Retab
7
+ Author-email: contact@retab.com
8
+ Project-URL: Team website, https://retab.com
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: POSIX :: Linux
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Intended Audience :: Science/Research
14
+ Requires-Python: >=3.6
15
+ Description-Content-Type: text/markdown
16
+ Requires-Dist: Pillow
17
+ Requires-Dist: httpx
18
+ Requires-Dist: pydantic
19
+ Requires-Dist: pydantic_core
20
+ Requires-Dist: requests
21
+ Requires-Dist: tqdm
22
+ Requires-Dist: types-tqdm
23
+ Requires-Dist: backoff
24
+ Requires-Dist: termplotlib
25
+ Requires-Dist: Levenshtein
26
+ Requires-Dist: pandas
27
+ Requires-Dist: numpy
28
+ Requires-Dist: motor
29
+ Requires-Dist: rich
30
+ Requires-Dist: puremagic
31
+ Requires-Dist: pycountry
32
+ Requires-Dist: phonenumbers
33
+ Requires-Dist: email_validator
34
+ Requires-Dist: python-stdnum
35
+ Requires-Dist: nanoid
36
+ Requires-Dist: openai
37
+ Requires-Dist: google-genai
38
+ Requires-Dist: google-generativeai
39
+ Requires-Dist: anthropic
40
+ Requires-Dist: tiktoken
41
+ Requires-Dist: truststore
42
+ Requires-Dist: ruff
43
+
44
+ # Retab
45
+
46
+ <div align="center" style="margin-bottom: 1em;">
47
+
48
+ <img src="https://raw.githubusercontent.com/Retab-dev/retab/refs/heads/main/assets/retab-logo.png" alt="Retab Logo" width="150">
49
+
50
+
51
+ *The AI Automation Platform*
52
+
53
+ Made with love by the team at [Retab](https://retab.com) 🤍.
54
+
55
+ [Our Website](https://retab.com) | [Documentation](https://docs.retab.com/get-started/introduction) | [Discord](https://discord.com/invite/vc5tWRPqag) | [Twitter](https://x.com/retabdev)
56
+
57
+
58
+ </div>
59
+
60
+ ---
61
+
62
+ ### What is Retab?
63
+
64
+ Retab solves all the major challenges in document processing with LLMs:
65
+
66
+ 1. **Universal Document Preprocessing**: Convert any file type (PDFs, Excel, emails, etc.) into LLM-ready format without writing custom parsers
67
+ 2. **Structured, Schema-driven Extraction**: Get consistent, reliable outputs using schema-based prompt engineering
68
+ 3. **Processors**: Publish a live, stable, shareable document processor.
69
+ 4. **Automations**: Create document processing workflows that can be triggered by events (mailbox, upload link, endpoint, outlook plugin).
70
+ 5. **Evaluations**: Evaluate the performance of models against annotated datasets
71
+ 6. **Optimizations**: Identify the most used processors and help you finetune models to reduce costs and improve performance
72
+
73
+ We are offering you all the software-defined primitives to build your own document processing solutions. We see it as **Stripe** for document processing.
74
+
75
+ Our goal is to make the process of analyzing documents and unstructured data as **easy** and **transparent** as possible.
76
+
77
+ **A new, lighter paradigm**
78
+ Large Language Models collapse entire layers of legacy OCR pipelines into a single, elegant abstraction. When a model can read, reason, and structure text natively, we no longer need brittle heuristics, handcrafted parsers, or heavyweight ETL jobs. Instead, we can expose a small, principled API: "give me the document, tell me the schema, and get back structured truth." Complexity evaporates, reliability rises, speed follows, and costs fall—because every component you remove is one that can no longer break. LLM‑first design lets us focus less on plumbing and more on the questions we actually want answered.
79
+
80
+ Many people haven't yet realized how powerful LLMs have become at document processing tasks - we're here to help **unlock these capabilities**.
81
+
82
+ ---
83
+
84
+ ## Go further
85
+
86
+ * [Quickstart](/get-started/quickstart)
87
+ * [API Reference](/api-reference/introduction)
88
+
89
+ ---
90
+
91
+ ## Code examples
92
+
93
+ ## You can check our Github repository to see code examples: [python examples](https://github.com/Retab-dev/retab/tree/main/examples) and [jupyter notebooks](https://github.com/Retab-dev/retab-nodejs/tree/main/notebooks).
94
+
95
+ ## Community
96
+
97
+ Let's create the future of document processing together!
98
+
99
+ Join our [discord community](https://discord.com/invite/vc5tWRPqag) to share tips, discuss best practices, and showcase what you build. Or just [tweet](https://x.com/retabdev) at us.
100
+
101
+ We can't wait to see how you'll use Retab.
102
+
103
+ * [Discord](https://discord.com/invite/vc5tWRPqag)
104
+ * [Twitter](https://x.com/retabdev)
105
+
106
+ ---
107
+
108
+ ## Roadmap
109
+
110
+ We share our roadmap publicly on [Github](https://github.com/Retab-dev/retab)
111
+
112
+ Among the features we're working on:
113
+
114
+ * [ ] Node.js SDK
115
+ * [ ] Low-level speed optimizations for Evals Frontend
116
+ * [ ] Schema optimization autopilot
117
+ * [ ] Sources API
118
+ * [ ] Parse API for RAG
119
+
retab-0.0.42/README.md ADDED
@@ -0,0 +1,76 @@
1
+ # Retab
2
+
3
+ <div align="center" style="margin-bottom: 1em;">
4
+
5
+ <img src="https://raw.githubusercontent.com/Retab-dev/retab/refs/heads/main/assets/retab-logo.png" alt="Retab Logo" width="150">
6
+
7
+
8
+ *The AI Automation Platform*
9
+
10
+ Made with love by the team at [Retab](https://retab.com) 🤍.
11
+
12
+ [Our Website](https://retab.com) | [Documentation](https://docs.retab.com/get-started/introduction) | [Discord](https://discord.com/invite/vc5tWRPqag) | [Twitter](https://x.com/retabdev)
13
+
14
+
15
+ </div>
16
+
17
+ ---
18
+
19
+ ### What is Retab?
20
+
21
+ Retab solves all the major challenges in document processing with LLMs:
22
+
23
+ 1. **Universal Document Preprocessing**: Convert any file type (PDFs, Excel, emails, etc.) into LLM-ready format without writing custom parsers
24
+ 2. **Structured, Schema-driven Extraction**: Get consistent, reliable outputs using schema-based prompt engineering
25
+ 3. **Processors**: Publish a live, stable, shareable document processor.
26
+ 4. **Automations**: Create document processing workflows that can be triggered by events (mailbox, upload link, endpoint, outlook plugin).
27
+ 5. **Evaluations**: Evaluate the performance of models against annotated datasets
28
+ 6. **Optimizations**: Identify the most used processors and help you finetune models to reduce costs and improve performance
29
+
30
+ We are offering you all the software-defined primitives to build your own document processing solutions. We see it as **Stripe** for document processing.
31
+
32
+ Our goal is to make the process of analyzing documents and unstructured data as **easy** and **transparent** as possible.
33
+
34
+ **A new, lighter paradigm**
35
+ Large Language Models collapse entire layers of legacy OCR pipelines into a single, elegant abstraction. When a model can read, reason, and structure text natively, we no longer need brittle heuristics, handcrafted parsers, or heavyweight ETL jobs. Instead, we can expose a small, principled API: "give me the document, tell me the schema, and get back structured truth." Complexity evaporates, reliability rises, speed follows, and costs fall—because every component you remove is one that can no longer break. LLM‑first design lets us focus less on plumbing and more on the questions we actually want answered.
36
+
37
+ Many people haven't yet realized how powerful LLMs have become at document processing tasks - we're here to help **unlock these capabilities**.
38
+
39
+ ---
40
+
41
+ ## Go further
42
+
43
+ * [Quickstart](/get-started/quickstart)
44
+ * [API Reference](/api-reference/introduction)
45
+
46
+ ---
47
+
48
+ ## Code examples
49
+
50
+ ## You can check our Github repository to see code examples: [python examples](https://github.com/Retab-dev/retab/tree/main/examples) and [jupyter notebooks](https://github.com/Retab-dev/retab-nodejs/tree/main/notebooks).
51
+
52
+ ## Community
53
+
54
+ Let's create the future of document processing together!
55
+
56
+ Join our [discord community](https://discord.com/invite/vc5tWRPqag) to share tips, discuss best practices, and showcase what you build. Or just [tweet](https://x.com/retabdev) at us.
57
+
58
+ We can't wait to see how you'll use Retab.
59
+
60
+ * [Discord](https://discord.com/invite/vc5tWRPqag)
61
+ * [Twitter](https://x.com/retabdev)
62
+
63
+ ---
64
+
65
+ ## Roadmap
66
+
67
+ We share our roadmap publicly on [Github](https://github.com/Retab-dev/retab)
68
+
69
+ Among the features we're working on:
70
+
71
+ * [ ] Node.js SDK
72
+ * [ ] Low-level speed optimizations for Evals Frontend
73
+ * [ ] Schema optimization autopilot
74
+ * [ ] Sources API
75
+ * [ ] Parse API for RAG
76
+
@@ -34,7 +34,7 @@ class BaseRetab:
34
34
 
35
35
  Args:
36
36
  api_key (str, optional): Retab API key. If not provided, will look for RETAB_API_KEY env variable.
37
- base_url (str, optional): Base URL for API requests. Defaults to https://api.retab.dev
37
+ base_url (str, optional): Base URL for API requests. Defaults to https://api.retab.com
38
38
  timeout (float): Request timeout in seconds. Defaults to 240.0
39
39
  max_retries (int): Maximum number of retries for failed requests. Defaults to 3
40
40
  openai_api_key (str, optional): OpenAI API key. Will look for OPENAI_API_KEY env variable if not provided
@@ -63,12 +63,12 @@ class BaseRetab:
63
63
 
64
64
  if api_key is None:
65
65
  raise ValueError(
66
- "No API key provided. You can create an API key at https://retab.dev\n"
66
+ "No API key provided. You can create an API key at https://retab.com\n"
67
67
  "Then either pass it to the client (api_key='your-key') or set the RETAB_API_KEY environment variable"
68
68
  )
69
69
 
70
70
  if base_url is None:
71
- base_url = os.environ.get("RETAB_API_BASE_URL", "https://api.retab.dev")
71
+ base_url = os.environ.get("RETAB_API_BASE_URL", "https://api.retab.com")
72
72
 
73
73
  truststore.inject_into_ssl()
74
74
  self.api_key = api_key
@@ -154,7 +154,7 @@ class Retab(BaseRetab):
154
154
 
155
155
  Args:
156
156
  api_key (str, optional): Retab API key. If not provided, will look for RETAB_API_KEY env variable.
157
- base_url (str, optional): Base URL for API requests. Defaults to https://api.retab.dev
157
+ base_url (str, optional): Base URL for API requests. Defaults to https://api.retab.com
158
158
  timeout (float): Request timeout in seconds. Defaults to 240.0
159
159
  max_retries (int): Maximum number of retries for failed requests. Defaults to 3
160
160
  openai_api_key (str, optional): OpenAI API key. Will look for OPENAI_API_KEY env variable if not provided
@@ -422,7 +422,7 @@ class AsyncRetab(BaseRetab):
422
422
 
423
423
  Args:
424
424
  api_key (str, optional): Retab API key. If not provided, will look for RETAB_API_KEY env variable.
425
- base_url (str, optional): Base URL for API requests. Defaults to https://api.retab.dev
425
+ base_url (str, optional): Base URL for API requests. Defaults to https://api.retab.com
426
426
  timeout (float): Request timeout in seconds. Defaults to 240.0
427
427
  max_retries (int): Maximum number of retries for failed requests. Defaults to 3
428
428
  openai_api_key (str, optional): OpenAI API key. Will look for OPENAI_API_KEY env variable if not provided
@@ -123,7 +123,7 @@ class Completions(SyncAPIResource, BaseCompletionsMixin):
123
123
 
124
124
  Usage:
125
125
  ```python
126
- with retab.devpletions.stream(json_schema, messages, model, temperature, reasoning_effort) as stream:
126
+ with retab.completions.stream(json_schema, messages, model, temperature, reasoning_effort) as stream:
127
127
  for response in stream:
128
128
  print(response)
129
129
  ```
@@ -210,7 +210,7 @@ class AsyncCompletions(AsyncAPIResource, BaseCompletionsMixin):
210
210
 
211
211
  Usage:
212
212
  ```python
213
- async with retab.devpletions.stream(json_schema, messages, model, temperature, reasoning_effort, n_consensus) as stream:
213
+ async with retab.completions.stream(json_schema, messages, model, temperature, reasoning_effort, n_consensus) as stream:
214
214
  async for response in stream:
215
215
  print(response)
216
216
  ```
@@ -17,6 +17,7 @@ from ...types.documents.parse import ParseRequest, ParseResult, TableParsingForm
17
17
  from ...types.browser_canvas import BrowserCanvas
18
18
  from ...types.mime import MIMEData
19
19
  from ...types.modalities import Modality
20
+ from ...types.ai_models import LLMModel
20
21
  from ...types.schemas.object import Schema
21
22
  from ...types.standards import PreparedRequest
22
23
  from .extractions import AsyncExtractions, Extractions
@@ -89,7 +90,7 @@ class BaseDocumentsMixin:
89
90
  def _prepare_parse(
90
91
  self,
91
92
  document: Path | str | IOBase | MIMEData | PIL.Image.Image | HttpUrl,
92
- fast_mode: bool = False,
93
+ model: LLMModel,
93
94
  table_parsing_format: TableParsingFormat = "html",
94
95
  image_resolution_dpi: int = 72,
95
96
  browser_canvas: BrowserCanvas = "A4",
@@ -99,7 +100,7 @@ class BaseDocumentsMixin:
99
100
 
100
101
  parse_request = ParseRequest(
101
102
  document=mime_document,
102
- fast_mode=fast_mode,
103
+ model=model,
103
104
  table_parsing_format=table_parsing_format,
104
105
  image_resolution_dpi=image_resolution_dpi,
105
106
  browser_canvas=browser_canvas,
@@ -290,7 +291,7 @@ class Documents(SyncAPIResource, BaseDocumentsMixin):
290
291
  def parse(
291
292
  self,
292
293
  document: Path | str | IOBase | MIMEData | PIL.Image.Image | HttpUrl,
293
- fast_mode: bool = False,
294
+ model: LLMModel,
294
295
  table_parsing_format: TableParsingFormat = "html",
295
296
  image_resolution_dpi: int = 72,
296
297
  browser_canvas: BrowserCanvas = "A4",
@@ -304,7 +305,7 @@ class Documents(SyncAPIResource, BaseDocumentsMixin):
304
305
 
305
306
  Args:
306
307
  document: The document to parse. Can be a file path (Path or str), file-like object, MIMEData, PIL Image, or URL.
307
- fast_mode: Use fast mode for parsing (may reduce quality). Defaults to False.
308
+ model: The AI model to use for document parsing.
308
309
  table_parsing_format: Format for parsing tables. Options: "html", "json", "yaml", "markdown". Defaults to "html".
309
310
  image_resolution_dpi: DPI for image processing. Defaults to 72.
310
311
  browser_canvas: Canvas size for document rendering. Defaults to "A4".
@@ -318,7 +319,7 @@ class Documents(SyncAPIResource, BaseDocumentsMixin):
318
319
  """
319
320
  request = self._prepare_parse(
320
321
  document=document,
321
- fast_mode=fast_mode,
322
+ model=model,
322
323
  table_parsing_format=table_parsing_format,
323
324
  image_resolution_dpi=image_resolution_dpi,
324
325
  browser_canvas=browser_canvas,
@@ -512,7 +513,7 @@ class AsyncDocuments(AsyncAPIResource, BaseDocumentsMixin):
512
513
  async def parse(
513
514
  self,
514
515
  document: Path | str | IOBase | MIMEData | PIL.Image.Image | HttpUrl,
515
- fast_mode: bool = False,
516
+ model: LLMModel,
516
517
  table_parsing_format: TableParsingFormat = "html",
517
518
  image_resolution_dpi: int = 72,
518
519
  browser_canvas: BrowserCanvas = "A4",
@@ -526,7 +527,7 @@ class AsyncDocuments(AsyncAPIResource, BaseDocumentsMixin):
526
527
 
527
528
  Args:
528
529
  document: The document to parse. Can be a file path (Path or str), file-like object, MIMEData, PIL Image, or URL.
529
- fast_mode: Use fast mode for parsing (may reduce quality). Defaults to False.
530
+ model: The AI model to use for document parsing.
530
531
  table_parsing_format: Format for parsing tables. Options: "html", "json", "yaml", "markdown". Defaults to "html".
531
532
  image_resolution_dpi: DPI for image processing. Defaults to 72.
532
533
  browser_canvas: Canvas size for document rendering. Defaults to "A4".
@@ -540,7 +541,7 @@ class AsyncDocuments(AsyncAPIResource, BaseDocumentsMixin):
540
541
  """
541
542
  request = self._prepare_parse(
542
543
  document=document,
543
- fast_mode=fast_mode,
544
+ model=model,
544
545
  table_parsing_format=table_parsing_format,
545
546
  image_resolution_dpi=image_resolution_dpi,
546
547
  browser_canvas=browser_canvas,
@@ -31,6 +31,7 @@ class EndpointsMixin:
31
31
 
32
32
  def prepare_list(
33
33
  self,
34
+ processor_id: str,
34
35
  before: Optional[str] = None,
35
36
  after: Optional[str] = None,
36
37
  limit: Optional[int] = 10,
@@ -40,6 +41,7 @@ class EndpointsMixin:
40
41
  webhook_url: Optional[str] = None,
41
42
  ) -> PreparedRequest:
42
43
  params = {
44
+ "processor_id": processor_id,
43
45
  "before": before,
44
46
  "after": after,
45
47
  "limit": limit,
@@ -120,11 +122,12 @@ class Endpoints(SyncAPIResource, EndpointsMixin):
120
122
  need_validation=need_validation,
121
123
  )
122
124
  response = self._client._prepared_request(request)
123
- print(f"Endpoint Created. Url: https://www.retab.dev/dashboard/processors/automations/{response['id']}")
125
+ print(f"Endpoint Created. Url: https://www.retab.com/dashboard/processors/automations/{response['id']}")
124
126
  return Endpoint.model_validate(response)
125
127
 
126
128
  def list(
127
129
  self,
130
+ processor_id: str,
128
131
  before: Optional[str] = None,
129
132
  after: Optional[str] = None,
130
133
  limit: Optional[int] = 10,
@@ -145,7 +148,7 @@ class Endpoints(SyncAPIResource, EndpointsMixin):
145
148
  Returns:
146
149
  ListEndpoints: Paginated list of endpoint configurations with metadata
147
150
  """
148
- request = self.prepare_list(before, after, limit, order, name, webhook_url)
151
+ request = self.prepare_list(processor_id, before, after, limit, order, name, webhook_url)
149
152
  response = self._client._prepared_request(request)
150
153
  return ListEndpoints.model_validate(response)
151
154
 
@@ -229,12 +232,13 @@ class AsyncEndpoints(AsyncAPIResource, EndpointsMixin):
229
232
  need_validation=need_validation,
230
233
  )
231
234
  response = await self._client._prepared_request(request)
232
- print(f"Endpoint Created. Url: https://www.retab.dev/dashboard/processors/automations/{response['id']}")
235
+ print(f"Endpoint Created. Url: https://www.retab.com/dashboard/processors/automations/{response['id']}")
233
236
 
234
237
  return Endpoint.model_validate(response)
235
238
 
236
239
  async def list(
237
240
  self,
241
+ processor_id: str,
238
242
  before: Optional[str] = None,
239
243
  after: Optional[str] = None,
240
244
  limit: Optional[int] = 10,
@@ -242,7 +246,7 @@ class AsyncEndpoints(AsyncAPIResource, EndpointsMixin):
242
246
  name: Optional[str] = None,
243
247
  webhook_url: Optional[str] = None,
244
248
  ) -> ListEndpoints:
245
- request = self.prepare_list(before, after, limit, order, name, webhook_url)
249
+ request = self.prepare_list(processor_id, before, after, limit, order, name, webhook_url)
246
250
  response = await self._client._prepared_request(request)
247
251
  return ListEndpoints.model_validate(response)
248
252
 
@@ -128,7 +128,7 @@ class Links(SyncAPIResource, LinksMixin):
128
128
  )
129
129
  response = self._client._prepared_request(request)
130
130
 
131
- print(f"Link Created. Url: https://www.retab.dev/dashboard/processors/automations/{response['id']}")
131
+ print(f"Link Created. Url: https://www.retab.com/dashboard/processors/automations/{response['id']}")
132
132
  return Link.model_validate(response)
133
133
 
134
134
  def list(
@@ -248,7 +248,7 @@ class AsyncLinks(AsyncAPIResource, LinksMixin):
248
248
  password=password,
249
249
  )
250
250
  response = await self._client._prepared_request(request)
251
- print(f"Link Created. Url: https://www.retab.dev/dashboard/processors/automations/{response['id']}")
251
+ print(f"Link Created. Url: https://www.retab.com/dashboard/processors/automations/{response['id']}")
252
252
  return Link.model_validate(response)
253
253
 
254
254
  async def list(
@@ -147,7 +147,7 @@ class Logs(SyncAPIResource, LogsMixin):
147
147
  request = self.prepare_rerun(processor_id, log_id)
148
148
  response = self._client._prepared_request(request)
149
149
 
150
- print(f"Webhook call run successfully. Log available at https://www.retab.dev/dashboard/processors/{processor_id}/logs/{log_id}")
150
+ print(f"Webhook call run successfully. Log available at https://www.retab.com/dashboard/processors/{processor_id}/logs/{log_id}")
151
151
 
152
152
  return ExternalRequestLog.model_validate(response)
153
153
 
@@ -217,6 +217,6 @@ class AsyncLogs(AsyncAPIResource, LogsMixin):
217
217
  request = self.prepare_rerun(processor_id, log_id)
218
218
  response = await self._client._prepared_request(request)
219
219
 
220
- print(f"Webhook call run successfully. Log available at https://www.retab.dev/dashboard/processors/{processor_id}/logs/{log_id}")
220
+ print(f"Webhook call run successfully. Log available at https://www.retab.com/dashboard/processors/{processor_id}/logs/{log_id}")
221
221
 
222
222
  return ExternalRequestLog.model_validate(response)
@@ -43,6 +43,7 @@ class MailBoxesMixin:
43
43
 
44
44
  def prepare_list(
45
45
  self,
46
+ processor_id: str,
46
47
  before: str | None = None,
47
48
  after: str | None = None,
48
49
  limit: int = 10,
@@ -52,6 +53,7 @@ class MailBoxesMixin:
52
53
  webhook_url: Optional[str] = None,
53
54
  ) -> PreparedRequest:
54
55
  params = {
56
+ "processor_id": processor_id,
55
57
  "before": before,
56
58
  "after": after,
57
59
  "limit": limit,
@@ -65,15 +67,12 @@ class MailBoxesMixin:
65
67
 
66
68
  return PreparedRequest(method="GET", url=self.mailboxes_base_url, params=params)
67
69
 
68
- def prepare_get(self, email: str) -> PreparedRequest:
69
- return PreparedRequest(method="GET", url=f"{self.mailboxes_base_url}/{email}")
70
-
71
- def prepare_get_from_id(self, mailbox_id: str) -> PreparedRequest:
72
- return PreparedRequest(method="GET", url=f"{self.mailboxes_base_url}/from_id/{mailbox_id}")
70
+ def prepare_get(self, mailbox_id: str) -> PreparedRequest:
71
+ return PreparedRequest(method="GET", url=f"{self.mailboxes_base_url}/{mailbox_id}")
73
72
 
74
73
  def prepare_update(
75
74
  self,
76
- email: str,
75
+ mailbox_id: str,
77
76
  name: str = PydanticUndefined, # type: ignore[assignment]
78
77
  default_language: str = PydanticUndefined, # type: ignore[assignment]
79
78
  webhook_url: str = PydanticUndefined, # type: ignore[assignment]
@@ -91,10 +90,10 @@ class MailBoxesMixin:
91
90
  authorized_domains=authorized_domains,
92
91
  authorized_emails=authorized_emails,
93
92
  )
94
- return PreparedRequest(method="PUT", url=f"/v1/processors/automations/mailboxes/{email}", data=update_mailbox_request.model_dump(mode="json"))
93
+ return PreparedRequest(method="PUT", url=f"/v1/processors/automations/mailboxes/{mailbox_id}", data=update_mailbox_request.model_dump(mode="json"))
95
94
 
96
- def prepare_delete(self, email: str) -> PreparedRequest:
97
- return PreparedRequest(method="DELETE", url=f"/v1/processors/automations/mailboxes/{email}", raise_for_status=True)
95
+ def prepare_delete(self, mailbox_id: str) -> PreparedRequest:
96
+ return PreparedRequest(method="DELETE", url=f"/v1/processors/automations/mailboxes/{mailbox_id}", raise_for_status=True)
98
97
 
99
98
 
100
99
  class Mailboxes(SyncAPIResource, MailBoxesMixin):
@@ -144,12 +143,13 @@ class Mailboxes(SyncAPIResource, MailBoxesMixin):
144
143
  )
145
144
  response = self._client._prepared_request(request)
146
145
 
147
- print(f"Mailbox {response['email']} created. Url: https://www.retab.dev/dashboard/processors/automations/{response['id']}")
146
+ print(f"Mailbox {response['email']} created. Url: https://www.retab.com/dashboard/processors/automations/{response['id']}")
148
147
 
149
148
  return Mailbox.model_validate(response)
150
149
 
151
150
  def list(
152
151
  self,
152
+ processor_id: str,
153
153
  before: str | None = None,
154
154
  after: str | None = None,
155
155
  limit: int = 10,
@@ -174,6 +174,7 @@ class Mailboxes(SyncAPIResource, MailBoxesMixin):
174
174
  ListMailboxes: List of mailbox configurations
175
175
  """
176
176
  request = self.prepare_list(
177
+ processor_id=processor_id,
177
178
  before=before,
178
179
  after=after,
179
180
  limit=limit,
@@ -185,22 +186,22 @@ class Mailboxes(SyncAPIResource, MailBoxesMixin):
185
186
  response = self._client._prepared_request(request)
186
187
  return ListMailboxes.model_validate(response)
187
188
 
188
- def get(self, email: str) -> Mailbox:
189
+ def get(self, mailbox_id: str) -> Mailbox:
189
190
  """Get a specific email automation configuration.
190
191
 
191
192
  Args:
192
- email: Email address of the mailbox
193
+ mailbox_id: ID of the mailbox
193
194
 
194
195
  Returns:
195
196
  Mailbox: The mailbox configuration
196
197
  """
197
- request = self.prepare_get(email)
198
+ request = self.prepare_get(mailbox_id)
198
199
  response = self._client._prepared_request(request)
199
200
  return Mailbox.model_validate(response)
200
201
 
201
202
  def update(
202
203
  self,
203
- email: str,
204
+ mailbox_id: str,
204
205
  name: str = PydanticUndefined, # type: ignore[assignment]
205
206
  default_language: str = PydanticUndefined, # type: ignore[assignment]
206
207
  webhook_url: str = PydanticUndefined, # type: ignore[assignment]
@@ -225,7 +226,7 @@ class Mailboxes(SyncAPIResource, MailBoxesMixin):
225
226
  Mailbox: The updated mailbox configuration
226
227
  """
227
228
  request = self.prepare_update(
228
- email=email,
229
+ mailbox_id=mailbox_id,
229
230
  name=name,
230
231
  default_language=default_language,
231
232
  webhook_url=webhook_url,
@@ -237,13 +238,13 @@ class Mailboxes(SyncAPIResource, MailBoxesMixin):
237
238
  response = self._client._prepared_request(request)
238
239
  return Mailbox.model_validate(response)
239
240
 
240
- def delete(self, email: str) -> None:
241
+ def delete(self, mailbox_id: str) -> None:
241
242
  """Delete an email automation configuration.
242
243
 
243
244
  Args:
244
245
  email: Email address of the mailbox to delete
245
246
  """
246
- request = self.prepare_delete(email)
247
+ request = self.prepare_delete(mailbox_id)
247
248
  self._client._prepared_request(request)
248
249
  return None
249
250
 
@@ -278,12 +279,13 @@ class AsyncMailboxes(AsyncAPIResource, MailBoxesMixin):
278
279
  )
279
280
  response = await self._client._prepared_request(request)
280
281
 
281
- print(f"Mailbox {response['email']} created. Url: https://www.retab.dev/dashboard/processors/automations/{response['id']}")
282
+ print(f"Mailbox {response['email']} created. Url: https://www.retab.com/dashboard/processors/automations/{response['id']}")
282
283
 
283
284
  return Mailbox.model_validate(response)
284
285
 
285
286
  async def list(
286
287
  self,
288
+ processor_id: str,
287
289
  before: str | None = None,
288
290
  after: str | None = None,
289
291
  limit: int = 10,
@@ -292,18 +294,27 @@ class AsyncMailboxes(AsyncAPIResource, MailBoxesMixin):
292
294
  name: str | None = None,
293
295
  webhook_url: str | None = None,
294
296
  ) -> ListMailboxes:
295
- request = self.prepare_list(before=before, after=after, limit=limit, order=order, email=email, name=name, webhook_url=webhook_url)
297
+ request = self.prepare_list(
298
+ processor_id=processor_id,
299
+ before=before,
300
+ after=after,
301
+ limit=limit,
302
+ order=order,
303
+ email=email,
304
+ name=name,
305
+ webhook_url=webhook_url,
306
+ )
296
307
  response = await self._client._prepared_request(request)
297
308
  return ListMailboxes.model_validate(response)
298
309
 
299
- async def get(self, email: str) -> Mailbox:
300
- request = self.prepare_get(email)
310
+ async def get(self, mailbox_id: str) -> Mailbox:
311
+ request = self.prepare_get(mailbox_id)
301
312
  response = await self._client._prepared_request(request)
302
313
  return Mailbox.model_validate(response)
303
314
 
304
315
  async def update(
305
316
  self,
306
- email: str,
317
+ mailbox_id: str,
307
318
  name: str = PydanticUndefined, # type: ignore[assignment]
308
319
  default_language: str = PydanticUndefined, # type: ignore[assignment]
309
320
  webhook_url: str = PydanticUndefined, # type: ignore[assignment]
@@ -313,7 +324,7 @@ class AsyncMailboxes(AsyncAPIResource, MailBoxesMixin):
313
324
  authorized_emails: List[str] = PydanticUndefined, # type: ignore[assignment]
314
325
  ) -> Mailbox:
315
326
  request = self.prepare_update(
316
- email=email,
327
+ mailbox_id=mailbox_id,
317
328
  name=name,
318
329
  default_language=default_language,
319
330
  webhook_url=webhook_url,
@@ -325,8 +336,8 @@ class AsyncMailboxes(AsyncAPIResource, MailBoxesMixin):
325
336
  response = await self._client._prepared_request(request)
326
337
  return Mailbox.model_validate(response)
327
338
 
328
- async def delete(self, email: str) -> None:
329
- request = self.prepare_delete(email)
339
+ async def delete(self, mailbox_id: str) -> None:
340
+ request = self.prepare_delete(mailbox_id)
330
341
  await self._client._prepared_request(request)
331
342
  return None
332
343
 
@@ -334,12 +345,12 @@ class AsyncMailboxes(AsyncAPIResource, MailBoxesMixin):
334
345
  class TestMailboxesMixin:
335
346
  def prepare_forward(
336
347
  self,
337
- email: str,
348
+ mailbox_id: str,
338
349
  document: Path | str | IOBase | HttpUrl | MIMEData,
339
350
  verbose: bool = True,
340
351
  ) -> PreparedRequest:
341
352
  mime_document = prepare_mime_document(document)
342
- return PreparedRequest(method="POST", url=f"/v1/processors/automations/mailboxes/tests/forward/{email}", data={"document": mime_document.model_dump()})
353
+ return PreparedRequest(method="POST", url=f"/v1/processors/automations/mailboxes/tests/forward/{mailbox_id}", data={"document": mime_document.model_dump()})
343
354
 
344
355
  def print_forward_verbose(self, email_data: EmailData) -> None:
345
356
  print("\nTEST EMAIL FORWARDING RESULTS:")
@@ -360,7 +371,7 @@ class TestMailboxesMixin:
360
371
  class TestMailboxes(SyncAPIResource, TestMailboxesMixin):
361
372
  def forward(
362
373
  self,
363
- email: str,
374
+ mailbox_id: str,
364
375
  document: Path | str | IOBase | HttpUrl | MIMEData,
365
376
  verbose: bool = True,
366
377
  ) -> EmailData:
@@ -372,7 +383,7 @@ class TestMailboxes(SyncAPIResource, TestMailboxesMixin):
372
383
  Returns:
373
384
  DocumentExtractResponse: The simulated extraction response
374
385
  """
375
- request = self.prepare_forward(email, document, verbose)
386
+ request = self.prepare_forward(mailbox_id, document, verbose)
376
387
  response = self._client._prepared_request(request)
377
388
 
378
389
  email_data = EmailData.model_validate(response)
@@ -385,11 +396,11 @@ class TestMailboxes(SyncAPIResource, TestMailboxesMixin):
385
396
  class AsyncTestMailboxes(AsyncAPIResource, TestMailboxesMixin):
386
397
  async def forward(
387
398
  self,
388
- email: str,
399
+ mailbox_id: str,
389
400
  document: Path | str | IOBase | HttpUrl | MIMEData,
390
401
  verbose: bool = True,
391
402
  ) -> EmailData:
392
- request = self.prepare_forward(email, document, verbose)
403
+ request = self.prepare_forward(mailbox_id, document, verbose)
393
404
  response = await self._client._prepared_request(request)
394
405
  email_data = EmailData.model_validate(response)
395
406
  if verbose: