Examples¶
Getting started notebooks¶
Most Frequently Used¶
from terminal_tracker import FrequencyFile
ff = FrequencyFile("zsh_history_file.txt", timeframe=False, shell="zsh")
# Finding the most frequent start command
most_frequent_start_command = ff.find_most_frequent_start()
# Find the top 5 most frequently used start commands
top_frequent_commands = ff.find_top_full(5)
# Printing utility
ff.print_top(type="full", N=10)
# Alias findinf
alias_command = ff.recommend_alias()
Time Analysis¶
from terminal_tracker import TimeAnalysis
tg = TimeAnalysis("zsh_history_file.txt", shell="zsh")
# Search for "2023-02-18", get the dataframe
date_df = tg.search_day("2023-02-18")
Searching¶
from terminal_tracker import SearchFile
sf = SearchFile("bash_history_file.txt")
# Search for "name", get the list of commands
command_list = sf.find("name")
# Search for "name", get the latest command
command = sf.latest("name")
# Using the latest iterator
for command in sf.latest_iterator("name"):
print(command)
Preprocessor¶
from terminal_tracker import Preprocessing
prep = Preprocessing("bash_history_file.txt", shell="bash")