SDK for the DocSlicer document processing API - transform HTML documents into structured chunks for RAG applications
Project description
DocSlicer SDK
Python SDK for the DocSlicer document processing API.
Installation
pip install docslicer
Quick Start
from docslicer import run
# Process a URL
chunks = run("https://sec.gov/filing.html", api_key="sk_live_...")
# Process a local file
chunks = run("./document.html", api_key="sk_live_...")
# Process all HTML files in a directory
chunks = run("./docs/", api_key="sk_live_...")
# Process multiple files
chunks = run(["file1.html", "file2.html"], api_key="sk_live_...")
# Process URLs from a CSV
chunks = run("./urls.csv", api_key="sk_live_...")
Options
chunks = run(
"./docs/",
api_url="https://www.docslicer.ai/api/v1/run", # Custom API URL
api_key="sk_live_...", # API key for auth
format="json", # Output format: json, csv, jsonl, parquet
timeout=300, # Request timeout
)
Output Formats
# JSON (default) - list of dictionaries
chunks = run("./doc.html", api_key="sk_live_...", format="json")
# CSV - string with header row
csv_data = run("./doc.html", api_key="sk_live_...", format="csv")
# JSON Lines - one JSON object per line
jsonl_data = run("./doc.html", api_key="sk_live_...", format="jsonl")
# Parquet - binary bytes
parquet_bytes = run("./doc.html", api_key="sk_live_...", format="parquet")
Async Support
from docslicer import run_async
chunks = await run_async("./docs/", api_key="sk_live_...")
Client Class
For multiple calls, use the client class to reuse configuration:
from docslicer import DocSlicerClient
client = DocSlicerClient(
api_url="https://www.docslicer.ai/api/v1/run",
api_key="sk_live_...",
)
chunks1 = client.run("./doc1.html")
chunks2 = client.run("./doc2.html")
Environment Variables
You can set the API URL via environment variable:
export DOCSLICER_API_URL="https://www.docslicer.ai/api/v1/run"
Get an API Key
Sign up at docslicer.ai to get your API key.
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
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 docslicer-0.1.1.tar.gz.
File metadata
- Download URL: docslicer-0.1.1.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d77fd56c3af87a9ea7b7535de14a657bcbbc364d94a05cbb4daa6cd76f7f88d
|
|
| MD5 |
97998850faed9d91f9df240a5a34c9f4
|
|
| BLAKE2b-256 |
94ba8ba5f24c986b0bce5d3ba34e31c0aacb55906af3231663e0d8be80975a43
|
Provenance
The following attestation bundles were made for docslicer-0.1.1.tar.gz:
Publisher:
publish.yml on MarketFramer/docslicer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docslicer-0.1.1.tar.gz -
Subject digest:
4d77fd56c3af87a9ea7b7535de14a657bcbbc364d94a05cbb4daa6cd76f7f88d - Sigstore transparency entry: 796913120
- Sigstore integration time:
-
Permalink:
MarketFramer/docslicer@f965ef93473d3cc689b5fd3cd3472d74bb3dd027 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MarketFramer
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f965ef93473d3cc689b5fd3cd3472d74bb3dd027 -
Trigger Event:
release
-
Statement type:
File details
Details for the file docslicer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: docslicer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3aa6f8e61f6fa9697f189bef857e22a9e34bb75ba8e4a4c3a3a998e1dbda37d
|
|
| MD5 |
1fb77a67e9617613ea2d8d8452acb444
|
|
| BLAKE2b-256 |
9ffc81a81627efa0981a18a2366ad75dae56cde4c803130308ee4a68e6d9b0bf
|
Provenance
The following attestation bundles were made for docslicer-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on MarketFramer/docslicer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docslicer-0.1.1-py3-none-any.whl -
Subject digest:
c3aa6f8e61f6fa9697f189bef857e22a9e34bb75ba8e4a4c3a3a998e1dbda37d - Sigstore transparency entry: 796913142
- Sigstore integration time:
-
Permalink:
MarketFramer/docslicer@f965ef93473d3cc689b5fd3cd3472d74bb3dd027 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/MarketFramer
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f965ef93473d3cc689b5fd3cd3472d74bb3dd027 -
Trigger Event:
release
-
Statement type: