Saravanan666/pypi-org huggingface dataset:
Package: ezutils
ezutilsUtils to save your time on python codingLife is short we use ezutils !1. Installingpipinstallezutils2. Using files2.1 readlines:readlines(filename: str, strip_newline: bool = True)2.1.1 params:filename: the filename tobe read

strip_newline: strip the last space/newline2.1.2 return lines readed from file2.1.3 Example:lines=readlines(brother_path('cfg.txt'))print(lines)2.2 writelines:writelines(lines: List, filename, append_newline: bool = True)2.2.1 params:lines: lines tobe written
filename: file tobe written
append_newline: add a newline to each line writtend2.2.2 return NoneExample:lines=['hello','ezflines']writelines(lines,brother_path('cfg.txt'))2.3 readstr:readstr(filename: str) -> str2.3.1 params:filename: file tobe read2.3.2 return None2.4 readjson:readjson(filename: str) -> dict2.4.1 params:filename: file tobe read2.4.2 return dict from json parse2.5 DEMOexample/demo_files.py#!/usr/bin/env python3# -*- coding:utf-8 -*-importosfromezutils.filesimportreadlines,writelines,readstr,readjson,list_by_extdefbrother_path(filename):returnos.path.join(os.path.dirname(__file__),filename)defread_as_lines():lines1=readlines(brother_path('cfg.txt'))print(f"lines1:{lines1}")'''lines1:['hello', 'ezflines']'''lines2=readlines(brother_path('cfg.txt'),False)print(f"lines2:{lines2}")'''lines2:['hello\n', 'ezflines\n']'''defwrite_as_lines():lines=['hello','ezflines']writelines(lines,brother_path('cfg.txt'))'''cfg.txt:helloezflines'''writelines(lines,brother_path('cfg_oneline.txt'),False)'''cfg_oneline.txt:helloezflines'''defread_as_string():string=readstr(brother_path('cfg.txt'))print(f"read_as_string:\n{string}")defread_as_json():json_obj=readjson(brother_path('cfg.json'))print(f"read_as_json: type ={type(json_obj)}")images=json_obj["images"]forimageinimages:print(f"read_as_json: image ={image}")deffind_pys():files=list_by_ext('.','py')index=0width=len(f"{len(files)}")forfileinfiles:print(f"[{index:0{width}}]{file}")index+=1if__name__=="__main__":write_as_lines()read_as_lines()read_as_string()read_as_json()find_pys()3 Using progress3.1 print_progressprint_progress(msg, current, max, max_width=60)Demoexample/demo_files.py#!/usr/bin/env python3#demo_progress.pyimporttimefromezutils.progressimportprint_progressif__name__=='__main__':max=100foriinrange(max+1):print_progress("MSG:ABC(%d)"%i,i,max)time.sleep(0.01)TODO:pillow utilsadd roundrect for pillow
see and ANTIALIAScircle_corner
Package: ez-validate
Ez ValidateSimple package for data validation.Examples:Validvar = 10.0
ValidateThat(var).is_float().less_than(12.4).greater_than(9.2)Invalidvar = 5.0
ValidateThat(var).is_float().less_than(12.4).greater_than(9.2)This example will raiseValidationErrorwith the following message:"Untitled var" must be greater than 9.2 but is 5.0You can change the the name of variable by providing it inValidateThatconstractor:ValidateThat(var, name='Your name').is_float().less_than(12.4).greater_than(9.2)Your name must be greater than 9.2 but is 5.0To handle the error use try except clause:try:
	...
except ValidationError as e:
	...Multiple conditionsAndcondition:ValidateThat(var).firts_condition().second_condition().third_condition()Orcondition:either(
	lambda: ValidateThat(var).first_condition(),
	lambda: ValidateThat(var).second_condition(),
	lambda: ValidateThat(var).third_condition()
)You can makecombinationofandandorconditions:var = 1.5
either(
	lambda: ValidateThat(var).is_float().less_than(3.0).greater_than(0.0),
	lambda: ValidateThat(var).is_int().less_than(3).greater_than(0),
	lambda: ValidateThat(var).is_none()
)That would meanvarmust be:floatandgreater than 0andless than 3.0orintandgreater than 0andless than 3orNone
Package: ezvi
ezviezviis a python package that allows typing automation for theVieditor.Installationezviis distributed as a Pip package. To install the program, simply runpipinstallezviUsageThe package can be used via theCLI.ezvifunctions can also be imported and used in a Python program.TheCLIThere are two different ways of usingezvivia the command line.Thetextcommandtextcan be used to type a pre-written file. It takes one argument (infileand one option (--writefile).infileis the path towards the pre-written file.--writefiletells the program to save the file again after typing it.--writefiletakes one argument that corresponds to the path where the typed file will be written.Exampleezvitext-w./foo.txtexample/message.txtThis takes themessage.txtexample from theexampledirectory and types it again. The Vi buffer is then written to./foo.txt.Theyamlcommandyamlshould be used to take a configuration as instructions to type a new file. Theyamlcommand only takes one argument (config). Everything else should be specified in the config file.configis the path towards the configuration file.Exampleezviyamlexample/config.yamlThis command would take theconfig.yamlfile from theexampledirectory and use it to type a new file.Writing a config fileA configuration file is just a yaml file that will be parsed usingPyYAML. The structure of the file should be similar to the one in theconfig.yamlfile from theexampledirectory.-write_line:"Hello!"-new_line:2-write_chars:"--GoodBot."-write_file:"message.txt"-quit_editor:A-must precede every action.DocumentationFor more in depth documentation, please refer to theRead the DocsDevelopmentThis package is in alpha. Not much testing has been done and many things could still change.  To see the latest commit, go check thelatestbranch.
Package: ez-video-convert
ez-video-convertA repo for easily converting videos from one form to another using a command line interface (CLI).Installationpipinstallez-video-convertUsageCopy the path of the.movfile you wish to convert to your clipboard.Open the terminal and simply runmov2mp4The script will produce an.mp4file in the same location as the.movfile.DependenciesThis tool usesffmpegunder the hood, so you will need to have that installed on your systemThe clipboard functionality is provided bypyperclip
Package: ez-webdriver
ez-webdriver一个下载管理浏览器驱动的python库, 优先使用国内镜像源, 单文件少依赖,调用简单,复制即用,可作为 webdriver_manager 库的国内替代获取驱动时,优先用国内镜像源,下载更快下载的驱动永久保存,每次执行时判断旧版本数量,只保留一个旧版本驱动的冗余代码精简,单文件,只需复制 ez_webdriver.py 文件到自己项目即可使用修改方便,如果有新增镜像源,仅需写一个处理镜像源链接的函数即可可以识别arm平台支持的浏览器/For now support:谷歌浏览器/ChromeDriver火狐浏览器/GeckoDriverEdge浏览器/EdgeChromiumDriverIE浏览器/IEDriver演示安装方法1 : pip安装pip install ez-webdriverimportez_webdriverez_webdriver.chrome()# 返回驱动文件绝对路径(str)方法2 : 拷贝ez-webdriver.py文件,直接使用fromez_webdriverimportchrome,firefoxchrome(version='107.0')# 返回指定版本驱动文件绝对路径(str)用法/Usage:谷歌浏览器火狐浏览器Edge浏览器IE浏览器ez_webdriver.chrome()ez_webdriver.firefox()ez_webdriver.edge()ez_webdriver.ie()以上4个方法, 均会返回一个驱动的Path对象,或者False(自动下载对应驱动版本)总之,仅需将上面4个之一赋值给webdriver的位置参数即可正常使用# selenium 4 (省略部分import,见示例)importez_webdriverdriver=webdriver.Chrome(service=Service(ez_webdriver.chrome()))# selenium 3 (省略部分import,见示例)importez_webdriverdriver=webdriver.Chrome(ez_webdriver.chrome())# 其它浏览器同理,仅需更改 ez_webdriver 后的 chrome() 改成对应浏览器即可示例Chrome# selenium 4fromseleniumimportwebdriverfromselenium.webdriver.chrome.serviceimportServiceimportez_webdriver# 导入驱动管理模块# 将 ez_webdriver.chrome() 传递给 server 参数即可driver=webdriver.Chrome(service=Service(ez_webdriver.chrome()))# selenium 3fromseleniumimportwebdriverimportez_webdriver# 导入驱动管理模块# selenium 3 -->直接填入即可driver=webdriver.Chrome(ez_webdriver.chrome())Firfox# selenium 4fromseleniumimportwebdriverfromselenium.webdriver.chrome.serviceimportServiceimportez_webdriver# 导入驱动管理模块# 将 ez_webdriver.firefox() 传递给 server 参数即可driver=webdriver.Chrome(service=Service(ez_webdriver.firefox()))# selenium 3fromseleniumimportwebdriverimportez_webdriver# 导入驱动管理模块# selenium 3 -->直接填入即可driver=webdriver.Chrome(ez_webdriver.firefox())Edge# selenium 4fromseleniumimportwebdriverfromselenium.webdriver.chrome.serviceimportServiceimportez_webdriver# 导入驱动管理模块# 将 ez_webdriver.edge() 传递给 server 参数即可driver=webdriver.Chrome(service=Service(ez_webdriver.edge()))# selenium 3fromseleniumimportwebdriverimportez_webdriver# 导入驱动管理模块# selenium 3 -->直接填入即可driver=webdriver.Chrome(ez_webdriver.edge())IE# selenium 4fromseleniumimportwebdriverfromselenium.webdriver.chrome.serviceimportServiceimportez_webdriver# 导入驱动管理模块# 将 ez_webdriver.ie() 传递给 server 参数即可driver=webdriver.Chrome(service=Service(ez_webdriver.ie()))# selenium 3fromseleniumimportwebdriverimportez_webdriver# 导入驱动管理模块# selenium 3 -->直接填入即可driver=webdriver.Chrome(ez_webdriver.ie())全部函数及实现chrome()返回Path对象或Fase,自动获取浏览器驱动firfox()返回Path对象或Fase,自动获取浏览器驱动edge()返回Path对象或Fase,自动获取浏览器驱动ie()返回Path对象或Fase,自动获取浏览器驱动clear_cache()适用于浏览器驱动文件损坏的情况,将清除下载的驱动文件,估计不会被用上函数参数chrome()firfox()edge()ie()均有如下参数version: 三种参数 auto(匹配当前版本,默认)  latest(最新版本)  x.x.x(指定版本)
path: 可目录(指定放置驱动文件的目录),可文件(指定驱动文件的路径,用文件就是多此一举)
name: 下载的驱动文件名称(下载的文件名,除非镜像源的文件改名了,否则不要改动)
os_type: 默认自动检测,指定只能三选一 'linux'|'win'|'mac'默认值:chrome(version="auto", path=None, name="chromedriver", os_type=None)致谢此模块参考了webdriver_manager的设计思路,添加了国内镜像,每个浏览器均有至少两个下载镜像可用
弃用了缓存过期时间(cache_valid_range)的设定,改为了每次执行时判断是否有旧版本驱动,只保留一个冗余旧版本
弃用类,改用函数的形式,导入模块时不用那么复杂
获取浏览器版本时,优先用注册表,powershell备用(用的它的代码),占用少,响应更快
Package: ezx-pyapi
EZX APIEZX Api Network Client, messages and library functions for sending and receiving orders to the EZX iServer.Installingpipinstallezx-pyapiUsageThe iServer API is not really designed to be run interactively, although it is possible to do it, as shown below.
The easiest way to familiarize yourself with the API is to download and run the sample API app,ezx-sample-py, from Github.importloggingFORMAT='%(asctime)s%(levelname)s: Thread-%(thread)d%(name)s%(funcName)s%(message)s'logging.basicConfig(level=logging.INFO,format=FORMAT,stream=sys.stdout,force=True)fromiserver.netimportConnectionInfo,ApiClientinfo=ConnectionInfo(host='192.168.1.218',company='FEIS',user='igor',password='igor',port=15000)client=ApiClient(info)client.start()# send an orderfromiserver.msgs.convenience_msgsimportNewOrderorder=NewOrder('ZVZZT',1,100,1.25,'SIMU')client.send_message(order)The default message handler just prints the responses from the server.  You can set your own handler as follows:fromiserver.msgs.OrderResponseimportOrderResponseresponses=[]importiserver.netdefmy_msg_handler(msg_subtype:int,msg:EzxMsg):iserver.net.empty_msg_handler(msg_subtype,msg)# print the message# write your handling logic here.responses.append(msg)client._msg_handler=my_msg_handler# normally this is set in the ApiClient constructorclient.send_message(order)Also see theEZX API Quick Start Guidefor more details on the API.
Package: ezy
dokr - Make your docker and ecs tasks easyA Helper pip package for docker and ECS tasks. This pip package helps you automate your CI/CD pipeline. If your using docker and Amazon ECS for deployments, this tool can be really helpful. This package uses aws cli and ecs cli. MakAssumptions:Assuming python is installed on your system.Docker is installed on your systemaws-cliis installed and credentials are configured on your system.ecs-cliis installed on system [For Log Command only]Installdokron your system using :pip install dokrECS Optionslogin into ecs directly (Assuming awscli is installed and configured)dokr ecs loginDeploy an image on a clusterdokr ecs deploy --cluster cluster_name --service service_name --tag image_versionCheck ecs running logs of a Task -  this command will ask for cluster/service and task defination.Note:Install ecs-cli before running this command  from here:https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_CLI_installation.htmldokr ecs logDocker Helper CommandsPrune whole system -  Cleans unused images, containers and volumes.dokr dock --clean-allDelete all the images matching the patterndokr dock --clean pattern_xxxAdd a tag to the existing image matching the provided pattern  (for latest tag only)dokr dock --tag pattern_xxx tag_namePush all images on a system matching a patternThis will push all images matching pattern 'pat'dokr dock --push patAWS CommandsCheck current public ip of a machine on AWSdokr aws --ip jenkinsDevelopment:Clean ununsed:rm -rf build/ dist/ *egg* **.pyc __pycache__Build package:python setup.py bdist_wheeldeploy package:python -m twine upload dist/*follow this link for more detailshttps://dzone.com/articles/executable-package-pip-install
Package: ez-yaml
Installpip install ez_yamlUsageimportez_yaml# to_string(obj, settings={})ez_yaml.to_string({"thing":1,"abc":[1,2,3]})# to_object(file_path, settings={})# to_object(string   , settings={})ez_yaml.to_object(string='''thing: 1abc:- 1- 2- 3''')# to_file(obj, file_path, settings={})ez_yaml.to_file({"thing":1,"abc":[1,2,3]},file_path="./my_file.yaml",)Settingsimportez_yaml# to_string(obj, settings={})ez_yaml.to_string({"thing":1,"abc":[1,2,3]},settings=dict(# these are the default valuessafe=False,width=None,allow_duplicate_keys=True,explicit_start=False,explicit_end=False,explict_null=True,indent_mapping=3,indent_sequence=2,offset=0,))# to_file(obj, file_path, settings={})ez_yaml.to_file({"thing":1,"abc":[1,2,3]},file_path="./my_file.yaml",settings=dict(width=9999999999999,explicit_start=True,explicit_end=True,))Custom Yaml Tags Examplefromez_yamlimportyaml@yaml.register_classclassYourCustomClass:yaml_tag="!python/YourCustomClass"def__init__(self,something):self.something=something@classmethoddeffrom_yaml(cls,constructor,node):# will print trueprint(node.value.startswith("blah blah YourCustomClass(something:"))# node.value is the python-valuereturnYourCustomClass(something=node.value[len("blah blah YourCustomClass(something:")-1:-1])@classmethoddefto_yaml(cls,representer,object_of_this_class):representation=f"blah blah YourCustomClass(something:{object_of_this_class.something})"# ^ needs to be a string (or some other yaml-primitive)returnrepresenter.represent_scalar(tag=cls.yaml_tag,value=representation,style=None,anchor=None)data=[YourCustomClass(['blah blah blah']),YourCustomClass({"thing":"lorem ipsum"}),]# will get generated with a tagoutput=ez_yaml.to_string(data)# will detect tag and convert it back to a YourCustomClassyaml.load(output)
Package: ezyquant
EzyQuant: Powerful Python backtesting for Thai stocksFeaturesBacktestSignal CreatorData ReaderInstallationpipinstallezyquantorpipinstallgit+https://github.com/ezyquant/ezyquantQuick ExampleimportpandasaspdimportezyquantasezfromezyquantimportSETDataReader,backtestfromezyquant.backtestimportContextez.connect_sqlite("ezyquant.db")start_date="2020-01-01"end_date="2020-12-31"initial_cash=1e6# Signalsdr=SETDataReader()trade_date_list=sdr.get_trading_dates(start_date,end_date)signal_df=pd.DataFrame(index=pd.DatetimeIndex(trade_date_list),columns=["AOT"])defbacktest_algorithm(ctx:Context)->float:return100# Backtestreport=backtest(signal_df=signal_df,backtest_algorithm=backtest_algorithm,start_date=start_date,end_date=end_date,initial_cash=initial_cash,pct_commission=0.25,)Backtest report:port_valueport_value_with_dividendpct_net_profit0.0249160.024916cagr0.0250550.025055pct_maximum_drawdown-0.223604-0.223604cagr_divided_maxdd0.1120520.112052pct_win_per_trade1.01.0std0.325820.32582cagr_divided_std0.0768990.076899pct_exposure0.6658730.665873total_commission2483.752483.75initial_capital1000000.01000000.0ending_capital1024916.251024916.25net_profit24916.2524916.25maximum_drawdown-235340.125-235340.125all_trades11avg_profit_loss24916.2524916.25pct_avg_profit_lossNaNNaNavg_bar_held120.0120.0win_trades11total_profit22364.022364.0avg_profit22364.022364.0pct_avg_profit0.022510.02251avg_win_bar_held120.0120.0max_win_consecutive11loss_trades00total_loss0.00.0avg_lossNaNNaNpct_avg_lossNaNNaNavg_lose_bar_heldNaNNaNmax_lose_consecutive00start_date2020-01-0200:00:002020-01-0200:00:00end_date2020-12-3000:00:002020-12-3000:00:00pct_commission0.250.25pct_buy_slip0.00.0pct_sell_slip0.00.0You can find more examples in the examples directory.
Package: ezyrb
EZyRB is a Python package that performs a data-driven model order reduction for parametrized problems exploiting the recent approaches. Such techniques are able to provide a parametric model capable to provide the real-time approximation of the solution of a generic (potentially complex and non linear) problem. The reduced model is totally built upon the numerical data obtained by the original (to reduce) model, without requiring any knowledge of the equations that describe this model, resulting in a well suited framework for industrial contexts due to its natural capability to been integrated with commercial software.
Package: ez-zarr
ez_zarrGoalsThe aim ofez_zarris to provide easy, high-level access
to OME-Zarr filesets (high content screening microscopy data, stored
according to theNGFFspecifications in OME-Zarr with additional metadata fields, for
example the ones generated by theFractalplatform).The goal is that users can write simple scripts working with plates,
wells and fields of view, without having to understand how these
are represented within an OME-Zarr fileset.ExampleYou can useez_zarrfrom the command line to get information about an OME-Zarr fileset:ez_zarr tests/example_data/plate_ones.zarror from within python to get access to all its functionality:# import module
from ez_zarr import hcs_wrappers

# create `plate_3d` object representing an OME-Zarr fileset
plate_3d = hcs_wrappers.FractalZarr('tests/example_data/plate_ones.zarr')

# print fileset summary
plate_3d
# FractalZarr plate_ones.zarr
#   path: tests/example_data/plate_ones.zarr
#   n_wells: 1
#   n_channels: 2 (some-label-1, some-label-2)
#   n_pyramid_levels: 3
#   pyramid_zyx_scalefactor: {'0': array([1. 2. 2.])}
#   full_resolution_zyx_spacing: [1.0, 0.1625, 0.1625]
#   segmentations: 
#   tables (measurements): FOV_ROI_tableA more extensive example is available fromhere, also available as anipynb notebook.InstallThe release version ofez_zarrcan be installed using:pip install ez-zarrThe current (development)ez_zarrcan be installed from github.com using:pip install git+ssh://git@github.com/fmicompbio/ez_zarr.gitSoftware statusContributors and Licenseez_zarris released under the MIT License, and the copyright
is with the Friedrich Miescher Insitute for Biomedical Research
(seeLICENSE).ez_zarris being developed at the Friedrich Miescher Institute for
Biomedical Research by@silvbarband@mbstadler.
Package: ezzdl
ezzdlMultithreaded downloader with textui colored progress barpipinstallezzdlUse>>>fromezzdlimportdl>>>dl(["https://github.com/Cactus-0/cabanchik/raw/master/dist/cabanchik.zip",..."https://github.com/BarsTiger/daun/raw/master/dist/daun.exe",..."https://github.com/BarsTiger/localhost-mc-open/raw/master/localhost_3000_Mc_fusion.exe"],..."folder")[16:20:15]Requestinghttps://github.com/Cactus-0/cabanchik/raw/master/dist/cabanchik.zip[16:20:15]Requestinghttps://github.com/BarsTiger/daun/raw/master/dist/daun.exe[16:20:15]Requestinghttps://github.com/BarsTiger/localhost-mc-open/raw/master/localhost_3000_Mc_fusion.exe[16:20:20]DownloadedD:\Path\To\Folder\folder\daun.exe[16:20:21]DownloadedD:\Path\To\Folder\folder\cabanchik.zip[16:20:32]DownloadedD:\Path\To\Folder\folder\localhost_3000_Mc_fusion.execabanchik.zipв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓ100.0%вЂў13.2/13.2MBвЂў2.2MB/sвЂў0:00:00daun.exeв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓ100.0%вЂў11.4/11.4MBвЂў2.2MB/sвЂў0:00:00localhost_3000_Mc_fusion.exeв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓв”Ѓ100.0%вЂў37.7/37.7MBвЂў2.3MB/sвЂў0:00:00FeaturesAutomatically downloads files from a list of urls and generates its namesWill create a folder with if it doesn't existColored
Package: ez-zk-client
version change0.0.3 add get_children mapping kazoo0.0.2 add ensure_path/exists mapping kazoo0.0.1 fisrt versionez_zk_client installpipinstallez_zk_clientexample connect/disconnectfromez_zk_clientimportZkClientclient=ZkClient(hosts='localhost:2181')#client.connect(wait_connected=True)client.connect()client.disconnect()example create_pathclient.create_node('/pytest','for pytest')example create_ephemeral & get value/statusclient.alive('/pytest/online','create oneline path, offlne auto disapear')val,stat=client.get_data('/pytest/online')example listen nodedefnode_data_change(node_path,data):print('data change:',data)# new dataclient.create_node("/testing/test_listener",'old data')client.add_node_listener("/testing/test_listener",node_data_change)client.set_data("/testing/test_listener","new data")example listen childrendefchildren_change(node_path,data):# fire twice timeprint(data)# children list: ['child1'] in first timeprint(data)# children list: ['child1','child2'] in second timeclient.ensure_path('/testing/listen_children')client.add_children_listener('/testing/listen_children',children_change)client.alive(f'/testing/listen_children/child1')client.alive(f'/testing/listen_children/child2')example lock single resourceclient.alive("/testing/single_resource/ALIVE",'http://localhost:3388')locker=client.lock_single_resource("/testing/single_resource/ALIVE")# locker.path=='/testing/single_resource'withlocker:# auto releaseapi,stat=client.get_data(locker.path)# access apiexample lock pool resourceinserted_path=client.insert_pool_resource('/testing/resource_pool','http://localhost:10001')inserted_path=client.insert_pool_resource('/testing/resource_pool','http://localhost:10002')inserted_path=client.insert_pool_resource('/testing/resource_pool','http://localhost:10003')locker1=client.use_pool_resource('/testing/resource_pool')api1,stat=client.get_data(locker.path)# http://localhost:10001locker2=client.use_pool_resource('/testing/resource_pool')api2,stat=client.get_data(locker.path)# http://localhost:10002locker3=client.use_pool_resource('/testing/resource_pool')api3,stat=client.get_data(locker.path)# http://localhost:10003
Package: ezztui
RequiresCurses, on Linux pre-installed, on windows you need windows-curses, so you can install it withpip install windows-cursesOr just add to your code:importezztuiezztui.check_curses()# not needed if you are using ezztui 2.0.0 or later, it will check for curses automaticallyUseUp-Down Arrow Keys: Move cursor 
Enter: Choose current option 
Backspace: Go backCodingPrint text on center of consoleimportezztuiezztui.center_message("Hello World!")# prints "Hello World!" on the center of the consoleezztui.center_multiline(["Hello","multiline","world!"])# prints "Hello" on the center of the console, then "multiline" on the next line, then "world!" on the next lineClear consoleimportezztuiezztui.cls()# clears the console with a os.system commandezztui.softcls()# clears the console with a multiple newlineMenuUsageimportezztuimenu={'First menu':{'Function 1':'ezztui_return_value',# use 'return' also from 2.0.0'Function 2':'ezztui_return_value',# specify a function to be called from 4.0.0'Function 3':'ezztui_return_value','Function 4':'ezztui_return_value','Function 5':'ezztui_return_value','Back':'ezztui_back_value'},# use 'back' also from 2.0.0'Second menu':{'Submenu 1':{'Function 1':'ezztui_return_value','Function 2':'ezztui_return_value','Function 3':'ezztui_return_value','Function 4':'ezztui_return_value','Function 5':'ezztui_return_value','Back':'ezztui_back_value'},'Submenu 2':{'Function 1':'ezztui_return_value','Function 2':'ezztui_return_value','Function 3':'ezztui_return_value','Function 4':'ezztui_return_value','Back':'ezztui_back_value'},'Submenu 3':{'Function 1':'ezztui_return_value','Function 2':'ezztui_return_value','Function 3':'ezztui_return_value','Back':'ezztui_back_value'},'Submenu 4':{'Function 1':'ezztui_return_value','Function 2':'ezztui_return_value','Back':'ezztui_back_value'},'Back':'ezztui_back_value'},'No submenu function':'ezztui_return_value','Third menu':{'Function 1':'ezztui_return_value','Function 2':'ezztui_return_value','Function 3':'ezztui_return_value','Function 4':'ezztui_return_value','Back':'ezztui_back_value'},'Exit':{"Exit":'ezztui_exit_value',"Back":'ezztui_back_value'}# use 'exit' also from 2.0.0}print(ezztui.menu(menu))# prints the menu and returns name of function and path to it in menu,# You can process this value in your program or add while True (or something else)Returns['Second menu', 'Submenu 2', 'Function 3']