Skip to main content

Unichunking

Extract LLM-friendly chunks from any file type.

Supported file types are :

  • DOCX & DOCX-like (DOC, ODT)
  • PPTX & PPTX-like (PPT, ODP)
  • XLSX & XLSX-like (XLS, ODS)
  • TXT, MD, CSV
  • IPYNB

Installation

To install, run the following command:

python3 -m pip install delos-unichunking

How to use

The main functions are :

  • extract_subchunks returns a list of all the text particles in the file.
  • split_chunks_with_overlap transforms a list of subchunks on a given page into a list of chunks following default or specified parameters for minimum/maximum token size and overlap.
  • build_chunked_pages returns a list of "pages", which are lists of formated chunks, following the structure of the document.
  • compute_pages approximates the pagination of a file that does not have a native pagination system (such as DOCX) by comparing it to a PDF version.

Specificities

Please note that the package requires a LibreOffice installation to run soffice commands, used during file conversions : for instance, DOC/ODT are first converted to DOCX format and processed as such.

The page numbers computed for DOCX files are an approximation and can be off by a few pages for large files.

Artifical page numbers are used for page-less structures such as TXT files, or to split large XLSX sheets into multiple pages, to follow a tokens-per-page limit.

Download files

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

Source Distribution

delos_unichunking-1.5.0.tar.gz (223.8 kB view details)

Uploaded Source

Built Distribution

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

delos_unichunking-1.5.0-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file delos_unichunking-1.5.0.tar.gz.

File metadata

  • Download URL: delos_unichunking-1.5.0.tar.gz
  • Upload date:
  • Size: 223.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for delos_unichunking-1.5.0.tar.gz
Algorithm Hash digest
SHA256 9923fd69c62c59b5c15994f42d58430691c6247aa867b1f2bdd3229a58d32058
MD5 eaa8ee6b9f7ea883abc94e8d2832c9a9
BLAKE2b-256 45cf66f971af3cfb4418890966534cc0ae444578af011ef9319008ddafd1e8d2

See more details on using hashes here.

File details

Details for the file delos_unichunking-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: delos_unichunking-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for delos_unichunking-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 193f28a680e736cd4df6e53d90039e0447953b62835972840f6d27d2201bd61a
MD5 77c9f05908a6855b1bf92a4d514ac609
BLAKE2b-256 d9457a4b672bc2010915a94aba1f0651180323ea81c579d461199fe0d1f3c21f

See more details on using hashes here.

Release history Release notifications | RSS feed

1.6.0

2 files

1.5.1

2 files

This release

1.5.0 This release

2 files

1.4.0

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.8.35

2 files

0.8.31

2 files

0.8.30

2 files

0.8.27

2 files

0.8.26

2 files

0.8.25

2 files

0.8.22

2 files

0.8.21

2 files

0.8.20

2 files

0.8.19

2 files

0.8.18

2 files

0.8.17

2 files

0.8.16

2 files

0.8.15

2 files

0.8.14

2 files

0.8.12

2 files

0.8.11

2 files

0.8.10

2 files

0.8.9

2 files

0.8.8

2 files

0.8.7

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

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