Skip to main content

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

Project description


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

Install dtTimeFrame

pip install dttimeframe

Example codes


from dtTimeFrame.timeFrame import tag # type: ignore

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

# start logging and write header into log/err files

# > your code insert here < 

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

# command runner, base on
phrase_str = F"echo this command line"

# command runner with specific output file
phrase_str = F"echo this command line into specific output file: test.txt"

# > your code insert here < 

# end logging and write footer into log/err files 


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()"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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dttimeframe-3.6.5.tar.gz (17.0 kB view hashes)

Uploaded source

Built Distribution

dttimeframe-3.6.5-py3-none-any.whl (17.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page