Skip to main content

A small collection of networking-related utility helpers (demo).

Project description

networking-utils

Small utilities for networking-related scripts. Current focus: a simple Timestamp helper.

What’s included

  • Timestamp class for generating current time in two formats:
    • timestamp: YYYY_MM_DD_HH_MM_SS (good for filenames)
    • time_str: YYYY-MM-DD HH:MM:SS (good for logs/UI)

Source: src/networking_utils/timestamp.py

Installation

pip install networking-utils

Install from TestPyPI (optional):

# Windows PowerShell
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple networking-utils

Usage

from networking_utils.timestamp import Timestamp

ts = Timestamp()
ts.get_timestamp()  # populates fields with the current time

print(ts.timestamp)  # e.g., '2025_10_09_14_23_45'
print(ts.time_str)   # e.g., '2025-10-09 14:23:45'

Practical examples

  • Unique filenames
from pathlib import Path
from networking_utils.timestamp import Timestamp

ts = Timestamp(); ts.get_timestamp()
path = Path(f"backup_{ts.timestamp}.zip")
  • Log lines
from networking_utils.timestamp import Timestamp

ts = Timestamp(); ts.get_timestamp()
print(f"[{ts.time_str}] job started")

Development

# Windows PowerShell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e .[dev]

Build locally:

python -m pip install --upgrade pip setuptools wheel build
python -m build

Versioning

Semantic versioning (MAJOR.MINOR.PATCH).

License

MIT

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

networking_utils-0.1.6.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

networking_utils-0.1.6-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file networking_utils-0.1.6.tar.gz.

File metadata

  • Download URL: networking_utils-0.1.6.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for networking_utils-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d609de433c262524437455be49b04a4ecdf5dd641214f2c7d03cfbf5ee6c9946
MD5 7da290629119e5cd72db3c1cacdd124d
BLAKE2b-256 7314c45cde2bc4766eadb226b6dd3c435f536bc9b39ac6d6f385599ecfcdf3e8

See more details on using hashes here.

File details

Details for the file networking_utils-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for networking_utils-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b6f64cb8686b2757999fd1ad0c5145537a575602b4931a12a7cdc19e69816704
MD5 88aea4508aa75d55f6387059963da257
BLAKE2b-256 1f72bd6e8a8aebed4097aebd204cde296fd99abd414cabf5a3632df173da574b

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