flashdrive 1.0.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.

Potentially problematic release.


This version of flashdrive might be problematic. Click here for more details.

Files changed (73) hide show
  1. flashdrive-1.0.0/CHANGELOG.md +110 -0
  2. flashdrive-1.0.0/LICENSE +202 -0
  3. flashdrive-1.0.0/PKG-INFO +43 -0
  4. flashdrive-1.0.0/README.md +30 -0
  5. flashdrive-1.0.0/pyproject.toml +37 -0
  6. flashdrive-1.0.0/src/flashdrive/__init__.py +152 -0
  7. flashdrive-1.0.0/src/flashdrive/_api_contract.json +41943 -0
  8. flashdrive-1.0.0/src/flashdrive/_bulk.py +796 -0
  9. flashdrive-1.0.0/src/flashdrive/_diagnostics.py +21 -0
  10. flashdrive-1.0.0/src/flashdrive/_environment.py +26 -0
  11. flashdrive-1.0.0/src/flashdrive/_error_registry.py +269 -0
  12. flashdrive-1.0.0/src/flashdrive/_file_bytes.py +210 -0
  13. flashdrive-1.0.0/src/flashdrive/_file_edits.py +177 -0
  14. flashdrive-1.0.0/src/flashdrive/_imports.py +1196 -0
  15. flashdrive-1.0.0/src/flashdrive/_legacy.py +3 -0
  16. flashdrive-1.0.0/src/flashdrive/_local_only.py +716 -0
  17. flashdrive-1.0.0/src/flashdrive/_messages.py +114 -0
  18. flashdrive-1.0.0/src/flashdrive/_multipart.py +229 -0
  19. flashdrive-1.0.0/src/flashdrive/_notices.py +250 -0
  20. flashdrive-1.0.0/src/flashdrive/_polling.py +135 -0
  21. flashdrive-1.0.0/src/flashdrive/_proxy.py +56 -0
  22. flashdrive-1.0.0/src/flashdrive/_text_files.py +39 -0
  23. flashdrive-1.0.0/src/flashdrive/_transport.py +589 -0
  24. flashdrive-1.0.0/src/flashdrive/_upload_limits.py +105 -0
  25. flashdrive-1.0.0/src/flashdrive/_version.py +1 -0
  26. flashdrive-1.0.0/src/flashdrive/_wire.py +12 -0
  27. flashdrive-1.0.0/src/flashdrive/_workflow.py +1107 -0
  28. flashdrive-1.0.0/src/flashdrive/async_client.py +1120 -0
  29. flashdrive-1.0.0/src/flashdrive/client.py +1124 -0
  30. flashdrive-1.0.0/src/flashdrive/client_core.py +111 -0
  31. flashdrive-1.0.0/src/flashdrive/enums.py +108 -0
  32. flashdrive-1.0.0/src/flashdrive/errors.py +332 -0
  33. flashdrive-1.0.0/src/flashdrive/models.py +954 -0
  34. flashdrive-1.0.0/src/flashdrive/py.typed +0 -0
  35. flashdrive-1.0.0/tests/__init__.py +1 -0
  36. flashdrive-1.0.0/tests/live_smoke.py +52 -0
  37. flashdrive-1.0.0/tests/public-api-v1.json +8466 -0
  38. flashdrive-1.0.0/tests/test_api_contract.py +145 -0
  39. flashdrive-1.0.0/tests/test_bulk.py +421 -0
  40. flashdrive-1.0.0/tests/test_bulk_completion_retry.py +270 -0
  41. flashdrive-1.0.0/tests/test_bulk_delete_usage.py +226 -0
  42. flashdrive-1.0.0/tests/test_bulk_lifecycle.py +227 -0
  43. flashdrive-1.0.0/tests/test_canonical_identity.py +23 -0
  44. flashdrive-1.0.0/tests/test_client_core.py +77 -0
  45. flashdrive-1.0.0/tests/test_document_preconditions.py +166 -0
  46. flashdrive-1.0.0/tests/test_documents_recovery.py +137 -0
  47. flashdrive-1.0.0/tests/test_enums.py +179 -0
  48. flashdrive-1.0.0/tests/test_environment_transition.py +128 -0
  49. flashdrive-1.0.0/tests/test_errors.py +180 -0
  50. flashdrive-1.0.0/tests/test_file_bytes.py +230 -0
  51. flashdrive-1.0.0/tests/test_file_edits.py +333 -0
  52. flashdrive-1.0.0/tests/test_files.py +254 -0
  53. flashdrive-1.0.0/tests/test_folders.py +221 -0
  54. flashdrive-1.0.0/tests/test_import_auto_fallback.py +128 -0
  55. flashdrive-1.0.0/tests/test_import_retirement.py +59 -0
  56. flashdrive-1.0.0/tests/test_imports.py +793 -0
  57. flashdrive-1.0.0/tests/test_imports_staging.py +72 -0
  58. flashdrive-1.0.0/tests/test_launch_surface.py +32 -0
  59. flashdrive-1.0.0/tests/test_local_only.py +289 -0
  60. flashdrive-1.0.0/tests/test_multipart.py +617 -0
  61. flashdrive-1.0.0/tests/test_prepare_limit.py +51 -0
  62. flashdrive-1.0.0/tests/test_public_api.py +103 -0
  63. flashdrive-1.0.0/tests/test_q20_durable_wait.py +754 -0
  64. flashdrive-1.0.0/tests/test_resources.py +471 -0
  65. flashdrive-1.0.0/tests/test_sandbox_tokens.py +149 -0
  66. flashdrive-1.0.0/tests/test_sdk.py +1102 -0
  67. flashdrive-1.0.0/tests/test_search_cursor_contract.py +58 -0
  68. flashdrive-1.0.0/tests/test_status_wait.py +173 -0
  69. flashdrive-1.0.0/tests/test_text_files.py +84 -0
  70. flashdrive-1.0.0/tests/test_upload_capabilities.py +891 -0
  71. flashdrive-1.0.0/tests/test_upload_file_cap.py +176 -0
  72. flashdrive-1.0.0/tests/test_v2.py +164 -0
  73. flashdrive-1.0.0/tox.ini +9 -0
@@ -0,0 +1,110 @@
1
+ # Changelog
2
+
3
+ ## 1.0.0 (unreleased)
4
+
5
+ - `upload`, `documents.replace_file`, `imports.plan` and `imports.run` (sync
6
+ and async) refuse, before any request, a named local path with a `.git`
7
+ component, a file named `.env` (any ASCII case), a system leftover such as
8
+ `.DS_Store`, or an `external_id` naming such a path. They raise
9
+ `LocalValidationError` and nothing is sent. Folder imports skip these and
10
+ what the folder's `.gitignore` files ignore, and send other hidden files.
11
+ Symbolic links are followed for this check. An import journal that named
12
+ such a file is now refused on resume; drop that file from the sources.
13
+ - Publish the canonical `flashdrive` package at version 1.0.0 with the
14
+ `Flashdrive`, `AsyncFlashdrive` and `FlashdriveError` Python names and
15
+ FlashDrive display name. Use only `FLASHDRIVE_*` connection settings.
16
+ - Keep synchronous and asynchronous resource APIs aligned, with typed
17
+ responses, preserved raw fields and bounded retries.
18
+ - Create drives with service-managed search settings. Remove customer
19
+ search-mode and full-text setters before the first stable publication;
20
+ read-only response fields remain available.
21
+ - Remove search by meaning: `search()`, `last_sequence()`, `passages.get()`,
22
+ `SearchResponse`, `Passage`, `Effort`, `Freshness` and
23
+ `SearchInProgressTimeoutError`. Keyword search (`files.full_text_search()`)
24
+ and pattern search (`files.grep()`) remain.
25
+ - Support durable upload receipts, resumable file transfers, revision-checked
26
+ mutations and operation recovery. Request metadata uses FlashDrive headers.
27
+ - Keep issued wire-format identifiers and historical release notes intact.
28
+
29
+ ## 0.3.2 (2026-10-22)
30
+
31
+ - Require Certifi 2026.10.19 or later so normal installations and upgrades use
32
+ the CA bundle that removes the affected emSign roots (GHSA-6q48-6c7w-9gw2).
33
+ Existing installations must upgrade their dependencies. Custom CA bundles
34
+ require a separate update.
35
+
36
+ ## 0.3.1 (2026-10-18)
37
+
38
+ - `search()` and `ask()` keep polling while a retried search reports `search_request_in_progress`, honoring `Retry-After` with backoff until shortly before the call's `timeout`, instead of raising `PolygresError` after two retries. A search still running at the deadline raises the new `SearchInProgressTimeoutError` (an `SDKTimeoutError`) with the `idempotency_key` to fetch its result later.
39
+
40
+ ## 0.3.0 (2026-10-18)
41
+
42
+ - Imports that `upload()` starts name each document `<import_id>/<path>`, so uploading the same large batch again creates new documents, as uploads do. A resumed upload keeps its import's names.
43
+ - An import that fails because its documents already exist raises `BulkImportError` with code `import_revision_conflict` and says that imports only create documents, instead of suggesting a retry.
44
+ - Add `search()` to both clients as the canonical search method, with the same arguments and response as `ask()` except the ignored legacy `limit`, which only `ask()` accepts. `ask()` remains as a deprecated alias that emits one `SDKDeprecationWarning` per process and will be removed in the next major version.
45
+ - Default the base URL to `https://api.wondersearch.ai`. Accept `WONDERSEARCH_API_KEY` and `WONDERSEARCH_BASE_URL` alongside `POLYGRES_API_KEY` and `POLYGRES_BASE_URL`, which keep precedence.
46
+ - Read deprecation and client notices from every response (`Deprecation`, `Sunset`, `Link rel="deprecation"`, `WonderSearch-Client-Notice` and the top-level `deprecations` list) and report each once per process as `SDKDeprecationWarning` or `SDKUpgradeWarning`, with the exact upgrade command. The SDK never installs packages itself.
47
+ - Add `ClientUpgradeRequiredError` (HTTP 426 `client_upgrade_required`, an `SDKCompatibilityError`, with `minimum_version`, `latest_version` and `upgrade_command`) and `APIVersionRetiredError` (HTTP 410 `api_version_retired`, with `replacement`, `docs_url` and `sunset_at`).
48
+ - Send `X-WonderSearch-SDK-Version` alongside `X-Polygres-SDK-Version`.
49
+ - Add `SearchResponse.deprecations`.
50
+ - Add `client.imports` to both clients for bulk imports of TXT and Markdown collections: `run()` plans deterministic chunks with a per-file manifest, checks totals against `limits()`, uploads and acknowledges chunks with bounded concurrency and retries (honoring `Retry-After`), seals, waits until searchable with progress callbacks, and resumes from a local journal. `plan`, `create`, `get`, `seal`, `wait`, `close`, `recover`, `failed_operations`, `retry_operation` and `retry_failed` expose each step.
51
+ - Optionally combine small files into one document with `combine_bytes`; the document's `source_files` metadata keeps each file's identity and byte range.
52
+ - Add `BulkImportError`, `ImportFile`, `ImportPlan`, `ImportProgress`, `ImportStatus` and `ImportChunkStatus`.
53
+ - `upload()` sends a batch of at least 1,000 files or 1,000,000,000 bytes of TXT and Markdown through a bulk import when imports are available (`route="auto"`, the new default), returning an `UploadBatch` with `import_status` and no receipts. Such imports raise `BulkImportError` and identify documents by file path. Pass `route="uploads"` to keep the previous behavior, or `route="imports"` to always import (directories are rejected there; use `imports.run()`).
54
+
55
+ ## 0.2.1 (never published; included in 0.3.0)
56
+
57
+ - Add `limits()` to both clients and the `Limits` model: the drive and file limits the service enforces (`GET /v1/limits`), cached for an hour per client. They are advisory; the service raises `drive_limit_exceeded` when a drive would grow past them.
58
+
59
+ - Continue direct-upload retries after a conditional PUT returns HTTP 412 for an existing object. The upload completion endpoint verifies the object before accepting it; other transfer failures still raise an error.
60
+
61
+ ## 0.2.0 (2026-10-06)
62
+
63
+ - Stop sending a model selector from synchronous and asynchronous search; the service chooses the search model. Neither client exposes a model-selection argument; the response’s `model` field names the version that served the search.
64
+ - Keep the legacy `ask(limit=...)` argument in both clients, but ignore it and omit it from requests. Search returns up to ten results for every effort level.
65
+
66
+ ## 0.1.2
67
+
68
+ - Use capability-negotiated bulk reservation, completion and status requests for multi-file uploads. Keep individual byte transfers bounded by `concurrency`; older APIs and explicit single-file replacements retain the original path.
69
+ - Preserve per-file identities across partial batch admission and retries. Batch metadata is bounded to 50 files and 64 KiB; completion also limits aggregate source bytes.
70
+
71
+ - Separate file transfers from processing polling in both clients, so extraction and indexing do not occupy transfer slots.
72
+ - Add configurable `concurrency` from 1 through 50, with a default of 3.
73
+ - Change `upload(timeout=...)` to cover the whole transfer phase. The subsequent processing phase uses a separate `processing_timeout`, defaulting to 600 seconds. Callers enforcing an overall time budget must account for both phases.
74
+ - Wait for upload capacity until the transfer deadline, honoring `Retry-After` with jitter and reusing the same idempotency key.
75
+ - Return queued receipts with `wait=False`; preserve recovery receipts on polling failures and poll fairly when another file stalls.
76
+ - Allow configured synchronous transfer concurrency above the previous three-request transport ceiling.
77
+
78
+ ## 0.1.1
79
+
80
+ - Rename the clients to `WonderSearch` and `AsyncWonderSearch` throughout the SDK, examples and release checks.
81
+ - Breaking change: replace `PolygresSearch` and `AsyncPolygresSearch` imports and constructors. No compatibility aliases are retained. This initial branding correction is an exception to the patch compatibility policy.
82
+
83
+ ## 0.1.0
84
+
85
+ - Prepare the first production PyPI release with synchronous and asynchronous clients.
86
+ - Start the production version series at 0.1.0; earlier 1.0.0rc releases were TestPyPI previews. An explicit version install is required when moving from those previews.
87
+
88
+ - Rename the Python import package to `wondersearch`. Replace `from polygres_search import ...` with `from wondersearch import ...`; client class names stay the same.
89
+
90
+ ## 1.0.0rc4
91
+
92
+ - Include the Apache-2.0 license in source and wheel distributions.
93
+ - Omit private source commit identifiers from SDK synchronization metadata.
94
+
95
+ ## 1.0.0rc3
96
+
97
+ - Preserve strong default-drive ETags through compression intermediaries so `drives.set_default()` works while still rejecting concurrent changes.
98
+
99
+ ## 1.0.0rc2
100
+
101
+ - Add `drives.create(name)` to both clients with a typed `Drive` response and idempotent retries.
102
+
103
+ ## 1.0.0rc1
104
+
105
+ - Matching synchronous and asynchronous upload and search clients.
106
+ - Workspace default-drive discovery and selection using existing API-key permissions.
107
+ - Proxy and direct file transfers, searchable polling and inspectable batch failures.
108
+ - Bounded retries, snapshot-specific citation fetches and SDK compatibility notices.
109
+
110
+ The releases above 0.1.0 in numeric ordering are historical TestPyPI previews, not production PyPI releases. From stable v1 onward, removals will receive at least 90 days' notice and migration instructions.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,43 @@
1
+ Metadata-Version: 2.4
2
+ Name: flashdrive
3
+ Version: 1.0.0
4
+ Summary: Typed synchronous and asynchronous clients for FlashDrive
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Requires-Python: >=3.10
8
+ Requires-Dist: certifi>=2026.10.19
9
+ Requires-Dist: httpx<1,>=0.27
10
+ Requires-Dist: packaging<27,>=24
11
+ Requires-Dist: pathspec<2,>=1.1.1
12
+ Description-Content-Type: text/markdown
13
+
14
+ # FlashDrive for Python
15
+
16
+ The Python SDK for FlashDrive, with synchronous and asynchronous clients.
17
+
18
+ ## Install
19
+
20
+ Use Python 3.10 or later and a virtual environment:
21
+
22
+ ```sh
23
+ python -m venv .venv
24
+ source .venv/bin/activate
25
+ ```
26
+
27
+ Use pip 26.2.2 or later. If your pip is older, follow the
28
+ [Python security notice](https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576)
29
+ before installing.
30
+
31
+ ```sh
32
+ python -m pip install flashdrive
33
+ ```
34
+
35
+ ## Authenticate
36
+
37
+ Create a workspace API key in the Console through the
38
+ [FlashDrive website](https://flashdrive.space). Set `FLASHDRIVE_API_KEY` in
39
+ your application environment. `Flashdrive` and `AsyncFlashdrive` read it
40
+ automatically. Keep the key out of source control.
41
+
42
+ For setup, examples, API documentation, and current limitations, visit
43
+ [FlashDrive](https://flashdrive.space).
@@ -0,0 +1,30 @@
1
+ # FlashDrive for Python
2
+
3
+ The Python SDK for FlashDrive, with synchronous and asynchronous clients.
4
+
5
+ ## Install
6
+
7
+ Use Python 3.10 or later and a virtual environment:
8
+
9
+ ```sh
10
+ python -m venv .venv
11
+ source .venv/bin/activate
12
+ ```
13
+
14
+ Use pip 26.2.2 or later. If your pip is older, follow the
15
+ [Python security notice](https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576)
16
+ before installing.
17
+
18
+ ```sh
19
+ python -m pip install flashdrive
20
+ ```
21
+
22
+ ## Authenticate
23
+
24
+ Create a workspace API key in the Console through the
25
+ [FlashDrive website](https://flashdrive.space). Set `FLASHDRIVE_API_KEY` in
26
+ your application environment. `Flashdrive` and `AsyncFlashdrive` read it
27
+ automatically. Keep the key out of source control.
28
+
29
+ For setup, examples, API documentation, and current limitations, visit
30
+ [FlashDrive](https://flashdrive.space).
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["hatchling>=1.26,<2"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "flashdrive"
7
+ dynamic = ["version"]
8
+ description = "Typed synchronous and asynchronous clients for FlashDrive"
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ license-files = ["LICENSE"]
12
+ requires-python = ">=3.10"
13
+ dependencies = ["httpx>=0.27,<1", "packaging>=24,<27", "certifi>=2026.10.19", "pathspec>=1.1.1,<2"]
14
+
15
+ [tool.hatch.version]
16
+ path = "src/flashdrive/_version.py"
17
+
18
+ [tool.hatch.build.targets.wheel]
19
+ core-metadata-version = "2.4"
20
+ packages = ["src/flashdrive"]
21
+
22
+ [tool.hatch.build.targets.sdist]
23
+ core-metadata-version = "2.4"
24
+ include = ["/src", "/tests", "/README.md", "/CHANGELOG.md", "/LICENSE", "/pyproject.toml", "/tox.ini"]
25
+
26
+ [tool.pytest.ini_options]
27
+ pythonpath = ["src"]
28
+
29
+ [tool.mypy]
30
+ python_version = "3.10"
31
+ check_untyped_defs = true
32
+
33
+ [tool.ruff]
34
+ target-version = "py310"
35
+
36
+ [tool.ruff.lint]
37
+ select = ["E4", "E7", "E9", "F"]
@@ -0,0 +1,152 @@
1
+ from ._notices import SDKDeprecationWarning, SDKUpgradeWarning
2
+ from ._version import __version__
3
+ from .async_client import AsyncFlashdrive
4
+ from .client import Flashdrive
5
+ from .enums import (
6
+ CitationAnchor,
7
+ DocumentSource,
8
+ DriveStatus,
9
+ ErrorType,
10
+ ImportChunkState,
11
+ ImportPhase,
12
+ ImportState,
13
+ OperationStatus,
14
+ RetryKey,
15
+ Retryable,
16
+ SourceFormat,
17
+ UploadRoute,
18
+ UploadState,
19
+ )
20
+ from .errors import (
21
+ APIVersionRetiredError,
22
+ AuthenticationError,
23
+ BulkImportError,
24
+ ClientUpgradeRequiredError,
25
+ ConflictError,
26
+ InvalidRequestError,
27
+ NotFoundError,
28
+ PaymentRequiredError,
29
+ PermissionDeniedError,
30
+ PreconditionFailedError,
31
+ QuotaExceededError,
32
+ RequestTooLargeError,
33
+ ServiceUnavailableError,
34
+ UpgradeRequiredError,
35
+ FlashdriveError,
36
+ FileEditError,
37
+ FileEditTimeoutError,
38
+ RateLimitError,
39
+ SDKCompatibilityError,
40
+ SDKTimeoutError,
41
+ UploadBatchError,
42
+ UploadError,
43
+ UploadTimeoutError,
44
+ )
45
+ from .models import (
46
+ ImportChunkStatus,
47
+ ImportFile,
48
+ ImportFailure,
49
+ ImportPlan,
50
+ ImportProgress,
51
+ ImportStatus,
52
+ ImportRetryReceipt,
53
+ Limits,
54
+ Citation,
55
+ Drive,
56
+ DeletedDrive,
57
+ DriveUsage,
58
+ Document,
59
+ DocumentRevision,
60
+ FileEntry,
61
+ FilePage,
62
+ FileEdit,
63
+ FileEditProgress,
64
+ FileLink,
65
+ FileText,
66
+ Folder,
67
+ FolderDeletion,
68
+ FolderPath,
69
+ MutationReceipt,
70
+ Operation,
71
+ OperationProgress,
72
+ DefaultDrive,
73
+ TextMatch,
74
+ TextSearchPage,
75
+ UploadBatch,
76
+ UploadReceipt,
77
+ )
78
+
79
+ __all__ = [
80
+ "Citation",
81
+ "CitationAnchor",
82
+ "ConflictError",
83
+ "DocumentSource",
84
+ "ErrorType",
85
+ "InvalidRequestError",
86
+ "NotFoundError",
87
+ "PaymentRequiredError",
88
+ "PreconditionFailedError",
89
+ "QuotaExceededError",
90
+ "RequestTooLargeError",
91
+ "RetryKey",
92
+ "Retryable",
93
+ "ServiceUnavailableError",
94
+ "UpgradeRequiredError",
95
+ "APIVersionRetiredError",
96
+ "AsyncFlashdrive",
97
+ "AuthenticationError",
98
+ "BulkImportError",
99
+ "ClientUpgradeRequiredError",
100
+ "DefaultDrive",
101
+ "Drive",
102
+ "DriveStatus",
103
+ "DriveUsage",
104
+ "DeletedDrive",
105
+ "Document",
106
+ "DocumentRevision",
107
+ "FileEntry",
108
+ "FilePage",
109
+ "FileEdit",
110
+ "FileEditProgress",
111
+ "FileEditError",
112
+ "FileEditTimeoutError",
113
+ "FileLink",
114
+ "FileText",
115
+ "Folder",
116
+ "FolderDeletion",
117
+ "FolderPath",
118
+ "MutationReceipt",
119
+ "Operation",
120
+ "OperationProgress",
121
+ "OperationStatus",
122
+ "ImportChunkStatus",
123
+ "ImportChunkState",
124
+ "ImportPhase",
125
+ "ImportFile",
126
+ "ImportFailure",
127
+ "ImportPlan",
128
+ "ImportProgress",
129
+ "ImportStatus",
130
+ "ImportState",
131
+ "ImportRetryReceipt",
132
+ "Limits",
133
+ "PermissionDeniedError",
134
+ "Flashdrive",
135
+ "FlashdriveError",
136
+ "RateLimitError",
137
+ "SDKCompatibilityError",
138
+ "SDKDeprecationWarning",
139
+ "SDKTimeoutError",
140
+ "SDKUpgradeWarning",
141
+ "SourceFormat",
142
+ "TextMatch",
143
+ "TextSearchPage",
144
+ "UploadBatch",
145
+ "UploadBatchError",
146
+ "UploadError",
147
+ "UploadReceipt",
148
+ "UploadRoute",
149
+ "UploadState",
150
+ "UploadTimeoutError",
151
+ "__version__",
152
+ ]