Skip to main content

tryworks

CI Python 3.10–3.14 Dependencies: 0 License: Apache-2.0

Turn PDFs, Word, PowerPoint, Excel, HTML, Markdown, email and text into LLM-ready elements, with zero required dependencies.

tryworks implements the document-partitioning call path of unstructured: the same partition() function, the same element types and metadata, the same chunking, the same JSON. It leaves out what most pipelines never call, namely OCR, layout models and ingest connectors, and the 2 GB of dependencies they bring.

from tryworks.partition.auto import partition
from tryworks.chunking.title import chunk_by_title

elements = partition("quarterly-report.docx")
chunks = chunk_by_title(elements, max_characters=1000)

for chunk in chunks:
    print(chunk.metadata.page_number, chunk.text[:80])

The name: tryworks were the brick furnaces on whaling ships that rendered raw blubber into oil.

Why

Measured on Linux x86-64 with Python 3.12, reading the same document types:

unstructured[docx,pptx,xlsx,md,csv,pdf] tryworks[pdf]
Packages installed 149 2
Download size 3,257 MB 3.6 MB
Installed size (unstructured with CPU-only torch) 2.0 GB 9 MB
Importing partition plus the PDF and DOCX partitioners 4.4–6.2 s 0.15–0.39 s
Partitioning the 9-document test corpus, first call included 7.2 s 0.59 s
Security advisories ever published for the installed packages 701 0
Lines of library code 34,171 5,449

Base tryworks without the PDF extra is a single 80 KB wheel with no dependencies.

In practice that means:

  • It fits in AWS Lambda. The zip deployment limit is 250 MB unpacked, and it cannot be raised.
  • Cold starts are fast, and since August 2025 AWS bills the Lambda init phase.
  • Security review is short. Two packages to approve, pin and scan, where unstructured needs 149. Air-gapped and regulated environments review each dependency individually.
  • The supply-chain surface is small. Most advisories in a large tree come from its transitive dependencies, not from the library you asked for.

Numbers come from scripts/measure.py (exact resolution with uv pip compile, advisory counts from OSV.dev) and from real installs; see Reproducing the numbers. Neither tree had an open advisory against the versions resolved when this was measured; the 701 are historical, which is what a scanner and a triage process work through over time.

Install

pip install "tryworks @ git+https://github.com/ezzcodeezzlife/tryworks"
pip install "tryworks[pdf] @ git+https://github.com/ezzcodeezzlife/tryworks"   # PDF support

Python 3.10 or newer. PDF support adds pypdfium2, bindings to PDFium, the PDF engine used in Chrome. Everything else uses the standard library.

Use

Partition

from tryworks.partition.auto import partition

elements = partition("report.pdf")                      # type from extension or content
elements = partition(file=open("memo.docx", "rb"))      # file objects work too
elements = partition(url="https://example.com/post")    # http(s) URLs

for el in elements:
    print(el.category, el.metadata.page_number, el.text)
# Title 1 Quarterly Operations Memo
# NarrativeText 1 Revenue grew eleven percent year over year, ...
# ListItem 1 Expand the Rotterdam warehouse
# Table 1 Warehouse totals Units Rotterdam KR-1001 1200 ...

Each format also has its own function with unstructured's signature: partition_pdf, partition_docx, partition_pptx, partition_xlsx, partition_html, partition_md, partition_text, partition_csv, partition_tsv, partition_email, partition_json.

Chunk

from tryworks.chunking.title import chunk_by_title
from tryworks.chunking.basic import chunk_elements

chunks = chunk_by_title(elements, max_characters=1000, overlap=100)
chunks = partition("report.pdf", chunking_strategy="by_title", max_characters=1000)

Sections start at each Title, small sections are combined, long text is split at newlines or spaces, and tables get chunks of their own. Tables too large for one chunk are split by row into TableChunk elements that keep valid HTML in metadata.text_as_html.

Serialize

from tryworks.staging.base import elements_to_json, elements_from_json, elements_to_md

json_text = elements_to_json(elements)         # same JSON as unstructured, readable by it
elements = elements_from_json(text=json_text)
markdown = elements_to_md(elements)

Command line

tryworks report.pdf                                   # JSON
tryworks memo.docx --format markdown
tryworks https://example.com/post --format text --chunking-strategy by_title --max-characters 800

Moving from unstructured

Change the package name in your imports:

- from unstructured.partition.auto import partition
- from unstructured.chunking.title import chunk_by_title
+ from tryworks.partition.auto import partition
+ from tryworks.chunking.title import chunk_by_title

For code you can't edit, such as a third-party library that imports unstructured itself, register tryworks under the unstructured import names before that code is imported:

import tryworks
tryworks.alias_as_unstructured()

This only affects imports in the current process. It installs nothing named unstructured.

Formats

Format Extensions Implementation What you get
PDF .pdf PDFium via pypdfium2 Text blocks in reading order (multi-column aware), titles, lists, headers and footers, coordinates, page numbers
Word .docx zipfile + ElementTree Style-based titles and lists, tables with merged cells, section headers and footers, links, bold/italic, page breaks
PowerPoint .pptx zipfile + ElementTree One page per slide, titles, bullets with levels, tables, speaker notes
Excel .xlsx zipfile + ElementTree Each sheet split into sub-tables, captions as text, dates and numbers formatted
HTML .html, .htm html.parser Headings, paragraphs, nested lists, tables, code, images, links, emphasis; navigation and forms dropped
Markdown .md Built-in renderer Same elements as HTML
Text .txt Standard library Paragraphs classified as titles, prose, list items, emails, addresses
CSV, TSV .csv, .tsv csv One table, delimiter detected
Email .eml email Body with sender, recipients, subject and date; attachments partitioned
Elements .json json Elements saved by elements_to_json, from either library

Compatibility with unstructured

A generated corpus with one realistic document per format is partitioned by both libraries and compared element by element (report, script). A workflow repeats the comparison weekly against the latest unstructured release.

Against unstructured 0.27.5:

  • 97% of upstream elements have a tryworks element with identical text,
  • 97% of those have the same element type,
  • 94% have the same element id (ids hash filename, text, page and position, so this also checks ordering),
  • parent_id, filetype, page_number, page_name, link_urls, emphasized_text_contents, header_footer_type, sent_from and subject agree on every aligned element.

Every remaining difference in the report is one of the deliberate differences listed below.

Deliberate differences

Where unstructured tryworks Why
Markdown lists Python-Markdown joins a numbered list with the bullet list after it and turns items next to blank lines into paragraphs Separate lists, every item a ListItem CommonMark behavior; bullets stay bullets
PDF bullets Consecutive bullet lines can merge into one ListItem One ListItem per bullet Each bullet is its own item
PDF columns Text of a right-hand column can come after the page footer Left column, right column, then footer Reading order
PDF coordinates pdfminer glyph boxes PDFium glyph boxes Within about 1 pt
DOCX merged cells 0.27.5 repeats the text in every merged cell colspan / rowspan Matches unstructured's main branch
Language langdetect Script detection plus stopword profiles for 18 languages No model dependency; results can differ on tables and fragments

Not included

  • OCR and layout models. strategy="hi_res" and "ocr_only" raise NotImplementedError, and scanned PDFs without embedded text produce a warning and no elements. Use unstructured or an OCR service for those.
  • Formats: images, audio, .doc, .ppt, .xls, .msg, .rtf, .odt, .epub, .rst, .org, .xml. Unsupported files raise UnsupportedFileFormatError, with a conversion hint.
  • PDF table structure and image extraction. PDF tables come out as text blocks.
  • Pictures in DOCX and PPTX are not emitted as Image elements.
  • Token-based chunking (max_tokens) raises NotImplementedError; use max_characters.
  • Ingest connectors, the hosted API client, and staging bricks for labeling tools.

Text classification uses the same rules as unstructured, but detects verbs with a compact lexicon instead of NLTK. On borderline text such as short fragments, a paragraph can come out as UncategorizedText where unstructured says NarrativeText, or the reverse.

Untrusted documents

Documents are parsed defensively: zip-bomb checks on Office files, rejection of XML entity declarations, and caps on spreadsheet cells, PDF pages, HTML nesting and chunk payloads, all adjustable through environment variables. Only http(s) URLs are fetched. See SECURITY.md.

Reproducing the numbers

# install size, packages and advisories (needs uv)
python scripts/measure.py "unstructured[docx,pptx,xlsx,md,csv,pdf]" "tryworks[pdf] @ ."

# element-by-element comparison
python tests/corpus.py compat/out/corpus
python scripts/compat.py dump tryworks compat/out/corpus compat/out/tryworks.json
python scripts/compat.py dump unstructured compat/out/corpus compat/out/upstream.json   # in an env with unstructured
python scripts/compat.py compare compat/out/upstream.json compat/out/tryworks.json --markdown compat/REPORT.md

Development

pip install -e ".[dev]"
python -m pytest

See CONTRIBUTING.md. The one hard rule: the base install stays dependency-free.

License

Apache-2.0. See LICENSE and NOTICE. tryworks is not affiliated with or endorsed by Unstructured Technologies, Inc.

Metadata

Release files for tryworks 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tryworks 0.1.2
File Size Uploaded Provenance Actions
tryworks-0.1.2.tar.gz 90.8 kB With provenance Details for tryworks-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tryworks 0.1.2
File Interpreter ABI Platform Actions
tryworks-0.1.2-py3-none-any.whl Python 3 none any Details for tryworks-0.1.2-py3-none-any.whl

Total release size: 175.3 kB

Release files / tryworks-0.1.2.tar.gz

Download URL tryworks-0.1.2.tar.gz
Size 90.8 kB
Tags Source
SHA-256 checksum
How to use checksums
251d51098b7fe587c422e40ff4405047d569b5bf3d02908a5bcca6fedb12090d
BLAKE2b-256 checksum
How to use checksums
baedb3b63795ea7d9ef1842e8fd2e0c257e958631fe87240c7e59ec13fa33640
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.

Transparency log

Release files / tryworks-0.1.2-py3-none-any.whl

Download URL tryworks-0.1.2-py3-none-any.whl
Size 84.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cfaa8f942f3a46eff40aef50007ba010f7f53ba564088f1fac5800c8a767636
BLAKE2b-256 checksum
How to use checksums
894b8fb2792c095d999c4925cb914f254c059b09b391a064372af099df658458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.

Transparency log

Security for tryworks 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tryworks-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page