Skip to main content

dtTimeFrame

dtTimeFrame is a module that pack time track functions and subprocess call functions into one single class.

Install dtTimeFrame

pip install dttimeframe

Example codes

tag()

from dtTimeFrame.timeFrame import tag # type: ignore

# Initiation
Tool = tag()
Tool.log.name = "log.txt" # filename of the log file, store stdout info
Tool.error.name = "err.txt" # filename of the err file, store stderr info
Tool.extra.name = "log.json" # filename of the extra command record, store time stamp, commands and others info

# start logging and write header into log/err files
Tool.start()

# > your code insert here < 

# print time stamp with personalized msg
Tool.timeStamp("PREVIEW: show something you want to info")

# command runner, base on subprocess.call()
phrase_str = F"echo this command line"
Tool.runCommand(phrase_str)

# command runner with specific output file
phrase_str = F"echo this command line into specific output file: test.txt"
Tool.runCommand(phrase_str,export_file="test.txt")

# > your code insert here < 

# end logging and write footer into log/err files 
Tool.stop()

detector()

from dtTimeFrame.timeFrame import detector # type: ignore

file_be_process_handle = detector(print_func=print,call_func=print)
# "file_be_process_handle = detector(print_func=Tool.timeStamp,call_func=Tool.runCommand)"
# combine use with tag() 
file_be_process_handle.do(target_str="target.txt")
if file_be_process_handle.missing(): # if target.txt missing?
    with open(file_be_process_handle.doing_str,"w") as target_handle: # doing-target.txt
        target_handle.write("Hello world\n")
    file_be_process_handle.done() # rename doing-target.txt as target.txt

print(open(file_be_process_handle.target_str).read())

Release files for dttimeframe 3.6.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dttimeframe 3.6.5
File Size Uploaded
dttimeframe-3.6.5.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dttimeframe 3.6.5
File Interpreter ABI Platform
dttimeframe-3.6.5-py3-none-any.whl Python 3 none any Details

Total release size: 34.3 kB

Release files / dttimeframe-3.6.5.tar.gz

Download URL dttimeframe-3.6.5.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c57cd66ab04c1845b8d365ff59dc4a2f11d69e6450cb819c9a38e252b2c59816
BLAKE2b-256 checksum
How to use checksums
8480d99ca9dccec945c85c910458ba5571e2bf250e2e75a156c2568d56d1553e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / dttimeframe-3.6.5-py3-none-any.whl

Download URL dttimeframe-3.6.5-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00d679a5c8ffe1487db6c2c11f2fcebe436489be06e1e2d9deb7868b60dab349
BLAKE2b-256 checksum
How to use checksums
4b29160a53e5d6fe9510610d19e789c770e15cf46f5433a478ae58febfefe91f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

3.6.5 This release

2 release files

3.6.4

2 release files

3.6.3

2 release files

3.6.2

2 release files

3.6.1

2 release files

3.6.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page