Split any file into exact byte parts
split_any_fileSplits any file into size-capped numbered raw parts and provides a dependency-free rebuild script that verifies the original SHA-256 after concatenation.
Instructions
Byte-level split of ANY file (PDF, video, dataset, CAD, a zip you must not repack, and so on) into numbered raw parts, each <= max_mb / max_bytes. Parts are not zips. Rebuilding concatenates them and checks the original SHA-256. The output folder also contains _agentparcel_bytes.json, HOW-TO-REBUILD.txt, and a dependency-free rebuild.py (Python 3 standard library only) so a receiver can rebuild without AgentParcel. Use split_zip or split_files when you want standalone zip parts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Absolute path of the file to split. Any type. | |
| max_mb | No | Max size of each raw part in MiB. Default 19.5. Ignored when preset is a named preset. | |
| preset | No | Pick the part size from a platform cap. custom (default) uses max_mb/max_bytes. chatgpt-dot: 19,000,000 bytes (under a 20,000,000 byte ChatGPT Dot cap). chat-512: 500,000,000 bytes (under a 512,000,000 byte chat cap; products differ). discord: 24,000,000 bytes for the free 25 MB limit (Nitro is higher and is not this preset). email: 24,000,000 bytes under a common 25 MB attachment cap (other providers differ). github-release: 1,900,000,000 bytes under GitHub's 2 GB release-asset limit. A named preset sets the part size. max_mb is ignored. max_bytes together with a named preset is an error. These limits can change; confirm the current one before a large send. | |
| compress | No | Compress each byte part with zlib (level 6) before the size cap. Off by default. python3 rebuild.py in the folder decompresses these parts with the standard library. | |
| password | No | If set, encrypt each byte part with AES-256-GCM (scrypt key derivation). Requires the cryptography package (pip install agentparcel[crypto]). Off when omitted. The password is never written to the manifest or the log. | |
| max_bytes | No | Exact max size of each raw part in bytes. Overrides max_mb. Minimum 1. Do not combine with a named preset. | |
| output_dir | No | Absolute folder to write into. A new sub-folder '<name>_split' (or ' (2)', ' (3)'... if taken) is created inside it. Default: the folder of the input. | |
| include_apps | No | Also write AgentParcel-apps.zip (AgentParcel for Windows, Mac and Linux, about 0.35 MB; not a part) so a human recipient can rebuild. | |
| create_output_dir | No | Create output_dir if it does not exist (otherwise that is an error). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | No | ||
| parts | No | ||
| set_id | No | ||
| max_bytes | No | ||
| output_dir | No | ||
| part_count | No | ||
| how_to_rebuild | No |