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.1.2.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.1.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: manju_humantime-0.1.2.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.1.2.tar.gz
Algorithm Hash digest
SHA256 7300669e3b448af88a6f28cd9cc9c4985c07591850c4f10e4202538b7e82bca3
MD5 bb7ece9452459db7dccc46629993905a
BLAKE2b-256 4d5ab3eb0ed4b62783547181c8c0db10ea8db063ad028e3442ce98f1b81a7855

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for manju_humantime-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 40902222d4001277593cf857be94b86bebd9ca0008d303210c90f99c2218d5e8
MD5 80cf6fde3b3daf93e0490a33228652ed
BLAKE2b-256 99d269bf707cd3f5169017becfa567b04eb7c101302f355e3e9cfd8d2364b16a

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