Skip to main content

A simple utility to humanize time differences.

Project description

📦 manju-humantime

PyPI version Python version License: MIT

A simple Python utility to convert time differences (in seconds) into a human-readable format.


📦 manju-humantime

A simple Python utility to convert time differences (in seconds) into a human-readable format.


✨ Features

  • Convert seconds into a friendly text like in 5 minutes, 2 hours ago, etc.
  • Handles both past and future times.
  • Lightweight and easy to use.
  • No external dependencies.

🛠 Installation

You can install manju-humantime directly from PyPI:

pip install manju-humantime

or if you want to install from TestPyPI (for testing):

pip install --index-url https://test.pypi.org/simple/ manju-humantime

🚀 Usage

from manju_humantime import humanize_time_difference

print(humanize_time_difference(45))          # in 45 seconds
print(humanize_time_difference(3600))         # in 1 hour
print(humanize_time_difference(-86400))       # 1 day ago
print(humanize_time_difference(604800))       # in 1 week

📚 Example Output

Seconds Output
45 in 45 seconds
3600 in 1 hour
-7200 2 hours ago
86400 in 1 day
-604800 1 week ago

🔥 Future Enhancements

  • Add support for months and years.
  • Accept two datetime objects instead of just seconds.
  • Multi-language support (Kannada, Hindi, etc.).

🤝 Contributing

Pull requests are welcome!
For major changes, please open an issue first to discuss what you would like to change.


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgements

Thanks to Python community for inspiration!
Made with ❤️ by Manjunathgouda MH.


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

manju_humantime-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

manju_humantime-0.0.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file manju_humantime-0.0.1.tar.gz.

File metadata

  • Download URL: manju_humantime-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for manju_humantime-0.0.1.tar.gz
Algorithm Hash digest
SHA256 0e18f6b54338bd909997fb9c900884e7e23e93f02de19fc727bf04b6be95474d
MD5 155f8e70ca85e6af6bf79ad9a423ac1f
BLAKE2b-256 a985040bfadb2bc7a8578c732352ef246d81b6df6e73211d52dfc86fcc971023

See more details on using hashes here.

File details

Details for the file manju_humantime-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for manju_humantime-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 904a14ddf6afffeff9357b350eccb766c5dee370895d50bb379b266a7a419c77
MD5 fd00d3010fe741c79443931a6ac93469
BLAKE2b-256 93b0e0b1b51ab4008a40a03a15b3618e84a5d7d2289fe3669e7687d2fc095990

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