Skip to main content

Portus-Unpack – CLI to unpack & split ChatGPT / Anthropic exports.

Project description

Portus-Unpack  🍱

Unpack & split ChatGPT / Anthropic conversation exports

PyPI

Portus-Unpack turns the gnarly export files produced by OpenAI (ChatGPT)
and Anthropic (Claude) into tidy, human-readable JSON / Markdown archives.

  • zero normalisation – every provider keeps its own field names
  • token-based chunking (--split) so huge chats don’t blow up editors
  • single command works on .zip, folders, or conversations.json
  • cross-platform paths (Windows / macOS / Linux)
  • optional progress bar (tqdm) and auto-open folder on finish

📦 Installation

PyPI (recommended)

pip install portus-unpack           # core
pip install portus-unpack[progress] # + tqdm progress bar

Dev / editable install

git clone https://github.com/PerceivingAI/portus-unpack.git
cd portus-unpack
pip install -e .[progress]

Python 3.8 + required.


🚀 Quick start

# default JSON, 8 000-token split, output to ~/Downloads
portus-unpack MyChatGPTExport.zip

# JSON + Markdown, 6 000-token chunks, write in current dir and open folder
portus-unpack anthropic.json -o . -f both -s 6k --open

# one huge JSON per convo (no split) with timestamps and model names
portus-unpack unzipped_folder -s none -m -M

🛠 CLI reference

flag description
input_path positional. Zip, folder, or conversations.json.
-o, --output DIR Output dir (. = current). Default: ~/Downloads.
-f, --format {json,md,both} Export format (default json).
-s, --split TOKENS Token limit (6k, 8000, none). Default 8k.
-m Add ISO timestamp to each message.
-M Add model name to each message.
--open Open output folder when done.
--verbose Show provider / adapter banner.
-v, --version Show version & exit.

📂 Output layout

Conversation-ChatGPT-2025-04-24_15-59-13/
├── 001_generate_synthetic_time_series_JSON/
│   └── 001_generate_synthetic_time_series_1.json
├── 002_fast_food_frenzy_MD/
│   ├── 002_fast_food_frenzy_1.md
│   └── 002_fast_food_frenzy_2.md
└── index_2025-04-24_15-59-13.txt

Every folder holds all the parts for one conversation.
index_*.txt lists the sub-folder names for quick navigation.


🤖 Providers supported

provider export source detected by notes
ChatGPT Settings ▸ Data Controls ▸ Export Data (conversations.json inside .zip) top-level "mapping" key flattening walks the tree; create_time / update_time converted to ISO
Anthropic Settings ▸ Export conversations top-level "chat_messages" key account block dropped; all other fields kept verbatim

🧑‍💻 Contributing

Pull requests are welcome! Clone, create a venv, run pytest.
Style: black, ruff. Discuss big changes in an issue first.


📜 License

MIT © PerceivingAI

Project details


Download files

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

Source Distribution

portus_unpack-1.0.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

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

portus_unpack-1.0.0-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file portus_unpack-1.0.0.tar.gz.

File metadata

  • Download URL: portus_unpack-1.0.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for portus_unpack-1.0.0.tar.gz
Algorithm Hash digest
SHA256 25204a604f62bdebcc02138d4f83cd6469c79c196b5b84fdf0167acfeb08c764
MD5 beed7c2d2377e81966ee876ac8b34083
BLAKE2b-256 f9c37f1c2e7e897c69b4a352912668f57d433fd2e60a26d78c43029f08c9a6e7

See more details on using hashes here.

File details

Details for the file portus_unpack-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: portus_unpack-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for portus_unpack-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a6c904f78c880d345970ee5a16b5fdafbf995c03ce8eb4e5cf02e77647c09b0
MD5 11f77bbeb8a83161e1d07eb4a38bf592
BLAKE2b-256 9f8b900093549fc17161dedb53ebd88eec9f1dbfb18bd7d9ea03bc5193a076c2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page