Skip to main content

High-performance Rust implementation of humanize - turn numbers and dates into human-readable strings

Project description

humanize-rs

High-performance Rust implementation of humanize - turn numbers and dates into human-readable strings.

Overview

humanize-rs is a Rust-powered Python library that makes numbers and dates more human-friendly, providing fast formatting with a simple, intuitive API.

Installation

pip install humanize-rs

Features

  • 🚀 High Performance: Built with Rust for maximum speed
  • 📊 Number Formatting: Format large numbers, file sizes, and more
  • 🕒 Time Humanization: Convert dates to relative time descriptions
  • 🔄 Drop-in Replacement: Compatible with the humanize library
  • 🐍 Python 3.8+: Supports Python 3.8 through 3.14
  • 🌍 Cross-Platform: Pre-built wheels for Linux, macOS, and Windows

Quick Start

from humanize_rs import naturalsize, intcomma, naturaltime
from datetime import datetime, timedelta

# Format file sizes
print(naturalsize(1024))  # "1.0 kB"
print(naturalsize(1024 * 1024))  # "1.0 MB"

# Format large numbers
print(intcomma(1000000))  # "1,000,000"

# Format time differences
now = datetime.now()
past = now - timedelta(hours=2)
print(naturaltime(past))  # "2 hours ago"

Available Functions

  • naturalsize(): Convert bytes to human-readable file sizes
  • intcomma(): Add commas to large numbers
  • naturaltime(): Convert timestamps to relative time
  • scientific(): Format numbers in scientific notation
  • And more!

Performance

humanize-rs delivers significant performance improvements over pure Python implementations, especially when processing large datasets.

License

MIT License

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

humanize_rs-0.1.1-cp314-cp314-win_amd64.whl (124.2 kB view details)

Uploaded CPython 3.14Windows x86-64

humanize_rs-0.1.1-cp313-cp313-win_amd64.whl (124.2 kB view details)

Uploaded CPython 3.13Windows x86-64

humanize_rs-0.1.1-cp312-cp312-win_amd64.whl (124.8 kB view details)

Uploaded CPython 3.12Windows x86-64

humanize_rs-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl (264.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

humanize_rs-0.1.1-cp312-cp312-macosx_11_0_arm64.whl (226.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

humanize_rs-0.1.1-cp311-cp311-win_amd64.whl (124.8 kB view details)

Uploaded CPython 3.11Windows x86-64

humanize_rs-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl (264.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

humanize_rs-0.1.1-cp311-cp311-macosx_11_0_arm64.whl (226.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

humanize_rs-0.1.1-cp310-cp310-win_amd64.whl (124.8 kB view details)

Uploaded CPython 3.10Windows x86-64

humanize_rs-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl (264.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

humanize_rs-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (226.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

humanize_rs-0.1.1-cp39-cp39-win_amd64.whl (128.6 kB view details)

Uploaded CPython 3.9Windows x86-64

humanize_rs-0.1.1-cp39-cp39-manylinux_2_34_x86_64.whl (264.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

humanize_rs-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (227.0 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

humanize_rs-0.1.1-cp38-cp38-manylinux_2_34_x86_64.whl (264.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

humanize_rs-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (226.3 kB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

Details for the file humanize_rs-0.1.1-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 395ff19577a3764d185288dffd5e1a92d4c4e1f6590619f9f615efc6fd57ee93
MD5 012ec72e3d6d746c96d7000c12b7be2e
BLAKE2b-256 c9de1a5749810679c933292cf8d36808d75e3d3469cb993f172cfcb49ea8f229

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ed1e9647470396a9a147b25fe356cdcfebb20bc07b02ca3b233c34987f7204a8
MD5 b6722af3aadf520f1983d4bcf5f35a05
BLAKE2b-256 c116bfe60675d52cf8e27924cac30fc88f8aaff632e414ceb7deca6f3cc468db

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c4b61759f3171e6fbc45a9c93a54dda165c9258eff3c010bea6b28c458703afe
MD5 46b9384d9b773a25b4e6956bc04f029f
BLAKE2b-256 c8093ef802287ce8c223a63c8d0f16a3b3ce065ff812c1980e459e476262c271

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4d3648ceb98181cdefb514be7e1e0213680610d00a12c03a4466d8c7808ad3e3
MD5 9ffcc4f80a53b4733f5e5a9173fd5676
BLAKE2b-256 3a5e063aa6281509ba4b29fe341497262f3bc93aedb3674c66522fa2668c7f3f

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b0716c5a57800822fe135989691531e4fd0875fc8cb53bc860816c74f4c91b25
MD5 16da1a3ac4854fb8cbfd7eaaf81532a8
BLAKE2b-256 1689cbd7ce3874be1367bf6dc6fab670149d4f99df2627f744196623c6c1b69b

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 fe6f60638a0cd882109fb63a828e792b20b79f3bd2234e68b58be7a4c1f4b09d
MD5 2103dfb9dbe6f463b0e7ea0a7991d285
BLAKE2b-256 83a7937a640c27736c24ceb2f37f2704d27658c6b32569712884960673982123

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f1d50c1afc58a36181906a1a20356721fa0340dfb32298e9f74eee591145c410
MD5 a82d777b37106fd30e32818131c1afb2
BLAKE2b-256 abb77a5d169600c8f5d606dd07808d4da846bc1ccbf491e0cb4d38b2d527ab55

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f287c5ed625412f30b55f2d601078edcfbacb6411f76855b2e0b56d70ffada39
MD5 b7b1b878c979a430b9da6f9348c14b7a
BLAKE2b-256 607b47761eb2149694c87ab62044544cd0aa2e2336936387feb3c1909fcc40b6

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 be0656c193a0fa632f62ca05c7f269295a24dfa4a079dc5d4b4b72f5b4f4b302
MD5 3f6f150a1db3bd6bce1000d30aa3cadc
BLAKE2b-256 bfab8f5eb556270e9231c1c0c8debd3c83de2308ff00b2fd3c898d1cccba8cb1

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5e9f01f32b2ca7d170415b68d02d1f84b6090afacc5566bd30a89299e2fb89a5
MD5 fc46638cda86b57a3e82bb6b9959c460
BLAKE2b-256 f7215033113df66be71dd4ec5aa3b91af8aabcbcc3761f52cf1fad4748c7b68f

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6f61488c63d0b8e21dc238b7bf0f290e43635024edb2e7e88739bef6482dcec
MD5 308b15b118f1c43b34d5ae7f78957dc8
BLAKE2b-256 da3b83ff4e2c46409adc2e76754a9771d92f7eb4c9645bd317421cb936c4cabb

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: humanize_rs-0.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 128.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for humanize_rs-0.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 fa28684a8db5fda8d6c81e03595737e03837fead47f5d446cc2318cb756c58a4
MD5 a31ac9ef6b04cea37d40c5856093f452
BLAKE2b-256 ad62aa301588a2467a72a727f3a77c92e6b6ae75a6b41d3f44f00cc68094ee6a

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 80f0d2e3c5a51ffbcfabc33f6b5f5dfbccb7d0424f3c89446c774ae482cecb96
MD5 7d140f682f69569bbc124a8148980aa0
BLAKE2b-256 7effbc687d0f4af848b78d280ec54dd536226431e6f31fa8d0b72baddbd3a138

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 73b554090d675e89eb480d7a345da49954182ed5310155442dcb28cf19ee0f63
MD5 d9a738a2f49e3f3c5d7ce91ef5c15f45
BLAKE2b-256 7560425dc449efac73a77815d3b126dc90dd67076fde51713a671b0abd76ec69

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 88acd84e414343e2cf27c8755f12a935e662db3cbb1d6e6672cb5fa49fccd953
MD5 e4d66801df846f3519b2ad5b953b3a31
BLAKE2b-256 45bc3efaa4e9372c8bea342c49219bac29f8b2037684d0e994fef0f0e8993189

See more details on using hashes here.

File details

Details for the file humanize_rs-0.1.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for humanize_rs-0.1.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9cc7fdd3ad1d86bfb30b589a36d2d1ca0a3c3499263aea1cad855dfdd85eed32
MD5 6256a668f094ca925864f3cede1517e1
BLAKE2b-256 150241352988de5efea64ce9dd793db8aa8884589b191675df392aaca036eab9

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