Skip to main content

Helper class to time python processes

Project description


Basic python package to time processes similar to a stopwatch. This package also includes various pre-formated timestamps for sql, s3 key prefixes, and s3 glues prefixes.

stopWatch basic usage

>>> from time_utils.time_utils import stopWatch
>>> sw = stopWatch()
>>> sw.lap()
Lap 1:
15 second(s)
datetime.timedelta(seconds=15, microseconds=693657)
>>> sw.lap()
Lap 2:
4 second(s)
datetime.timedelta(seconds=4, microseconds=751870)

preformated datetime outputs

All functions default to utcnow(), however a datetime object can be passed in to any function.


>>> tu.time_utils.ts_dict()
'year': '2019', 
'month': '12', 
'day': '29', 
'hour': '00', 
'min': '24', 
'sec': '43'


>>> tu.time_utils.sql_ts()
'2019-12-29 00:25:00'


>>> tu.time_utils.s3_ts()


>>> tu.time_utils.s3_glue_ts()

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

time_utils-1.0.0.tar.gz (2.3 kB view hashes)

Uploaded source

Built Distribution

time_utils-1.0.0-py3-none-any.whl (3.6 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page