stract-api 0.1.0__py3-none-any.whl

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 (61) hide show
  1. stract_api/__init__.py +141 -0
  2. stract_api/api/__init__.py +16 -0
  3. stract_api/api/account_api.py +1098 -0
  4. stract_api/api/account_credit_ledger_api.py +286 -0
  5. stract_api/api/api_key_api.py +286 -0
  6. stract_api/api/catalog_api.py +837 -0
  7. stract_api/api/credits_api.py +534 -0
  8. stract_api/api/document_api.py +2799 -0
  9. stract_api/api/field_api.py +1168 -0
  10. stract_api/api/job_api.py +2857 -0
  11. stract_api/api/job_document_api.py +575 -0
  12. stract_api/api/llm_model_api.py +286 -0
  13. stract_api/api/struct_api.py +837 -0
  14. stract_api/api/user_api.py +572 -0
  15. stract_api/api_client.py +866 -0
  16. stract_api/api_response.py +21 -0
  17. stract_api/configuration.py +655 -0
  18. stract_api/exceptions.py +219 -0
  19. stract_api/models/__init__.py +52 -0
  20. stract_api/models/account.py +130 -0
  21. stract_api/models/account_credit_cache.py +112 -0
  22. stract_api/models/account_credit_ledger.py +125 -0
  23. stract_api/models/account_user.py +104 -0
  24. stract_api/models/account_user_role.py +38 -0
  25. stract_api/models/api_key.py +102 -0
  26. stract_api/models/catalog.py +100 -0
  27. stract_api/models/create_account_user_request.py +97 -0
  28. stract_api/models/create_catalog_request.py +90 -0
  29. stract_api/models/create_field_request.py +102 -0
  30. stract_api/models/create_job_request.py +109 -0
  31. stract_api/models/create_struct_request.py +90 -0
  32. stract_api/models/deleted_document.py +91 -0
  33. stract_api/models/deleted_field.py +91 -0
  34. stract_api/models/document.py +107 -0
  35. stract_api/models/document_link.py +90 -0
  36. stract_api/models/document_processing_status.py +39 -0
  37. stract_api/models/document_text.py +95 -0
  38. stract_api/models/edit_account_request.py +90 -0
  39. stract_api/models/edit_field_request.py +102 -0
  40. stract_api/models/edit_my_user_request.py +92 -0
  41. stract_api/models/field_type.py +42 -0
  42. stract_api/models/job.py +129 -0
  43. stract_api/models/job_document.py +123 -0
  44. stract_api/models/job_output.py +98 -0
  45. stract_api/models/job_output_record.py +103 -0
  46. stract_api/models/job_status.py +41 -0
  47. stract_api/models/llm_model.py +126 -0
  48. stract_api/models/login_request.py +92 -0
  49. stract_api/models/login_response.py +90 -0
  50. stract_api/models/model_field.py +110 -0
  51. stract_api/models/struct.py +100 -0
  52. stract_api/models/sync_text_job_request.py +118 -0
  53. stract_api/models/upload_text_document_request.py +93 -0
  54. stract_api/models/user.py +102 -0
  55. stract_api/py.typed +0 -0
  56. stract_api/rest.py +335 -0
  57. stract_api-0.1.0.dist-info/METADATA +266 -0
  58. stract_api-0.1.0.dist-info/RECORD +61 -0
  59. stract_api-0.1.0.dist-info/WHEEL +5 -0
  60. stract_api-0.1.0.dist-info/licenses/LICENSE +21 -0
  61. stract_api-0.1.0.dist-info/top_level.txt +1 -0
stract_api/rest.py ADDED
@@ -0,0 +1,335 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Stract API
5
+
6
+ Get structured output from unstructured inputs ## Machine authentication Programmatic access to the API is authenticated with an API key. Include the API key in every request as a bearer token in the `authorization` header: ``` authorization: bearer [apiKey] ``` ## SDKs Official SDKs are available for the following languages: - **Node (JavaScript / TypeScript)**: [`stract-api` on npm](https://www.npmjs.com/package/stract-api) - **Java (17+)**: [`com.stract-api:stract-api` on Maven Central](https://central.sonatype.com/artifact/com.stract-api/stract-api)
7
+
8
+ The version of the OpenAPI document: 0.9.4
9
+ Contact: matt@stract-api.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ import ipaddress
17
+ import io
18
+ import json
19
+ import re
20
+ import ssl
21
+ from urllib.parse import urlparse
22
+
23
+ import urllib3
24
+
25
+ from stract_api.exceptions import ApiException, ApiValueError
26
+
27
+ SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"}
28
+ RESTResponseType = urllib3.HTTPResponse
29
+
30
+
31
+ def is_socks_proxy_url(url):
32
+ if url is None:
33
+ return False
34
+ split_section = url.split("://")
35
+ if len(split_section) < 2:
36
+ return False
37
+ else:
38
+ return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES
39
+
40
+ def contenttype_matches(contenttype, maintype, subtype):
41
+ """Matches the given contenttype against the given type and subtype
42
+
43
+ :param contenttype: the content type to match
44
+ :param maintype: the expected maintype
45
+ :param subtype: the expected subtype
46
+ :return: `true` when the given content type matches the given type and subtype,
47
+ regardless of the presence of mime type parameters, otherwise returns `false`.
48
+ :rtype: bool
49
+ """
50
+ pattern = '{type}/(?:[^+;]+\\+)?{subtype}(?:[ \t]*;.*)?'.format(
51
+ type = re.escape(maintype),
52
+ subtype = re.escape(subtype),
53
+ )
54
+ return re.fullmatch(pattern, contenttype, re.IGNORECASE) is not None
55
+
56
+ def should_bypass_proxies(url: str, no_proxy: str) -> bool:
57
+ """Return whether ``url`` matches the comma-separated ``no_proxy`` rules."""
58
+ parsed_url = urlparse(url)
59
+ if not parsed_url.hostname:
60
+ return True
61
+
62
+ host = parsed_url.hostname.lower()
63
+ host_and_port = parsed_url.netloc.lower()
64
+ try:
65
+ host_ip = ipaddress.ip_address(host)
66
+ except ValueError:
67
+ host_ip = None
68
+
69
+ for entry in (entry.strip().lower() for entry in no_proxy.split(',')):
70
+ if not entry:
71
+ continue
72
+ if entry == '*':
73
+ return True
74
+
75
+ if host_ip is not None:
76
+ try:
77
+ if host_ip in ipaddress.ip_network(entry, strict=False):
78
+ return True
79
+ except ValueError:
80
+ pass
81
+
82
+ entry = entry.lstrip('.')
83
+ if (
84
+ host == entry
85
+ or host.endswith('.' + entry)
86
+ or host_and_port == entry
87
+ or host_and_port.endswith('.' + entry)
88
+ ):
89
+ return True
90
+
91
+ return False
92
+
93
+
94
+ class RESTResponse(io.IOBase):
95
+
96
+ def __init__(self, resp) -> None:
97
+ self.response = resp
98
+ self.status = resp.status
99
+ self.reason = resp.reason
100
+ self.data = None
101
+
102
+ def read(self):
103
+ if self.data is None:
104
+ self.data = self.response.data
105
+ return self.data
106
+
107
+ @property
108
+ def headers(self):
109
+ """Returns a dictionary of response headers."""
110
+ return self.response.headers
111
+
112
+ def getheaders(self):
113
+ """Returns a dictionary of the response headers; use ``headers`` instead."""
114
+ return self.response.headers
115
+
116
+ def getheader(self, name, default=None):
117
+ """Returns a given response header; use ``headers.get()`` instead."""
118
+ return self.response.headers.get(name, default)
119
+
120
+
121
+ class RESTClientObject:
122
+
123
+ def __init__(self, configuration) -> None:
124
+ # urllib3.PoolManager will pass all kw parameters to connectionpool
125
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
126
+ # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
127
+ # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
128
+
129
+ # cert_reqs
130
+ if configuration.verify_ssl:
131
+ cert_reqs = ssl.CERT_REQUIRED
132
+ else:
133
+ cert_reqs = ssl.CERT_NONE
134
+
135
+ pool_args = {
136
+ "cert_reqs": cert_reqs,
137
+ "ca_certs": configuration.ssl_ca_cert,
138
+ "cert_file": configuration.cert_file,
139
+ "key_file": configuration.key_file,
140
+ "ca_cert_data": configuration.ca_cert_data,
141
+ }
142
+ if configuration.assert_hostname is not None:
143
+ pool_args['assert_hostname'] = (
144
+ configuration.assert_hostname
145
+ )
146
+
147
+ if configuration.retries is not None:
148
+ pool_args['retries'] = configuration.retries
149
+
150
+ if configuration.tls_server_name:
151
+ pool_args['server_hostname'] = configuration.tls_server_name
152
+
153
+
154
+ if configuration.socket_options is not None:
155
+ pool_args['socket_options'] = configuration.socket_options
156
+
157
+ if configuration.connection_pool_maxsize is not None:
158
+ pool_args['maxsize'] = configuration.connection_pool_maxsize
159
+
160
+ # https pool manager
161
+ self.pool_manager: urllib3.PoolManager
162
+
163
+ if configuration.proxy and not should_bypass_proxies(
164
+ configuration.host, configuration.no_proxy or ''
165
+ ):
166
+ if is_socks_proxy_url(configuration.proxy):
167
+ from urllib3.contrib.socks import SOCKSProxyManager
168
+ pool_args["proxy_url"] = configuration.proxy
169
+ pool_args["headers"] = configuration.proxy_headers
170
+ self.pool_manager = SOCKSProxyManager(**pool_args)
171
+ else:
172
+ pool_args["proxy_url"] = configuration.proxy
173
+ pool_args["proxy_headers"] = configuration.proxy_headers
174
+ if configuration.proxy_ssl_context is not None:
175
+ pool_args["proxy_ssl_context"] = configuration.proxy_ssl_context
176
+ self.pool_manager = urllib3.ProxyManager(**pool_args)
177
+ else:
178
+ self.pool_manager = urllib3.PoolManager(**pool_args)
179
+
180
+ def request(
181
+ self,
182
+ method,
183
+ url,
184
+ headers=None,
185
+ body=None,
186
+ post_params=None,
187
+ _request_timeout=None
188
+ ):
189
+ """Perform requests.
190
+
191
+ :param method: http request method
192
+ :param url: http request url
193
+ :param headers: http request headers
194
+ :param body: request json body, for `application/json`
195
+ :param post_params: request post parameters,
196
+ `application/x-www-form-urlencoded`
197
+ and `multipart/form-data`
198
+ :param _request_timeout: timeout setting for this request. If one
199
+ number provided, it will be total request
200
+ timeout. It can also be a pair (tuple) of
201
+ (connection, read) timeouts.
202
+ """
203
+ method = method.upper()
204
+ assert method in [
205
+ 'GET',
206
+ 'HEAD',
207
+ 'DELETE',
208
+ 'POST',
209
+ 'PUT',
210
+ 'PATCH',
211
+ 'OPTIONS'
212
+ ]
213
+
214
+ if post_params and body:
215
+ raise ApiValueError(
216
+ "body parameter cannot be used with post_params parameter."
217
+ )
218
+
219
+ post_params = post_params or {}
220
+ headers = urllib3.HTTPHeaderDict(headers or {})
221
+
222
+ timeout = None
223
+ if _request_timeout:
224
+ if isinstance(_request_timeout, (int, float)):
225
+ timeout = urllib3.Timeout(total=_request_timeout)
226
+ elif (
227
+ isinstance(_request_timeout, tuple)
228
+ and len(_request_timeout) == 2
229
+ ):
230
+ timeout = urllib3.Timeout(
231
+ connect=_request_timeout[0],
232
+ read=_request_timeout[1]
233
+ )
234
+
235
+ try:
236
+ # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
237
+ if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
238
+
239
+ content_type = headers.get('Content-Type')
240
+ is_json = (
241
+ not content_type
242
+ or contenttype_matches(content_type, 'application', 'json')
243
+ )
244
+ # JSON is valid YAML 1.2, so structured YAML bodies can use
245
+ # the existing JSON serializer:
246
+ # https://yaml.org/spec/1.2.2/#13-relation-to-json
247
+ is_structured_yaml = (
248
+ content_type
249
+ and (
250
+ contenttype_matches(content_type, 'application', 'yaml')
251
+ or contenttype_matches(content_type, 'text', 'yaml')
252
+ or contenttype_matches(content_type, 'text', 'x-yaml')
253
+ )
254
+ and not isinstance(body, (str, bytes))
255
+ )
256
+ if is_json or is_structured_yaml:
257
+ request_body = None
258
+ if body is not None:
259
+ request_body = json.dumps(body)
260
+ r = self.pool_manager.request(
261
+ method,
262
+ url,
263
+ body=request_body,
264
+ timeout=timeout,
265
+ headers=headers,
266
+ preload_content=False
267
+ )
268
+ elif contenttype_matches(content_type, 'application', 'x-www-form-urlencoded'):
269
+ r = self.pool_manager.request(
270
+ method,
271
+ url,
272
+ fields=post_params,
273
+ encode_multipart=False,
274
+ timeout=timeout,
275
+ headers=headers,
276
+ preload_content=False
277
+ )
278
+ elif contenttype_matches(content_type, 'multipart', 'form-data'):
279
+ # must del headers['Content-Type'], or the correct
280
+ # Content-Type which generated by urllib3 will be
281
+ # overwritten.
282
+ del headers['Content-Type']
283
+ # Ensures that dict objects are serialized
284
+ post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params]
285
+ r = self.pool_manager.request(
286
+ method,
287
+ url,
288
+ fields=post_params,
289
+ encode_multipart=True,
290
+ timeout=timeout,
291
+ headers=headers,
292
+ preload_content=False
293
+ )
294
+ # Pass a `string` parameter directly in the body to support
295
+ # other content types than JSON when `body` argument is
296
+ # provided in serialized form.
297
+ elif isinstance(body, str) or isinstance(body, bytes):
298
+ r = self.pool_manager.request(
299
+ method,
300
+ url,
301
+ body=body,
302
+ timeout=timeout,
303
+ headers=headers,
304
+ preload_content=False
305
+ )
306
+ elif content_type.startswith('text/') and isinstance(body, bool):
307
+ request_body = "true" if body else "false"
308
+ r = self.pool_manager.request(
309
+ method,
310
+ url,
311
+ body=request_body,
312
+ preload_content=False,
313
+ timeout=timeout,
314
+ headers=headers)
315
+ else:
316
+ # Cannot generate the request from given parameters
317
+ msg = """Cannot prepare a request message for provided
318
+ arguments. Please check that your arguments match
319
+ declared content type."""
320
+ raise ApiException(status=0, reason=msg)
321
+ # For `GET`, `HEAD`
322
+ else:
323
+ r = self.pool_manager.request(
324
+ method,
325
+ url,
326
+ fields={},
327
+ timeout=timeout,
328
+ headers=headers,
329
+ preload_content=False
330
+ )
331
+ except urllib3.exceptions.SSLError as e:
332
+ msg = "\n".join([type(e).__name__, str(e)])
333
+ raise ApiException(status=0, reason=msg)
334
+
335
+ return RESTResponse(r)
@@ -0,0 +1,266 @@
1
+ Metadata-Version: 2.4
2
+ Name: stract_api
3
+ Version: 0.1.0
4
+ Summary: Stract API
5
+ Home-page:
6
+ Author: Matt
7
+ Author-email: Matt <matt@stract-api.com>
8
+ License: MIT
9
+ Project-URL: Repository, https://github.com/mattpmoreno/stract-api-python
10
+ Keywords: OpenAPI,OpenAPI-Generator,Stract API
11
+ Requires-Python: >=3.11
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: urllib3<3.0.0,>=2.7.0
15
+ Requires-Dist: python-dateutil>=2.8.2
16
+ Requires-Dist: pydantic>=2.11
17
+ Requires-Dist: typing-extensions>=4.7.1
18
+ Dynamic: author
19
+ Dynamic: license-file
20
+
21
+ # stract-api-python
22
+ Get structured output from unstructured inputs
23
+
24
+ ## Machine authentication
25
+
26
+ Programmatic access to the API is authenticated with an API key. Include the API key in every request as a bearer token in the `authorization` header:
27
+
28
+ ```
29
+ authorization: bearer [apiKey]
30
+ ```
31
+
32
+ ## SDKs
33
+
34
+ Official SDKs are available for the following languages:
35
+
36
+ - **Node (JavaScript / TypeScript)**: [`stract-api` on npm](https://www.npmjs.com/package/stract-api)
37
+ - **Java (17+)**: [`com.stract-api:stract-api` on Maven Central](https://central.sonatype.com/artifact/com.stract-api/stract-api)
38
+
39
+
40
+ This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
41
+
42
+ - API version: 0.9.4
43
+ - Package version: 0.1.0
44
+ - Generator version: 7.27.0
45
+ - Build package: org.openapitools.codegen.languages.PythonClientCodegen
46
+
47
+ ## Requirements.
48
+
49
+ Python 3.11+
50
+
51
+ Packaging uses standard `[project]` metadata and `[dependency-groups]` (PEP 621/735).
52
+ Install the package with `python -m pip install .`; install development dependencies
53
+ with Poetry 2.2 or newer using `poetry install`, or pip 25.1 or newer using
54
+ `python -m pip install --group dev`. The latter installs the group, not the package.
55
+
56
+ ## Installation & Usage
57
+ ### pip install
58
+
59
+ If the python package is hosted on a repository, you can install directly using:
60
+
61
+ ```sh
62
+ pip install git+https://github.com/mattpmoreno/stract-api-python.git
63
+ ```
64
+ (you may need to run `pip` with root permission: `sudo pip install git+https://github.com/mattpmoreno/stract-api-python.git`)
65
+
66
+ Then import the package:
67
+ ```python
68
+ import stract_api
69
+ ```
70
+
71
+ ### Setuptools
72
+
73
+ Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
74
+
75
+ ```sh
76
+ python setup.py install --user
77
+ ```
78
+ (or `sudo python setup.py install` to install the package for all users)
79
+
80
+ Then import the package:
81
+ ```python
82
+ import stract_api
83
+ ```
84
+
85
+ ### Tests
86
+
87
+ Execute `pytest` to run the tests.
88
+
89
+ ## Getting Started
90
+
91
+ Please follow the [installation procedure](#installation--usage) and then run the following:
92
+
93
+ ```python
94
+
95
+ import stract_api
96
+ from stract_api.rest import ApiException
97
+ from pprint import pprint
98
+
99
+ # Defining the host is optional and defaults to https://api.stract-api.com
100
+ # See configuration.py for a list of all supported configuration parameters.
101
+ configuration = stract_api.Configuration(
102
+ host = "https://api.stract-api.com"
103
+ )
104
+
105
+ # The client must configure the authentication and authorization parameters
106
+ # in accordance with the API server security policy.
107
+ # Examples for each auth method are provided below, use the example that
108
+ # satisfies your auth use case.
109
+
110
+ # Configure Bearer authorization: bearerAuth
111
+ configuration = stract_api.Configuration(
112
+ access_token = os.environ["BEARER_TOKEN"]
113
+ )
114
+
115
+
116
+ # Enter a context with an instance of the API client
117
+ with stract_api.ApiClient(configuration) as api_client:
118
+ # Create an instance of the API class
119
+ api_instance = stract_api.AccountApi(api_client)
120
+ create_account_user_request = stract_api.CreateAccountUserRequest() # CreateAccountUserRequest |
121
+
122
+ try:
123
+ # Add a user to the current account
124
+ api_response = api_instance.create_account_user(create_account_user_request)
125
+ print("The response of AccountApi->create_account_user:\n")
126
+ pprint(api_response)
127
+ except ApiException as e:
128
+ print("Exception when calling AccountApi->create_account_user: %s\n" % e)
129
+
130
+ ```
131
+
132
+ ## Documentation for API Endpoints
133
+
134
+ All URIs are relative to *https://api.stract-api.com*
135
+
136
+ Class | Method | HTTP request | Description
137
+ ------------ | ------------- | ------------- | -------------
138
+ *AccountApi* | [**create_account_user**](docs/AccountApi.md#create_account_user) | **POST** /account/user | Add a user to the current account
139
+ *AccountApi* | [**edit_account**](docs/AccountApi.md#edit_account) | **PUT** /account | Edit the current account
140
+ *AccountApi* | [**get_account**](docs/AccountApi.md#get_account) | **GET** /account | Get information about user&#39;s account
141
+ *AccountApi* | [**get_account_users**](docs/AccountApi.md#get_account_users) | **GET** /account/user | Get the users in the current account
142
+ *AccountCreditLedgerApi* | [**get_account_credit_ledger_for_spending_user**](docs/AccountCreditLedgerApi.md#get_account_credit_ledger_for_spending_user) | **GET** /account_credit_ledger | Get the account credit ledger
143
+ *ApiKeyApi* | [**get_api_keys**](docs/ApiKeyApi.md#get_api_keys) | **GET** /api-key | Get the current account&#39;s API keys
144
+ *CatalogApi* | [**create_catalog**](docs/CatalogApi.md#create_catalog) | **POST** /catalog | Create a catalog
145
+ *CatalogApi* | [**delete_catalog**](docs/CatalogApi.md#delete_catalog) | **DELETE** /catalog/{catalogId} | Delete a catalog
146
+ *CatalogApi* | [**get_catalogs**](docs/CatalogApi.md#get_catalogs) | **GET** /catalog | Get all catalogs
147
+ *CreditsApi* | [**get_current_credits**](docs/CreditsApi.md#get_current_credits) | **GET** /current_credits | Get the current credit balance
148
+ *CreditsApi* | [**get_current_org_credits**](docs/CreditsApi.md#get_current_org_credits) | **GET** /current_org_credits | Get the current organization credit balance
149
+ *DocumentApi* | [**delete_document**](docs/DocumentApi.md#delete_document) | **DELETE** /document/{documentId} | Delete a document
150
+ *DocumentApi* | [**get_catalog_documents**](docs/DocumentApi.md#get_catalog_documents) | **GET** /catalog/{catalogId}/document | Get documents for a catalog
151
+ *DocumentApi* | [**get_document_link**](docs/DocumentApi.md#get_document_link) | **GET** /document/{documentId}/link | Get a link to a document
152
+ *DocumentApi* | [**get_document_text**](docs/DocumentApi.md#get_document_text) | **GET** /catalog/{catalogId}/document/{documentId}/text | Get the extracted text of a document
153
+ *DocumentApi* | [**get_documents_for_job**](docs/DocumentApi.md#get_documents_for_job) | **GET** /job/{jobId}/document | Get the documents for a job
154
+ *DocumentApi* | [**get_user_documents**](docs/DocumentApi.md#get_user_documents) | **GET** /document | Get all documents for the user
155
+ *DocumentApi* | [**upload_document**](docs/DocumentApi.md#upload_document) | **POST** /catalog/{catalogId}/document | Upload a file to the specified catalog
156
+ *DocumentApi* | [**upload_document_no_catalog**](docs/DocumentApi.md#upload_document_no_catalog) | **POST** /document | Upload a document
157
+ *DocumentApi* | [**upload_text_document**](docs/DocumentApi.md#upload_text_document) | **POST** /catalog/{catalogId}/document/text | Upload text as a document to the specified catalog
158
+ *DocumentApi* | [**upload_text_document_no_catalog**](docs/DocumentApi.md#upload_text_document_no_catalog) | **POST** /document/text | Upload text as a document
159
+ *FieldApi* | [**create_fields**](docs/FieldApi.md#create_fields) | **POST** /struct/{structId}/field | Create fields for a struct
160
+ *FieldApi* | [**delete_field**](docs/FieldApi.md#delete_field) | **DELETE** /field/{fieldId} | Delete a field
161
+ *FieldApi* | [**edit_field**](docs/FieldApi.md#edit_field) | **PUT** /field/{fieldId} | Edit a field
162
+ *FieldApi* | [**get_fields**](docs/FieldApi.md#get_fields) | **GET** /struct/{structId}/field | Get data fields for a struct
163
+ *JobApi* | [**archive_job**](docs/JobApi.md#archive_job) | **POST** /job/{jobId}/archive | Archive a job
164
+ *JobApi* | [**cancel_job**](docs/JobApi.md#cancel_job) | **POST** /job/{jobId}/cancel | Cancel a job
165
+ *JobApi* | [**create_job**](docs/JobApi.md#create_job) | **POST** /struct/{structId}/job | Create a job
166
+ *JobApi* | [**get_job_by_id**](docs/JobApi.md#get_job_by_id) | **GET** /job/{jobId} | Get a job by ID
167
+ *JobApi* | [**get_job_output_csv**](docs/JobApi.md#get_job_output_csv) | **GET** /job/{jobId}/output_csv | Get the output for a job as CSV
168
+ *JobApi* | [**get_job_output_json**](docs/JobApi.md#get_job_output_json) | **GET** /job/{jobId}/output_json | Get the output for a job as JSON
169
+ *JobApi* | [**get_struct_jobs**](docs/JobApi.md#get_struct_jobs) | **GET** /struct/{structId}/job | Get all jobs for the specified struct
170
+ *JobApi* | [**get_user_jobs**](docs/JobApi.md#get_user_jobs) | **GET** /job | Get all jobs for the user
171
+ *JobApi* | [**upload_document_process_and_run_job**](docs/JobApi.md#upload_document_process_and_run_job) | **POST** /struct/{structId}/job/sync | Upload a document, run an analysis job on that document, and download the output. For API use.
172
+ *JobApi* | [**upload_text_document_and_run_job**](docs/JobApi.md#upload_text_document_and_run_job) | **POST** /struct/{structId}/job/sync/text | Create a document from text, run an analysis job on that document, and download the output. For API use.
173
+ *JobDocumentApi* | [**get_job_document_output**](docs/JobDocumentApi.md#get_job_document_output) | **GET** /job_document/{jobDocId}/output | Get the output for a job document
174
+ *JobDocumentApi* | [**get_job_documents**](docs/JobDocumentApi.md#get_job_documents) | **GET** /job/{jobId}/job_document | Get the status of document analysis in a job
175
+ *LlmModelApi* | [**get_llm_models**](docs/LlmModelApi.md#get_llm_models) | **GET** /llm_model | Get the available LLM models
176
+ *StructApi* | [**archive_struct**](docs/StructApi.md#archive_struct) | **POST** /struct/{structId}/archive | Archive a struct
177
+ *StructApi* | [**create_struct**](docs/StructApi.md#create_struct) | **POST** /struct | Create a new data structure
178
+ *StructApi* | [**get_structs**](docs/StructApi.md#get_structs) | **GET** /struct | Get all data structures
179
+ *UserApi* | [**edit_my_user**](docs/UserApi.md#edit_my_user) | **PUT** /my_user | Edit the current user
180
+ *UserApi* | [**get_my_user**](docs/UserApi.md#get_my_user) | **GET** /my_user | Get the current user
181
+
182
+
183
+ ## Documentation For Models
184
+
185
+ - [Account](docs/Account.md)
186
+ - [AccountCreditCache](docs/AccountCreditCache.md)
187
+ - [AccountCreditLedger](docs/AccountCreditLedger.md)
188
+ - [AccountUser](docs/AccountUser.md)
189
+ - [AccountUserRole](docs/AccountUserRole.md)
190
+ - [ApiKey](docs/ApiKey.md)
191
+ - [Catalog](docs/Catalog.md)
192
+ - [CreateAccountUserRequest](docs/CreateAccountUserRequest.md)
193
+ - [CreateCatalogRequest](docs/CreateCatalogRequest.md)
194
+ - [CreateFieldRequest](docs/CreateFieldRequest.md)
195
+ - [CreateJobRequest](docs/CreateJobRequest.md)
196
+ - [CreateStructRequest](docs/CreateStructRequest.md)
197
+ - [DeletedDocument](docs/DeletedDocument.md)
198
+ - [DeletedField](docs/DeletedField.md)
199
+ - [Document](docs/Document.md)
200
+ - [DocumentLink](docs/DocumentLink.md)
201
+ - [DocumentProcessingStatus](docs/DocumentProcessingStatus.md)
202
+ - [DocumentText](docs/DocumentText.md)
203
+ - [EditAccountRequest](docs/EditAccountRequest.md)
204
+ - [EditFieldRequest](docs/EditFieldRequest.md)
205
+ - [EditMyUserRequest](docs/EditMyUserRequest.md)
206
+ - [FieldType](docs/FieldType.md)
207
+ - [Job](docs/Job.md)
208
+ - [JobDocument](docs/JobDocument.md)
209
+ - [JobOutput](docs/JobOutput.md)
210
+ - [JobOutputRecord](docs/JobOutputRecord.md)
211
+ - [JobStatus](docs/JobStatus.md)
212
+ - [LlmModel](docs/LlmModel.md)
213
+ - [LoginRequest](docs/LoginRequest.md)
214
+ - [LoginResponse](docs/LoginResponse.md)
215
+ - [ModelField](docs/ModelField.md)
216
+ - [Struct](docs/Struct.md)
217
+ - [SyncTextJobRequest](docs/SyncTextJobRequest.md)
218
+ - [UploadTextDocumentRequest](docs/UploadTextDocumentRequest.md)
219
+ - [User](docs/User.md)
220
+
221
+
222
+ <a id="documentation-for-authorization"></a>
223
+ ## Documentation For Authorization
224
+
225
+
226
+ Authentication schemes defined for the API:
227
+ <a id="bearerAuth"></a>
228
+ ### bearerAuth
229
+
230
+ - **Type**: Bearer authentication
231
+
232
+
233
+ ## Author
234
+
235
+ matt@stract-api.com
236
+
237
+
238
+ ## Request headers
239
+
240
+ Header names are compared case-insensitively in all Python client libraries.
241
+ Request headers are copied; supplying `_headers` does not change the caller's dict
242
+ or the client's shared defaults. The public `_headers` argument retains its dict
243
+ validation and existing value serialization. Pydantic can coerce mappings such as HTTPX `Headers` to a dict,
244
+ combining repeated fields into a single value; `_headers` does not provide a
245
+ repeated-field or list-of-pairs API.
246
+
247
+ Precedence, from lowest to highest:
248
+
249
+ 1. `_headers` (within one dict, the last inserted case variant wins).
250
+ 2. Explicit OpenAPI header parameters and generated `Content-Type` (or `_content_type`).
251
+ Generated `Accept` is added only when neither `_headers` nor explicit header
252
+ parameters contain an `Accept` case variant.
253
+ 3. `ApiClient.default_headers` (including headers set with `set_default_header`).
254
+ 4. The client's `cookie` setting, for `Cookie`.
255
+ 5. Authentication headers. A non-empty `_request_auth` replaces configured
256
+ authentication for that call; `{}` retains configured authentication. Cookie
257
+ authentication appends to the selected `Cookie` value.
258
+
259
+ This retains the existing precedence for identically spelled names and extends it
260
+ to case variants. To override a generated content type, use `_content_type`;
261
+ client defaults still take precedence over it. The winning header's spelling and
262
+ value are retained for replacements. Cookie authentication uses the canonical
263
+ `Cookie` spelling and appends its value. Values containing legitimate
264
+ comma-separated lists are not split or deduplicated. This does not remove
265
+ duplicate values inside a header or change the handling of repeated fields
266
+ supplied directly to the transport.
@@ -0,0 +1,61 @@
1
+ stract_api/__init__.py,sha256=d8wEthtN1Ik9zDfJ4t7GE8ocnZj334QN_DDYT9XFGlY,6218
2
+ stract_api/api_client.py,sha256=8t4bPSsnnAk-vyLZon9DiZsaTfOtk0ww4XMlDfrwW-k,31777
3
+ stract_api/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
4
+ stract_api/configuration.py,sha256=0ztndhFq5tB95LOHY_LPZwD-hpzeUtm5i9IqvLuv_a0,22506
5
+ stract_api/exceptions.py,sha256=-mVK6VdwpPMds-seC4xagHgOh6qq6Z_KdQcnW60Y-WU,7018
6
+ stract_api/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ stract_api/rest.py,sha256=uR8H1bFWx9TjnSVYisYqahvfg9bEVbUYw7viiMnYuRA,12862
8
+ stract_api/api/__init__.py,sha256=9TBNGcKBJMNDwZORG--y0XV5OyapLcw0o21J89rJyGM,667
9
+ stract_api/api/account_api.py,sha256=ujIFXQoX4x2KdfqIu9FARg887zaD9dbibTL_Detyzcg,43429
10
+ stract_api/api/account_credit_ledger_api.py,sha256=un79QmQ3uA3fpdlD3Fn3Ui_7FK_pXMMzIM2HsnEhpQ0,11434
11
+ stract_api/api/api_key_api.py,sha256=EAo0qXoCd08ayq-Pf98ubPm1SUP5CTyEbss0aV2F0_k,11047
12
+ stract_api/api/catalog_api.py,sha256=0XBTmsRMk1D8TDynrszzZzJVdTNvmDaRiwjB06s0eqg,32517
13
+ stract_api/api/credits_api.py,sha256=OnbGUqu9ojUYL88aWmGB4lnJVLXlX1u0FHw3odXFUlM,20761
14
+ stract_api/api/document_api.py,sha256=JqktgqjZ3FKn52YkVqZn_5eSzSHZpy5vGXTdaR0CUFE,116370
15
+ stract_api/api/field_api.py,sha256=X71JRVlueBYqqlMnayq-RJCiyYMVLs2AetpgaG_3Jow,45602
16
+ stract_api/api/job_api.py,sha256=CrhQFtOG4fsncaT0c2oL-BBitCI4AZTzOkmoVDh3U0o,123238
17
+ stract_api/api/job_document_api.py,sha256=UgtVbDbXoMchNCXf4doX9roETSvV31xupR9qlL2DyUM,22625
18
+ stract_api/api/llm_model_api.py,sha256=tDUXDJMh4KFkFm33h1crV3Apj7cEhr6gYt9MAnWPcw0,11145
19
+ stract_api/api/struct_api.py,sha256=jmLOeCGF2prq5oTddJHmidJU83V7KNrXltbTm4GhrZU,32141
20
+ stract_api/api/user_api.py,sha256=7wwZmweQdG1VUwa-t32d715QR_ADaQM_53Mwdn6praM,22050
21
+ stract_api/models/__init__.py,sha256=ucBs2Criya4PAeSt1RMgTfGYtHOGgtxVKIcsmhH9OtE,2964
22
+ stract_api/models/account.py,sha256=V4miZLP-R10IMinWfUJegs-wXUYs49b1G5Fb4cHN9qg,5604
23
+ stract_api/models/account_credit_cache.py,sha256=Im2gNrgBAAliyuLmhqVdmn5ETywvsoLA13lTYMp67dQ,4358
24
+ stract_api/models/account_credit_ledger.py,sha256=0rHGjA8Mvwo6frJ_n8isPFSpcfGquG4xPC5t0R_W8gI,5477
25
+ stract_api/models/account_user.py,sha256=N0auqJY8UM0yInbYKWBK3gr0DnG2bjZ3tbWZw5HDenE,3923
26
+ stract_api/models/account_user_role.py,sha256=7Qf92tpIDTI5Hv-MPJt8I4hWXpOapygfHbc0jFASDY4,1275
27
+ stract_api/models/api_key.py,sha256=XeKefRdNWYZ9bdWpxDbXgGoQwg8sOL2AwUWkTiCdiCw,3881
28
+ stract_api/models/catalog.py,sha256=dL7ykyWFkyW8cxl8WUyIk0ZhwLplU8FxxG4qAjjnFJc,3650
29
+ stract_api/models/create_account_user_request.py,sha256=uiT3m5PSJxhTbVc1XVPeD0m-GzCekCZRkV25AgZQ7nU,3737
30
+ stract_api/models/create_catalog_request.py,sha256=uceRnmUtAMo7Lgey8fp4Qfc_gss02q-LpVVCyYn9Fpw,3161
31
+ stract_api/models/create_field_request.py,sha256=RjTRlqd61GKgrmCMuehgZlRqkrnxAtVeLihO7EwaYfs,3900
32
+ stract_api/models/create_job_request.py,sha256=kxPFy6VKufg7Pg5HitQGGMl4N9jfTTuhEy5x3IsOzZo,4920
33
+ stract_api/models/create_struct_request.py,sha256=2_z6KIFlJiwyryJ7WMvlPGeRgHs14S_YJL8OEct0lb4,3172
34
+ stract_api/models/deleted_document.py,sha256=tq8cX_oSbH2ufPMHGknri4W9uvfyiYUrPptNC_KCqww,3148
35
+ stract_api/models/deleted_field.py,sha256=RPjIXd8JDno9d5aZy_Fr6qjeJJWOo5ygX0Ot-mPpANA,3118
36
+ stract_api/models/document.py,sha256=b_eAX_iRr3U7a73e-kGhVK2imf3vXETkChRdWQCXXeM,4246
37
+ stract_api/models/document_link.py,sha256=nDWdI_l2mrODIk4rAvzugHFYuUITiL0XCuk5Bug2fvc,3099
38
+ stract_api/models/document_processing_status.py,sha256=RB4EpoTgo5ourjUwYNUBljUEC8-AiA2k5W6oVyuRWes,1338
39
+ stract_api/models/document_text.py,sha256=iyxN0zh6jKGES_D7IQ7MK-OYJxGbLHdtvndoPtqT_gM,3316
40
+ stract_api/models/edit_account_request.py,sha256=5tVIN9krZ-jEsYiCAlHzhj08nyT20X9GZ2xdsGofgtY,3148
41
+ stract_api/models/edit_field_request.py,sha256=n8O-aZdpZT-O0_SrVPfiOKKAyhYw6Wl3DkosJhSVX_o,3957
42
+ stract_api/models/edit_my_user_request.py,sha256=a8-Tolt_CQZd1Gq5Z51pTC1aZP1sGbqNTijTnbxf77A,3303
43
+ stract_api/models/field_type.py,sha256=HpiBD2UUy4S9faDI2hmNb2pNMjGow4-uKI6sd-3Cdmg,1339
44
+ stract_api/models/job.py,sha256=Lv1bJNfIuzw6Zd2DIsb3p1kO501uKqTqXA2VLdUGM18,5849
45
+ stract_api/models/job_document.py,sha256=r1i8V4A3stZnb3E6KfSdNn88xG_d6-CCofMDSzmb3d0,5328
46
+ stract_api/models/job_output.py,sha256=XdYo4zV1I5BrshaWDyXPDDI8wb-ZYViTybjgUpWrif4,3589
47
+ stract_api/models/job_output_record.py,sha256=cPNZi99zsLJKONnoMXOLrcxNzNX613YbNTCzrr637xc,3803
48
+ stract_api/models/job_status.py,sha256=Lbj06za14inp-vdv8psg6OLQQQJHTwwhtOjmS7nRANg,1350
49
+ stract_api/models/llm_model.py,sha256=f5iei6qtniw3TYEoJJbCo1-CfN2cG82yAI77NFwq62w,5461
50
+ stract_api/models/login_request.py,sha256=5SbCqX3yEA2hii4w2G8kGZYzkam34E4Yt0qXTuIaCPg,3320
51
+ stract_api/models/login_response.py,sha256=GKc1SNWtXTeVH_Aq5izh3VEwRsKR34g4k2XL5KJak4s,3172
52
+ stract_api/models/model_field.py,sha256=Ml4A2d1_QCDtSSAugKI1tihDf3w1MJrHTR_S5afstZ4,4207
53
+ stract_api/models/struct.py,sha256=ORfqC6Zfbx8GuhuMlzKikqhEt2tWEKZD_7XZD2S0Nds,3641
54
+ stract_api/models/sync_text_job_request.py,sha256=D_XvUE99oqC8HQQ6rHGP1oH_Iyuqitdz8VgZ-23Gdv0,5360
55
+ stract_api/models/upload_text_document_request.py,sha256=IgmrYVh6i6w-M2GKiV-q-yvNBCkg_1lIrmKoIB05C5A,3481
56
+ stract_api/models/user.py,sha256=jGm_q_Fjug5L4QtV9fIy3IyLJFMOzrsb6Bu2bGxSweg,3768
57
+ stract_api-0.1.0.dist-info/licenses/LICENSE,sha256=MGd3NFu7ajbQWNngJYkj8wP4u-_r1YBEadAjiY8r7ao,1067
58
+ stract_api-0.1.0.dist-info/METADATA,sha256=ZIIJg-wsuGaB5RUU1CjpSwYDN2WOM-cKiU_9VNckfmY,13569
59
+ stract_api-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
60
+ stract_api-0.1.0.dist-info/top_level.txt,sha256=f4qgHdunDE-ZfC4Utcc9VpbH6kPCZqJudm1ZYYJ5YvA,11
61
+ stract_api-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+