Package: rx7
"rx7" is a library help you code faster and shorter- Most Usefull function and mexthods are collected.- Special features- Simple and easy to understad APIInstallationpip install rx7Upgradepip install --upgrade rx7Here is the brief documentaion:(Complete documentation with details will be added soon in the Wiki section)List of Variables:VariableDescriptionargvsys.argv (return list of given arguments from terminal)ABCParent for classes which have abstractmethodsexitEquivalent sys.exit (returning exit code to terminal)environReturns environment variables in a dictionary formatList of Functions:FunctionDescriptionp()print() function.repeat(function,n)Repeat F_Name function for n times.rev(v)  (REMOVED 2.4.0)Reverse v and returns it. (Everything like str,list,int)read(file)Return content of the file.write(file,mode,text)Write things you want in file content. (Read Doc String)wait(n)sleep(n)Stop code executing for n secondscls()clear()It Clears the Terminalprogressbar() (*removed in v3.1)In-App Progressbar. (Read Doc String)cons_integer(Frst,Lst)Return string from Frst to Lst (Read Doc String) (v1.7)force(tpl,*var)Return tpl with adding var(s) to it.erase(tpl,*var)Return tpl with removing var(s) from it.replace(tpl,ind,var)Replace tpl[ind] with varinsert(tpl,ind,var)Set tpl[ind] to var. (Note that tpl[ind] will be tpl[ind+1])pop(tpl,index)Remove member with index of 'index' from a tuplewait_for(button)Waits for user to press specific button.call_later(func,args,delay)Call func(args) after delay time.convert_bytes(num)convert bytes to (KB,MB,GB,TB)Input(prompt,default)Prompt an input message with default answer (value) (ONLY ON WINDOWS)default_input()Same asdefault_inputrestart_app()Restart running python programactive_window_title()Return Active Window Titleopen_image(path)Open image with default image viewer (Mac OS is not supported)download(url)To download files with memory saver and progressbarextract(file,path,pwd)Extract Zip file with password to pathscreenshot(name)Take a screenshot and save it.func_info(function)Print information of functionCheck_TypeDecorator that raise TypeError if function argument type is wrong (Read Help)Progressbar()Generator of progressbar() which you can use it to do some stuff between your delays (Read Help)pixel_color(X,Y)Return RGB color of pixel[X,Y]getpass(prompt)Prompt for a password, with echo turned off.import_module(path)Return given path (file with any extension) as a ModuleList of Classes:Class Random:Random Variable Generator Class.FunctionDescriptionchoose(iter,k,duplicate)Choose k random items from iterable or string.integer(Frst,Lst)Choose integer in range [Frst,Lst]O1(decimal_nom=17)Return x in interval [0,1)number(Frst,Lst)Return x in interval [Frst,Lst]shuffle(iterable)Return shuffled version of iterableClass System:Some system actions and information.FunctionDescriptionaccname()return account username you have logged in.pid()Get pid number of terminal and return it.disk_usage(path)########chdirChange directory of terminal.SHUT_DOWN()Shut Down the PC.RESTART()Restart the PC.terminal_size()Return terminal size in tuple  (columns,lines).cwd()Return Carrent Working Directory.ip_global()Returns Global IP.ip_local()Returns Local IP.ram_total()Returns total ram of the system.ram_used()Returns Used Space of the ram of the system.ram_free()Returns Available (Free) space of system ram.boot_time()Return system boot time in seconds since the epoch.device_name()Returns Device Nameip_website(url)Returns url ip addresswin10_notification()Display windows 10 notification (READ DOCSTRING) (ONLY WIN10 SUPPORTED)cpu_count(logical=True)Return the number of logical/physical CPUs in the systempyshell_execute_bit()To determine whether Python shell is executing in 32bit or 64bitpids()Return a list of current running PIDspid_exists(pid)Return True if pid exists else Falsecpu_percent()Return the current CPU utilization as a percentageos_name()Returns OS name of machineClass Files: (Staticmethods)Actions and information about files.FunctionDescriptionsize(path)Return size of the file in byte(s). Also work ondelete(path)Use this to delete a file (Not folder).rename(path)Rename files with this function.abspath(path)Return absolute path of given path.exists(path)Return Boolean. If exists True, else: Falsemdftime(path)Get last modify time of the file.acstime(path)Get last access time of the file.move(src,dst)Move file from src to dst. (Read Doc String of copy func)copy(src,dst,metadata=True)Copy file (with metadata) from src to dst. (Also work on folders)hide(path)Hide given path. (It can be file or directory.)read_only(path,mode=True)Make file or folder read-only. (Read Doc String)read(path)Return content of the pathwrite(path,text='',...)Same as write function.isdir(path)Return True for directory and False for others.isfile(path)Return True for file and False for others.is_hidden(path)Check whether path is hidden or notis_readonly(path)Check whether path is readonly or notsearch_file(pattern,path,mode)search for pattern in path (Read function doc string)search_content(path,word)Search for word in all files in path, return list of files that contain wordmkdir(path)Make directory (More than one if its possible!)generate_tree(dir_path)Returns a visual tree of dir_pathget_drives()(Windows only) Get currently available drivesbasename(path)Returns the final component of a pathnamedirname(path)Returns the directory component of a pathnamejoin_paths(path)Joins multiple paths together and returns itMEMBERS (Family)MEMBERS.all_exactdirList of all things those are in exact directoryMEMBERS.files_exactdirList of files which are in exact directoryMEMBERS.dirs_exactdirList of dirs which are in exact directoryMEMBERS.files_allList of files which are in exact directory and all sub-directoriesMEMBERS.files_all_sepList of files which are in exact directory and all sub-directories seprated by their directoriesMEMBERS.dirs_allList of directories (Exact dir and all sub-dirs)MEMBERS.all_all_sepList of everything thing in path (exact dir & sub-dirs)Class Style:Changing text Color,BG & Style. (Read Doc String)FunctionDescriptionprint(*values, color, BG, style, end, sep)Print txt with selected color,BG,style.(Read Doc String)switch(color,BG,style)Change Terminal Attributes Until another Call.switch_default()Restore Terminal Attributes.reset=switch_defaultlog_  (Family)5 Different Style.print with ready color and styleClass Record:Record time of a certain actions. (Read Doc String)FunctionDescriptioninit()Set Start Time.self.stop(self)Stops Recording (You can not lap anymore)self.lap(self, save=True, round=15)Rreturn time between start time. if save==True: add that time to self.lapsself.lapsA list that contains all laps you have doneself.reset(self, start=False)Empty self.laps, if start is True: set start time to nowself.last_lap(save=True)Return elapsed time from last lap (save it in self.laps if save is true)timeit(code,setup, times,globals_)Run the 'code' for 'times' times and return time it needs (all, not once)timer(f)Decorator for functions to print out how much each call takesClass Decorator:Useful decorators you might want to useFunctionDescriptionCheck_TypeDecorator that raise TypeError if function argument type is wrong (Read Help)overloadMake your function accept different kind of argument and structure with defining it more than onceattach_to_allAttach Decorator.decorator_all to all functions of a class (Class decorator)abstractmethodA decorator indicating abstract methods.Class Terminal:functions related to working with terminalFunctionDescriptionrun(command)executescommandlive in terminalgetoutput(commands)runs thecommandin the background and returns the outputsize()Returns the size of terminal in tuple (columns,rows)Class IO:Useful methods when working with user inputFunctionDescriptionwait_for_input(prompt)Asks for user input, until they enter something else than whitespacesselective_input()Check repository wiki for full documentationyesno_input(prompt, default)wait for user to enter one of (yes,no,y,n). (Case insensitive)Input(prompt, default_value)(Windows only) Types default value before getting user's inputgetpass(prompt)Gets users input without showing their input (getpass.getpass())Class Internet:Methods for working with network and internet related stuffsFunctionDescriptionis_connected(website)Check for internet connection with trying to connect towebsiteconnection_checkerDecorator to check if internet is connected before calling the functionip_local()Returns local ipip_global()Returns global ipip_global(website)returns ip of the given websiteurl_exists(url)Checks if a url exists (with requests module) (needs http[s])url_links(URL)Get all links that are used in a specific URL (All "a" tags from html source) (Needs 'http[s]')find_urls(text)returns list of all urls in a string using regexis_url(URL)checks if the string has the expression of a real urlopen_browser(url)opens given url in the new tab of default browserRecommendations:Usingimport rx7 as rxCommands in Terminal:$ python -m rx7 --wiki          (To open wiki page in browser)
$ python -m rx7 --colors        (To show help for style class)
$ python -m rx7 --help          (To open help menu)Releases and Changelog:Take a look atherefor the changelog