Python SDK for the Docufast API
Project description
Docufast Python SDK
Python SDK for the Docufast API. Provides programmatic CRUD access to workspaces, collections, documents, images, audio, videos, notes, entities, and locations.
Installation
poetry add git+https://github.com/docufast/docufast-python.git
Quick Start
from docufast import Docufast
client = Docufast(api_key="df_sdk_xxx", base_url="http://localhost:5001")
# List workspaces
workspaces = client.workspaces.list()
# Upload a document
doc = client.documents.upload(
collection_id="uuid",
file_path="./invoice.pdf",
external_metadata={"customer_id": "123"},
)
# Create a note
note = client.notes.create(
collection_id="uuid",
name="Meeting Notes",
data="Discussion points...",
external_metadata={"meeting_id": "456"},
)
# Entities and locations
entity = client.entities.create(name="Acme Corp", entity_type="company")
location = client.locations.create(name="Main Office", location="123 Main St")
client.close()
Context Manager
with Docufast(api_key="df_sdk_xxx") as client:
workspaces = client.workspaces.list()
Resources
| Resource | Methods |
|---|---|
client.workspaces |
list() |
client.collections |
list(workspace_id), create(...), delete(id) |
client.documents |
upload(...), get(id), update_metadata(...), download(id), delete(id) |
client.images |
upload(...), get(id), update_metadata(...), delete(id) |
client.audio |
upload(...), get(id), update_metadata(...), delete(id) |
client.videos |
upload(...), get(id), update_metadata(...), delete(id) |
client.notes |
create(...), get(id), update_metadata(...), delete(id) |
client.entities |
list(), create(...), get(id), delete(id), link_to_document(...) |
client.locations |
list(), create(...), get(id), delete(id), link_to_document(...) |
Development
poetry install
poetry run pytest
Deployment
./deploy.sh -m "fix: bug fix" # Patch bump
./deploy.sh -m "feat: new feature" -i minor # Minor bump
./deploy.sh -d -m "test" # Dry run
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
docufast-0.2.0.tar.gz
(5.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
docufast-0.2.0-py3-none-any.whl
(11.0 kB
view details)
File details
Details for the file docufast-0.2.0.tar.gz.
File metadata
- Download URL: docufast-0.2.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
373661e527b8484646ef63e8a7904b3b1a3eaf44c5ad2ea8a924e141b2e37baa
|
|
| MD5 |
1d9d07a472d817f1f46cf56a39f11ca6
|
|
| BLAKE2b-256 |
1ead60bab23d98349619f77f4ea40068a96e49b8c1ef16b2e8e5cdb12b4212d0
|
File details
Details for the file docufast-0.2.0-py3-none-any.whl.
File metadata
- Download URL: docufast-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a8e942e0e22b93be9e1fa3f358c36797c7a57ca49511ab640a6948962851e2f
|
|
| MD5 |
011ea6ee4e02354ac72691b969c83380
|
|
| BLAKE2b-256 |
fe244988234ab57ba673fcd32b091192099ac46f1e8a7fb7af516c86b50790ed
|