Skip to main content

A simple time utility package for getting current time in various formats

Project description

PyClockKit 🕐

A simple, lightweight Python package for getting the current time in various formats. Perfect for learning PyPI package publishing!

Features

  • ⏰ Get current local time in custom formats
  • 🌍 Get current UTC time
  • 📊 Get Unix timestamp
  • 🎯 Simple, intuitive API
  • 📦 Zero dependencies
  • 🐍 Python 3.8+ support

Installation

pip install pyclock-kit

Quick Start

from pyclock import get_time, get_timestamp, get_utc_time

# Get current time (default format)
print(get_time())
# Output: 2025-12-03 22:48:59

# Get time with custom format
print(get_time("%H:%M:%S"))
# Output: 22:48:59

# Get Unix timestamp
print(get_timestamp())
# Output: 1701637739.123456

# Get UTC time
print(get_utc_time())
# Output: 2025-12-03 21:48:59

API Reference

get_time(format=None)

Get the current local time as a formatted string.

Parameters:

  • format (str, optional): Format string for datetime.strftime(). If None, returns "%Y-%m-%d %H:%M:%S".

Returns:

  • str: Current local time as a formatted string.

Examples:

get_time()                    # '2025-12-03 22:48:59'
get_time("%H:%M:%S")          # '22:48:59'
get_time("%B %d, %Y")         # 'December 03, 2025'
get_time("%A, %I:%M %p")      # 'Tuesday, 10:48 PM'

get_timestamp()

Get the current Unix timestamp.

Returns:

  • float: Current time as Unix timestamp (seconds since epoch).

Example:

get_timestamp()  # 1701637739.123456

get_utc_time(format=None)

Get the current UTC time as a formatted string.

Parameters:

  • format (str, optional): Format string for datetime.strftime(). If None, returns "%Y-%m-%d %H:%M:%S".

Returns:

  • str: Current UTC time as a formatted string.

Example:

get_utc_time()  # '2025-12-03 21:48:59'

Development

Setting up development environment

# Clone the repository
git clone https://github.com/yourusername/pyclock-kit.git
cd pyclock-kit

# Install in editable mode with dev dependencies
pip install -e ".[dev]"

Running tests

pytest
pytest --cov=pyclock  # Run with coverage

Code formatting

black .
flake8
mypy pyclock

Building and Publishing

See PUBLISHING.md for detailed instructions on how to build and publish this package to PyPI.

License

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

Contributing

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

Changelog

0.1.0 (2025-12-03)

  • Initial release
  • Basic time retrieval functions
  • Support for custom time formats
  • UTC time support
  • Unix timestamp support

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

pyclock_kit-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

pyclock_kit-0.1.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file pyclock_kit-0.1.1.tar.gz.

File metadata

  • Download URL: pyclock_kit-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyclock_kit-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bdbbf5bd78e8f8170252017903faa749c99d37a923ca3db3c2f1ffeb4f0b8d58
MD5 0569ec3c3daff18decb2abd4ff7f08cd
BLAKE2b-256 152f4a8d76fd86312cdfc0ac20ffa038ad83b79230f0651960a783933b88fb82

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyclock_kit-0.1.1.tar.gz:

Publisher: release.yml on skurzyp/pyclock-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyclock_kit-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyclock_kit-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyclock_kit-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc25e84e10784cfa1a419d04340cb6996a41c3ef1ede174c6e7fa86d998400dd
MD5 31c2ceb999c7fb56a17271d77c4b809e
BLAKE2b-256 63b478c8a462cc4241c6563b894ca7bde368e46d965a8cc853eb82ac06b2fa94

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyclock_kit-0.1.1-py3-none-any.whl:

Publisher: release.yml on skurzyp/pyclock-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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