timlnx/bitmath ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Python library for working with file sizes like numbers.
I want to be able to create values like bytes, KiB, MiB, GiB, and the SI versions too, then convert between them, compare them, sort them, and do normal math with them. It should support human friendly formatting, automatic best unit selection, string parsing for inputs like 1.5 GiB or 1024 bytes, and it should work nicely with f strings and Python’s format. Please also make sure summing a list of sizes gives a sensible normalized result, and add support for argparse so a command line script can accept file sizes as an input type.
If it fits, include a simple command line tool and a way to check a machine’s storage capacity on Linux and macOS. Use only the Python standard library if possible, and keep the behavior consistent with the examples in the docs. Feel free to look up current docs online if you need to confirm edge cases.
Are you gonna build this?
make sure you review the code using coderabbit