python-pybytesize

Parse and format byte sizes across metric and binary units in Python.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/jjjermiah/dot-agents --skill python-pybytesize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-pybytesize
Source: https://github.com/jjjermiah/dot-agents/tree/main/src/dot-agents/skills/python-pybytesize
Command: npx skills add https://github.com/jjjermiah/dot-agents --skill python-pybytesize

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Byte size parsing and formatting in Python often leads to inconsistent results when mixing metric (MB, GB) with binary (MiB, GiB) units, causing subtle bugs and user confusion in apps that display or compute sizes.

Core Features & Use Cases

  • Parse strings like '500MB' or '1.5GiB' into precise byte counts and back, preserving unit distinctions.
  • Convert between metric and binary units and render human-readable representations for logs, UIs, and reports.
  • Support block-aligned calculations with apparent_size to ensure correct sizing for storage and paging scenarios.

Quick Start

Create a ByteSize from a string like '500MB' and print its readable binary and metric forms.

Frequently Asked Questions about python-pybytesize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the difference between metric and binary byte size units when formatting human-readable output?

Byte size parsing distinguishes metric units (MB, GB) from binary units (MiB, GiB) to prevent calculation inconsistencies, ensuring accurate conversions for logs, UI displays, and data processing.

Can I perform block-aligned byte size calculations for storage scenarios using Python?

You format byte sizes for human-readable logs and UI displays by converting precise byte counts back into metric or binary string representations, preventing user confusion in applications.

How do I catch specific parsing exceptions when converting byte size strings in Python?

You can perform block-aligned byte size calculations for storage and paging scenarios in Python using the apparent_size feature, ensuring correct sizing for these specific requirements.

Does this byte size parser require any external dependencies to work?

To catch specific parsing exceptions when converting byte size strings in Python, this Skill satisfies error-handling requirements by identifying invalid formats during the byte size parsing process.