Skip to main content

Human Readable

Project description

Status PyPI Python Version License

Read the documentation at https://human-readable.readthedocs.io/ Tests Codecov

pre-commit Black

Features

  • File size humanization.

  • List humanization.

Requirements

  • It works in Python 3.7+.

Installation

You can install Human Readable via pip from PyPI:

$ pip install human-readable

Usage

Import the lib with:

import human_readable

File size humanization:

human_readable.file_size(1000000)
"1.0 MB"

human_readable.file_size(1000000, binary=True)
"976.6 KiB"

human_readable.file_size(1000000, gnu=True)
"976.6K"

List humanization:

human_readable.listing(["Alpha", "Bravo"], ",")
"Alpha, Bravo"

human_readable.listing(["Alpha", "Bravo"], ",", "and")
"Alpha and Bravo"

human_readable.listing(["Alpha", "Bravo", "Charlie"], ";", "or")
"Alpha; Bravo or Charlie"

Please see the Command-line Reference for details.

Contributing

Contributions are very welcome. To learn more, see the Contributor Guide.

License

Distributed under the terms of the MIT license, Human Readable is free and open source software.

Issues

If you encounter any problems, please file an issue along with a detailed description.

Credits

This project was generated from @cjolowicz’s Hypermodern Python Cookiecutter template.

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

human-readable-0.1.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

human_readable-0.1.0-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

Supported by

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