docforge-sdk
A typed Python client for the DocForge REST API. It
ships both an asynchronous and a synchronous client with an identical surface, is fully
type-hinted (py.typed), and has zero dependency on the DocForge server tree — it is a
clean-room client that talks to the API over HTTP only (httpx + pydantic + hand-written models
that mirror the public REST contract), so it can be vendored or published independently.
Install
pip install docforge-sdk
Async usage
import asyncio
from docforge_sdk import AsyncClient, SearchRequest
async def main() -> None:
async with AsyncClient("http://localhost:10040", api_token="df_root_...") as client:
collections = await client.collections.list()
for collection in collections:
print(collection.id, collection.name)
hits = await client.search.search(
collections[0].id,
SearchRequest(query="quarterly revenue", limit=5),
)
for hit in hits.hits:
print(hit.score, hit.text)
asyncio.run(main())
Sync usage
from docforge_sdk import Client, SearchRequest
with Client("http://localhost:10040", api_token="df_root_...") as client:
collections = client.collections.list()
hits = client.search.search(
collections[0].id,
SearchRequest(query="quarterly revenue", limit=5),
)
for hit in hits.hits:
print(hit.score, hit.text)
The two clients expose the same resources and method signatures; the sync methods are the async ones
without await. Available resource groups: auth, health, collections, documents, explorer,
search, jobs, blobs, pipelines.
License
MIT — see LICENSE. This SDK is deliberately licensed MIT even though the parent DocForge repository is GPLv3: it is a standalone, clean-room client (HTTP models only, no server code), so a permissive per-directory license is intentional and lets any project depend on it freely.
Publishing (maintainers)
Releases publish to PyPI via Trusted Publishing (OIDC) — there is no API token stored in the
repo. To cut a release, tag a commit with the sdk-v<version> prefix (the version must match
docforge_sdk/_version.py) and push the tag:
git tag sdk-v0.1.0
git push origin sdk-v0.1.0
The .github/workflows/release-sdk.yml workflow then builds and uploads the sdist + wheel.
One-time PyPI setup (done once by the maintainer, before the first release):
- Reserve the project name
docforge-sdkon PyPI. - Under the project's Publishing settings, add a GitHub trusted publisher with:
- Owner:
Florian-BARRE - Repository:
docforge - Workflow name:
release-sdk.yml - Environment:
pypi
- Owner:
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file docforge_sdk-0.1.0.tar.gz.
File metadata
- Download URL: docforge_sdk-0.1.0.tar.gz
- Upload date:
- Size: 94.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcb39fda3d3120e1e688493aed5965e392a56f5a3b38080451de3c16c601b92c
|
|
| MD5 |
7b132d19c3916c52fd650ccd5922f70c
|
|
| BLAKE2b-256 |
67ecc04c5084293ed3641e9856da4dec64e861004fb26064dfb416777731b88f
|
Provenance
The following attestation bundles were made for docforge_sdk-0.1.0.tar.gz:
Publisher:
release-sdk.yml on Florian-BARRE/DocForge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docforge_sdk-0.1.0.tar.gz -
Subject digest:
fcb39fda3d3120e1e688493aed5965e392a56f5a3b38080451de3c16c601b92c - Sigstore transparency entry: 2289319066
- Sigstore integration time:
-
Permalink:
Florian-BARRE/DocForge@d38165a4e27c1ceefab57faa529017b6499ea913 -
Branch / Tag:
refs/tags/sdk-v0.1.0 - Owner: https://github.com/Florian-BARRE
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk.yml@d38165a4e27c1ceefab57faa529017b6499ea913 -
Trigger Event:
push
-
Statement type:
File details
Details for the file docforge_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docforge_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 47.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
feb2e74ba87a968926e20594d0772e2973e3059815e9c683ca0bac346fc97b3e
|
|
| MD5 |
ff1b26d3189e83a14ff976d8ef0d3110
|
|
| BLAKE2b-256 |
78167bf1b244c5d33aa447567a1177d1c15e7450d49c915d1dbccc0bc2cac65b
|
Provenance
The following attestation bundles were made for docforge_sdk-0.1.0-py3-none-any.whl:
Publisher:
release-sdk.yml on Florian-BARRE/DocForge
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docforge_sdk-0.1.0-py3-none-any.whl -
Subject digest:
feb2e74ba87a968926e20594d0772e2973e3059815e9c683ca0bac346fc97b3e - Sigstore transparency entry: 2289319137
- Sigstore integration time:
-
Permalink:
Florian-BARRE/DocForge@d38165a4e27c1ceefab57faa529017b6499ea913 -
Branch / Tag:
refs/tags/sdk-v0.1.0 - Owner: https://github.com/Florian-BARRE
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-sdk.yml@d38165a4e27c1ceefab57faa529017b6499ea913 -
Trigger Event:
push
-
Statement type: