python-humanize
Subpackage Descriptions
| single |
# humanize
[PyPI version]
[Supported Python versions]
[Documentation Status]
[PyPI downloads]
[GitHub Actions status]
[codecov]
[MIT License]
[Tidelift]
This modest package contains various common humanization utilities, like
turning a
number into a fuzzy human-readable duration ("3 minutes ago") or into a
human-readable
size or throughput. It is localized to:
- Arabic
- Basque
- Bengali
- Brazilian Portuguese
- Catalan
- Danish
- Dutch
- Esperanto
- European Portuguese
- Finnish
- French
- German
- Greek
- Hebrew
- Indonesian
- Italian
- Japanese
- Klingon
- Korean
- Latvian
- Norwegian
- Persian
- Polish
- Russian
- Simplified Chinese
- Slovak
- Slovenian
- Spanish
- Swedish
- Turkish
- Ukrainian
- Uzbek
- Vietnamese
## API reference
[https://humanize.readthedocs.io]
## Installation
### From PyPI
```bash
python3 -m pip install --upgrade humanize
```
### From source
```bash
git clone https://github.com/python-humanize/humanize
cd humanize
python3 -m pip install -e .
```
## Usage
### Integer humanization
```pycon
>>> import humanize
>>> humanize.intcomma(12345)
'12,345'
>>> humanize.intword(123455913)
'123.5 million'
>>> humanize.intword(12345591313)
'12.3 billion'
>>> humanize.apnumber(4)
'four'
>>> humanize.apnumber(41)
'41'
```
### Date & time humanization
```pycon
>>> import humanize
>>> import datetime as dt
>>> humanize.naturalday(dt.datetime.now())
'today'
>>> humanize.naturaldelta(dt.timedelta(seconds=1001))
'16 minutes'
|
Configuration Switches (platform-specific settings discarded)
PY313 OFF Build using Python 3.13
PY314 ON Build using Python 3.14
Package Dependencies by Type
Download groups
| main |
mirror://PYPIWHL/b0/aa/0b7365d30fed43e7a3449aba1fe20a0a7174d9cf13e282af4e69ac825441 |
Distribution File Information
353eb2f34c09d098b2880eee8bef21832eae6d174f48c5762fff7e5fcb74d01d 137209 python-src/humanize-4.16.0-py3-none-any.whl
Ports that require python-humanize:v14