byteit 0.1.0__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.
- byteit-0.1.0/LICENSE +201 -0
- byteit-0.1.0/MANIFEST.in +5 -0
- byteit-0.1.0/PKG-INFO +424 -0
- byteit-0.1.0/README.md +387 -0
- byteit-0.1.0/byteit/ByteITClient.py +382 -0
- byteit-0.1.0/byteit/__init__.py +51 -0
- byteit-0.1.0/byteit/connectors/LocalFileInputConnector.py +63 -0
- byteit-0.1.0/byteit/connectors/LocalFileOutputConnector.py +25 -0
- byteit-0.1.0/byteit/connectors/S3InputConnector.py +82 -0
- byteit-0.1.0/byteit/connectors/S3OutputConnector.py +53 -0
- byteit-0.1.0/byteit/connectors/__init__.py +26 -0
- byteit-0.1.0/byteit/connectors/base.py +57 -0
- byteit-0.1.0/byteit/exceptions.py +107 -0
- byteit-0.1.0/byteit/models/DocumentMetadata.py +25 -0
- byteit-0.1.0/byteit/models/Job.py +153 -0
- byteit-0.1.0/byteit/models/JobList.py +21 -0
- byteit-0.1.0/byteit/models/OutputFormat.py +16 -0
- byteit-0.1.0/byteit/models/ProcessingOptions.py +96 -0
- byteit-0.1.0/byteit/validations.py +42 -0
- byteit-0.1.0/byteit.egg-info/PKG-INFO +424 -0
- byteit-0.1.0/byteit.egg-info/SOURCES.txt +31 -0
- byteit-0.1.0/byteit.egg-info/dependency_links.txt +1 -0
- byteit-0.1.0/byteit.egg-info/requires.txt +9 -0
- byteit-0.1.0/byteit.egg-info/top_level.txt +1 -0
- byteit-0.1.0/pyproject.toml +91 -0
- byteit-0.1.0/setup.cfg +4 -0
- byteit-0.1.0/setup.py +8 -0
- byteit-0.1.0/tests/__init__.py +1 -0
- byteit-0.1.0/tests/test_client.py +400 -0
- byteit-0.1.0/tests/test_connectors.py +128 -0
- byteit-0.1.0/tests/test_exceptions.py +116 -0
- byteit-0.1.0/tests/test_integration.py +100 -0
- byteit-0.1.0/tests/test_models.py +140 -0
byteit-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 ByteIT GmbH
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
byteit-0.1.0/MANIFEST.in
ADDED
byteit-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: byteit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AI-powered document intelligence platform - Turn your data into structured data with a single line of code.
|
|
5
|
+
Author-email: ByteIT GmbH <support@byteit.ai>
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://byteit.ai
|
|
8
|
+
Project-URL: Repository, https://github.com/byteit-ai/byteit-api
|
|
9
|
+
Project-URL: Pricing, https://byteit.ai/pricing
|
|
10
|
+
Project-URL: Support, https://byteit.ai/support
|
|
11
|
+
Project-URL: Contact, https://byteit.ai/contact
|
|
12
|
+
Keywords: document-processing,ai,document-intelligence,pdf,data-extraction,machine-learning,ocr
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Topic :: Office/Business
|
|
26
|
+
Requires-Python: >=3.8
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
Requires-Dist: requests>=2.28.0
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
32
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
33
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
34
|
+
Requires-Dist: isort>=5.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: flake8>=6.0.0; extra == "dev"
|
|
36
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
37
|
+
|
|
38
|
+
# ByteIT API Library
|
|
39
|
+
|
|
40
|
+
**Turn your data into AI - Transform documents into structured data with a single line of code.**
|
|
41
|
+
|
|
42
|
+
ByteIT is an AI-powered document intelligence platform that extracts clean, structured data from PDFs, Word, Excel, and many other file formats. This Python SDK provides a simple, developer-first interface to ByteIT's advanced document processing capabilities.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Why ByteIT?
|
|
47
|
+
|
|
48
|
+
- **Lightning Fast** - Process documents in under 2 seconds
|
|
49
|
+
- **AI-Powered** - Advanced ML models trained on millions of documents
|
|
50
|
+
- **Simple API** - Parse documents in one line: `client.parse("document.pdf")`
|
|
51
|
+
- **Developer First** - Clean code, full type hints, comprehensive SDKs
|
|
52
|
+
- **Enterprise Security** - End-to-end encryption and GDPR compliance
|
|
53
|
+
- **Smart Extraction** - Extract text, tables, forms, and structured data with AI precision
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Quick Start
|
|
58
|
+
|
|
59
|
+
### Installation
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install byteit
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Basic Usage
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
from byteit import ByteITClient
|
|
69
|
+
|
|
70
|
+
# Initialize client
|
|
71
|
+
client = ByteITClient(api_key="your_api_key")
|
|
72
|
+
|
|
73
|
+
# Parse a document
|
|
74
|
+
result = client.parse("invoice.pdf")
|
|
75
|
+
print(result.decode())
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
That's it. Your document is now structured text.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Features
|
|
83
|
+
|
|
84
|
+
### Parse Any Document
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
# Local files
|
|
88
|
+
result = client.parse("contract.pdf")
|
|
89
|
+
|
|
90
|
+
# Different formats
|
|
91
|
+
txt_result = client.parse("doc.pdf", output_format="txt")
|
|
92
|
+
json_result = client.parse("doc.pdf", output_format="json")
|
|
93
|
+
md_result = client.parse("doc.pdf", output_format="md")
|
|
94
|
+
html_result = client.parse("doc.pdf", output_format="html")
|
|
95
|
+
|
|
96
|
+
# Save to file
|
|
97
|
+
client.parse("doc.pdf", output="result.txt")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### S3 Integration
|
|
101
|
+
|
|
102
|
+
Process files directly from S3 without downloading - perfect for high-volume workflows:
|
|
103
|
+
|
|
104
|
+
```python
|
|
105
|
+
from byteit.connectors import S3InputConnector
|
|
106
|
+
|
|
107
|
+
# Parse from S3
|
|
108
|
+
result = client.parse(
|
|
109
|
+
S3InputConnector(
|
|
110
|
+
source_bucket="my-documents",
|
|
111
|
+
source_path_inside_bucket="invoices/jan-2024.pdf"
|
|
112
|
+
)
|
|
113
|
+
)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Job Management
|
|
117
|
+
|
|
118
|
+
Track and retrieve processing jobs:
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
# List all jobs
|
|
122
|
+
jobs = client.get_all_jobs()
|
|
123
|
+
for job in jobs:
|
|
124
|
+
print(f"{job.id}: {job.processing_status}")
|
|
125
|
+
|
|
126
|
+
# Get specific job
|
|
127
|
+
job = client.get_job_by_id("job_123")
|
|
128
|
+
|
|
129
|
+
# Download result later
|
|
130
|
+
if job.is_completed:
|
|
131
|
+
result = client.get_result(job.id)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### Context Manager
|
|
135
|
+
|
|
136
|
+
Automatic resource cleanup:
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
with ByteITClient(api_key="your_key") as client:
|
|
140
|
+
result = client.parse("document.pdf")
|
|
141
|
+
# Session automatically closed
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## API Reference
|
|
147
|
+
|
|
148
|
+
### ByteITClient
|
|
149
|
+
|
|
150
|
+
**`ByteITClient(api_key: str)`**
|
|
151
|
+
|
|
152
|
+
Initialize the ByteIT client.
|
|
153
|
+
|
|
154
|
+
**Parameters:**
|
|
155
|
+
- `api_key` (str): Your ByteIT API key
|
|
156
|
+
|
|
157
|
+
**Methods:**
|
|
158
|
+
|
|
159
|
+
#### `parse(input, output_format="txt", output=None)`
|
|
160
|
+
|
|
161
|
+
Parse a document and return the result.
|
|
162
|
+
|
|
163
|
+
**Parameters:**
|
|
164
|
+
- `input` (str | Path | InputConnector): File to parse
|
|
165
|
+
- `str` or `Path`: Local file path
|
|
166
|
+
- `S3InputConnector`: For S3 files
|
|
167
|
+
- `output_format` (str): Output format - "txt", "json", "md", or "html" (default: "txt")
|
|
168
|
+
- `output` (str | Path | None): Optional file path to save result
|
|
169
|
+
|
|
170
|
+
**Returns:** `bytes` - Parsed content
|
|
171
|
+
|
|
172
|
+
**Example:**
|
|
173
|
+
```python
|
|
174
|
+
result = client.parse("doc.pdf", output_format="json")
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
#### `get_all_jobs()`
|
|
178
|
+
|
|
179
|
+
Get all jobs for your account.
|
|
180
|
+
|
|
181
|
+
**Returns:** `List[Job]` - List of Job objects
|
|
182
|
+
|
|
183
|
+
#### `get_job_by_id(job_id: str)`
|
|
184
|
+
|
|
185
|
+
Get a specific job by ID.
|
|
186
|
+
|
|
187
|
+
**Parameters:**
|
|
188
|
+
- `job_id` (str): The job ID
|
|
189
|
+
|
|
190
|
+
**Returns:** `Job` - Job object
|
|
191
|
+
|
|
192
|
+
#### `get_result(job_id: str)`
|
|
193
|
+
|
|
194
|
+
Download result for a completed job.
|
|
195
|
+
|
|
196
|
+
**Parameters:**
|
|
197
|
+
- `job_id` (str): The job ID
|
|
198
|
+
|
|
199
|
+
**Returns:** `bytes` - Result content
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## Connectors
|
|
204
|
+
|
|
205
|
+
### LocalFileInputConnector
|
|
206
|
+
|
|
207
|
+
Read files from local filesystem.
|
|
208
|
+
|
|
209
|
+
```python
|
|
210
|
+
from byteit.connectors import LocalFileInputConnector
|
|
211
|
+
|
|
212
|
+
connector = LocalFileInputConnector("path/to/file.pdf")
|
|
213
|
+
result = client.parse(connector)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### S3InputConnector
|
|
217
|
+
|
|
218
|
+
Read files from Amazon S3 using IAM role authentication - files never pass through your machine.
|
|
219
|
+
|
|
220
|
+
**Prerequisites:**
|
|
221
|
+
1. Contact [ByteIT support](https://byteit.ai/contact) to set up AWS connection
|
|
222
|
+
2. Provide IAM role ARN for ByteIT to assume
|
|
223
|
+
3. Grant role read access to your bucket
|
|
224
|
+
|
|
225
|
+
```python
|
|
226
|
+
from byteit.connectors import S3InputConnector
|
|
227
|
+
|
|
228
|
+
connector = S3InputConnector(
|
|
229
|
+
source_bucket="my-bucket",
|
|
230
|
+
source_path_inside_bucket="documents/file.pdf"
|
|
231
|
+
)
|
|
232
|
+
result = client.parse(connector)
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Error Handling
|
|
238
|
+
|
|
239
|
+
ByteIT SDK provides specific exceptions for different error scenarios:
|
|
240
|
+
|
|
241
|
+
```python
|
|
242
|
+
from byteit.exceptions import (
|
|
243
|
+
APIKeyError, # Invalid API key
|
|
244
|
+
AuthenticationError, # Authentication failed
|
|
245
|
+
ValidationError, # Invalid parameters
|
|
246
|
+
ResourceNotFoundError, # Job/resource not found
|
|
247
|
+
RateLimitError, # Rate limit exceeded
|
|
248
|
+
ServerError, # Server-side error (5xx)
|
|
249
|
+
JobProcessingError, # Job processing failed
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
try:
|
|
253
|
+
result = client.parse("document.pdf")
|
|
254
|
+
except ValidationError as e:
|
|
255
|
+
print(f"Invalid input: {e.message}")
|
|
256
|
+
except RateLimitError:
|
|
257
|
+
print("Rate limit exceeded - please wait")
|
|
258
|
+
except JobProcessingError as e:
|
|
259
|
+
print(f"Processing failed: {e.message}")
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
All exceptions inherit from `ByteITError`:
|
|
263
|
+
|
|
264
|
+
```python
|
|
265
|
+
from byteit.exceptions import ByteITError
|
|
266
|
+
|
|
267
|
+
try:
|
|
268
|
+
result = client.parse("document.pdf")
|
|
269
|
+
except ByteITError as e:
|
|
270
|
+
print(f"ByteIT error: {e.message}")
|
|
271
|
+
print(f"Status code: {e.status_code}")
|
|
272
|
+
print(f"Response: {e.response}")
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
---
|
|
276
|
+
|
|
277
|
+
## Advanced Usage
|
|
278
|
+
|
|
279
|
+
### Batch Processing
|
|
280
|
+
|
|
281
|
+
Process multiple files efficiently:
|
|
282
|
+
|
|
283
|
+
```python
|
|
284
|
+
files = ["doc1.pdf", "doc2.pdf", "doc3.pdf"]
|
|
285
|
+
results = []
|
|
286
|
+
|
|
287
|
+
for file in files:
|
|
288
|
+
result = client.parse(file, output_format="json")
|
|
289
|
+
results.append(result)
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
### Custom Output Paths
|
|
293
|
+
|
|
294
|
+
Organize results systematically:
|
|
295
|
+
|
|
296
|
+
```python
|
|
297
|
+
from pathlib import Path
|
|
298
|
+
|
|
299
|
+
input_dir = Path("inputs")
|
|
300
|
+
output_dir = Path("outputs")
|
|
301
|
+
output_dir.mkdir(exist_ok=True)
|
|
302
|
+
|
|
303
|
+
for pdf_file in input_dir.glob("*.pdf"):
|
|
304
|
+
output_file = output_dir / f"{pdf_file.stem}.txt"
|
|
305
|
+
client.parse(pdf_file, output=output_file)
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### S3 Workflow
|
|
309
|
+
|
|
310
|
+
High-volume cloud processing:
|
|
311
|
+
|
|
312
|
+
```python
|
|
313
|
+
from byteit.connectors import S3InputConnector
|
|
314
|
+
|
|
315
|
+
# Process multiple S3 files
|
|
316
|
+
s3_files = [
|
|
317
|
+
"invoices/2024-01.pdf",
|
|
318
|
+
"invoices/2024-02.pdf",
|
|
319
|
+
"invoices/2024-03.pdf",
|
|
320
|
+
]
|
|
321
|
+
|
|
322
|
+
for s3_path in s3_files:
|
|
323
|
+
connector = S3InputConnector(
|
|
324
|
+
source_bucket="my-documents",
|
|
325
|
+
source_path_inside_bucket=s3_path
|
|
326
|
+
)
|
|
327
|
+
result = client.parse(connector, output_format="json")
|
|
328
|
+
# Process result...
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
---
|
|
332
|
+
|
|
333
|
+
## Configuration
|
|
334
|
+
|
|
335
|
+
### Environment Variables
|
|
336
|
+
|
|
337
|
+
Set your API key via environment variable:
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
export BYTEIT_API_KEY="your_api_key_here"
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
```python
|
|
344
|
+
import os
|
|
345
|
+
from byteit import ByteITClient
|
|
346
|
+
|
|
347
|
+
client = ByteITClient(api_key=os.getenv("BYTEIT_API_KEY"))
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
### Custom Base URL
|
|
351
|
+
|
|
352
|
+
For testing or custom deployments:
|
|
353
|
+
|
|
354
|
+
```python
|
|
355
|
+
from byteit import ByteITClient
|
|
356
|
+
|
|
357
|
+
# Set custom URL (for development/testing)
|
|
358
|
+
ByteITClient.BASE_URL = "http://localhost:8000"
|
|
359
|
+
client = ByteITClient(api_key="test_key")
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
364
|
+
## Testing
|
|
365
|
+
|
|
366
|
+
The SDK includes comprehensive unit and integration tests.
|
|
367
|
+
|
|
368
|
+
### Run Unit Tests
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
pytest
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
### Run Integration Tests
|
|
375
|
+
|
|
376
|
+
Integration tests require a running ByteIT API and valid API key:
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
export BYTEIT_API_KEY="your_api_key"
|
|
380
|
+
pytest -m integration
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Run All Tests
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
pytest -m ""
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
## Requirements
|
|
392
|
+
|
|
393
|
+
- Python 3.8+
|
|
394
|
+
- `requests` library
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## About ByteIT
|
|
399
|
+
|
|
400
|
+
ByteIT transforms unstructured documents into clean, structured data with AI-powered precision. Built for scale, designed for developers.
|
|
401
|
+
|
|
402
|
+
**Get started today:** [Start Processing Free](https://byteit.ai/pricing) - 1,000 free pages/month
|
|
403
|
+
|
|
404
|
+
---
|
|
405
|
+
|
|
406
|
+
## Support & Resources
|
|
407
|
+
|
|
408
|
+
- **Website:** [https://byteit.ai](https://byteit.ai)
|
|
409
|
+
- **Pricing:** [https://byteit.ai/pricing](https://byteit.ai/pricing)
|
|
410
|
+
- **Support:** [https://byteit.ai/support](https://byteit.ai/support)
|
|
411
|
+
- **Contact:** [https://byteit.ai/contact](https://byteit.ai/contact)
|
|
412
|
+
- **LinkedIn:** [ByteIT on LinkedIn](https://www.linkedin.com/company/byteit-ai)
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Legal
|
|
417
|
+
|
|
418
|
+
© 2026 ByteIT GmbH. All rights reserved.
|
|
419
|
+
|
|
420
|
+
- **Privacy Policy:** [https://byteit.ai/privacy-policy](https://byteit.ai/privacy-policy)
|
|
421
|
+
- **Terms of Service:** [https://byteit.ai/terms](https://byteit.ai/terms)
|
|
422
|
+
- **Impressum:** [https://byteit.ai/impressum](https://byteit.ai/impressum)
|
|
423
|
+
|
|
424
|
+
This project is licensed under the terms specified in the [LICENSE](LICENSE) file.
|