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.6.0.tar.gz (225.2 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.6.0-py3-none-any.whl (44.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for delos_unichunking-1.6.0.tar.gz
Algorithm Hash digest
SHA256 84148105690bba5b46d09784c393839514c0d8fcffa228875586f28cc2f636aa
MD5 ba31a2fb10a12de1ee2e6cde1b7c13a4
BLAKE2b-256 6a8c4326a71c9b2e3c352bafab1db7726c59f3ac8481d509be3ede2322b5994e

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for delos_unichunking-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 756f7c07a5b40e750d5f7023253d6f880cfb08fdb528ed95a8303eba9c9ca02b
MD5 3c71df2c457e8bfc83e018f37b8e157e
BLAKE2b-256 a5cabbc5bdafe127a62aec3fbbf37673ea3d1aab8842fd06829a68788d5da62b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.6.0 This release

2 files

1.5.1

2 files

1.5.0

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