Simple quick formatting of time differences
Project description
FormatTimeDiff
Simply accepts a Start Time and End Time variables created with datetime.now(), calculates the time difference, then outputs a nicely formatted output to use with print() statements with the seconds rounded up for half seconds and greater, down for under half seconds.
This can be useful for scripts that you run manually and want to keep track of how long certain actions take, but also want to have more elegant output to quickly reference.
This is my first personal project to understand how creating and deploying modules work mostly. Overall it's very simplistic and "purpose-made" for my personal use across projects, and originally created as just a basic run-of-the-mill definition I used frequently. I figured someone might get some use out of it, and it may open the gates for me to start building more broader modules down the road.
Table of Contents
- Installation
- Execution / Usage
- Technologies
- Features
- Contributing
- Contributors
- Author
- Change log
- License
Installation
On macOS and Linux:
$ python -m pip install formattimediff
On Windows:
PS> python -m pip install formattimediff
Execution / Usage
Here are a few examples of using the formattimediff library in your code:
from formattimediff import formattimediff as ftd
processStart = datetime.now()
print("Start Time:", processStart)
### do some work here ###
### or, to test, run a time.sleep(10.7) to simulate a workload ###
delta = datetime.now()
print("End Time:",delta)
timeElapsed = ftd(processStart, delta)
print("Time Elapsed:",timeElapsed)
#Output:
#Time Elapsed: 0 Hours, 0 Minutes, 11 Seconds
...
Technologies
formattimediff uses the following technologies and tools:
Features
It's really just the one thing it does, no additional features.
Possible formatting options in the future? Who knows?
Contributing
To contribute to the development of formattimediff, follow the steps below:
- Fork < project's name > from https://github.com/Datascripter/FormatTimeDiff/fork
- Create your feature branch (
git checkout -b feature-new) - Make your changes
- Commit your changes (
git commit -am 'Add some new feature') - Push to the branch (
git push origin feature-new) - Create a new pull request
Contributors
Me and only me. I am fresh on the Python bandwagon too...
Author
Cody Walls - "Datascripter" https://github.com/Datascripter/FormatTimeDiff/fork
Change log
- 0.2.5
- Project creation for GitHub and releasing into the wild
- 0.1.0
- First working version
- ...
License
formattimediff is distributed under the MIT license. See LICENSE for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file formattimediff-0.2.7.tar.gz.
File metadata
- Download URL: formattimediff-0.2.7.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
732bd0314542dee48faec393cdc0ec58aa9a6f88d055301a633d76dedaafe467
|
|
| MD5 |
fa8f7fcd8242a5b7f730d84d0443df77
|
|
| BLAKE2b-256 |
c6cf9b178d2d54af68c10be2130528f6f66ee79cfb091ce064b5f79dfb84080b
|
Provenance
The following attestation bundles were made for formattimediff-0.2.7.tar.gz:
Publisher:
python-publish.yml on Datascripter/FormatTimeDiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
formattimediff-0.2.7.tar.gz -
Subject digest:
732bd0314542dee48faec393cdc0ec58aa9a6f88d055301a633d76dedaafe467 - Sigstore transparency entry: 157808089
- Sigstore integration time:
-
Permalink:
Datascripter/FormatTimeDiff@439b971c180362fac6363df8a1ccb4d6bbe426a9 -
Branch / Tag:
refs/tags/v0.2.7 - Owner: https://github.com/Datascripter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@439b971c180362fac6363df8a1ccb4d6bbe426a9 -
Trigger Event:
release
-
Statement type:
File details
Details for the file formattimediff-0.2.7-py3-none-any.whl.
File metadata
- Download URL: formattimediff-0.2.7-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88c9e54d428790ffddc71989e0f060d5819f106c1bf59e2031ad68288710f3e1
|
|
| MD5 |
1a2c2c059759509f2ee2ca4a0b8a66c6
|
|
| BLAKE2b-256 |
385ba7ccc27b4702ec889112f2270c4709d57995b5c3bce57de1258587450981
|
Provenance
The following attestation bundles were made for formattimediff-0.2.7-py3-none-any.whl:
Publisher:
python-publish.yml on Datascripter/FormatTimeDiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
formattimediff-0.2.7-py3-none-any.whl -
Subject digest:
88c9e54d428790ffddc71989e0f060d5819f106c1bf59e2031ad68288710f3e1 - Sigstore transparency entry: 157808093
- Sigstore integration time:
-
Permalink:
Datascripter/FormatTimeDiff@439b971c180362fac6363df8a1ccb4d6bbe426a9 -
Branch / Tag:
refs/tags/v0.2.7 - Owner: https://github.com/Datascripter
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@439b971c180362fac6363df8a1ccb4d6bbe426a9 -
Trigger Event:
release
-
Statement type: