Skip to content
masterclass Buddy

Pydantic · Class

ByteSize

ByteSize parses byte-size values such as 3000 KiB into an integer byte count. It can format that count for display or convert it to another unit.

Last updated

Syntax

class Storage(BaseModel):
    size: ByteSize

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • BaseModel
  • human_readable
  • to

Source: Pydantic Types. Checked 2026-11-03.