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.1.tar.gz (224.7 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.1-py3-none-any.whl (43.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: delos_unichunking-1.5.1.tar.gz
  • Upload date:
  • Size: 224.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.5.1.tar.gz
Algorithm Hash digest
SHA256 00e7fa65acc2962ba8623587004ca397e90f1482e6045ab4b33b1cfc7b31699d
MD5 a524a9dfc5d987a84abaf7b3174ec016
BLAKE2b-256 9843a04c216ea1e66ebad1f6b33f52f5c2b98de5708ddc8a56b24234d4935748

See more details on using hashes here.

File details

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

File metadata

  • Download URL: delos_unichunking-1.5.1-py3-none-any.whl
  • Upload date:
  • Size: 43.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","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.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e229d0e01129b7278f6c460bc2f5b24f14bf6df6849f028c8f40837766c19d7
MD5 b4a0dd1daa72e7960a5e38fd196f31d1
BLAKE2b-256 3f4999816303709e1b494966340bb33874b98567bfc8956cdf21df4ed2f86f9f

See more details on using hashes here.

Release history Release notifications | RSS feed

1.6.0

2 files

This release

1.5.1 This release

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