Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

docslicer-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

docslicer-0.1.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

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

Hashes for docslicer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4d77fd56c3af87a9ea7b7535de14a657bcbbc364d94a05cbb4daa6cd76f7f88d
MD5 97998850faed9d91f9df240a5a34c9f4
BLAKE2b-256 94ba8ba5f24c986b0bce5d3ba34e31c0aacb55906af3231663e0d8be80975a43

See more details on using hashes here.

Provenance

The following attestation bundles were made for docslicer-0.1.1.tar.gz:

Publisher: publish.yml on MarketFramer/docslicer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for docslicer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3aa6f8e61f6fa9697f189bef857e22a9e34bb75ba8e4a4c3a3a998e1dbda37d
MD5 1fb77a67e9617613ea2d8d8452acb444
BLAKE2b-256 9ffc81a81627efa0981a18a2366ad75dae56cde4c803130308ee4a68e6d9b0bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for docslicer-0.1.1-py3-none-any.whl:

Publisher: publish.yml on MarketFramer/docslicer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page