Skip to main content

Splitting gettext .po files into smaller

Project description

splitpo

A Python utility for splitting gettext .po files into smaller chunks by entry count and later merging them back together.

Features

  • Split large .po files into manageable chunks of a specified number of entries
  • Merge previously split .po files back into the original format
  • Maintain .po file structure and metadata during split/merge operations
  • Preserve comments, flags, references, and other po file attributes
  • Support for both command-line interface and module execution

Installation

pip install -e .

Usage

Command Line Interface

# Split a .po file into chunks
python main.py split-po input.po --output-dir=./splitted --entries 100

# Join split .po files back together
python main.py join-po splitted/input_part_*.po --output=input.po

Module Execution

# Run split command directly
splitpo input.po --output-dir=./splitted --entries 100

# Run join command directly
joinpo splitted/input_part_*.po --output=input.po

Options

split-po command

  • input_file: Input .po file to split (required)
  • --output-dir: Output directory for split files (default: ./splitted)
  • --entries: Number of entries per split file (default: 100)

join-po command

  • input_files: Input .po files to join, supports wildcards (required)
  • --output: Output .po file (required)

Requirements

  • Python 3.13+
  • No external dependencies

File Structure

Split files are named with the pattern {original_name}_part_{number}.po:

  • input.poinput_part_000.po, input_part_001.po, etc.
  • Number of digits adjusts to file count (minimum 3 digits)
  • Numbering starts from 0

License

MIT License - see LICENSE file for details.

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

splitpo-0.1.0.tar.gz (156.3 kB view details)

Uploaded Source

Built Distribution

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

splitpo-0.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file splitpo-0.1.0.tar.gz.

File metadata

  • Download URL: splitpo-0.1.0.tar.gz
  • Upload date:
  • Size: 156.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for splitpo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e4334af321ad33235ef7bca17d7fe0811bbf380a0a89253999d7830033982ac
MD5 628121e72907a9e0163552ad76ec0f78
BLAKE2b-256 b3202ca17d9617bd88ca4a0d3147d93baf07bc6ece3ba53cdd61f1e552a3e33e

See more details on using hashes here.

File details

Details for the file splitpo-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: splitpo-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for splitpo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64229c080fa09a487524a206cbc51fa75c590f355075b0c81c736a36b37a5bce
MD5 ce2d87aa86a539ab2d840ac32f2326f6
BLAKE2b-256 965db8c8a25714377d60004aab71b40eae4b68420630c9b9bd2a8b38e5ff4fd5

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