Saravanan666/pypi-org huggingface dataset:
Package: exectools
exectoolsUsing exectools# reload modules before importing>fromexectoolsimport_import,_from>_import('import foo as bar')>_import('foo as bar')>_import('from foo import bar, kaz')>_from('foo import bar')>_from('foo import bar as kaz')# execfile for python 3>fromexectoolsimportexecfile>execfile('file.py')# make refresh helpers>fromexectoolsimportmake_refresh>refresh_me=make_refresh(__file__)>refresh_me()# unload all modules matching regex pattern>fromexectoolsimportunload>unload('exect')Changelog0.0.1: initial release (2021-09-24)
Package: execute-517
Run a command in a PEP 517 envThis package allows you to run any Python command inside the build environment specified by thepyproject.tomlfile. This may be useful for executing specificsetup.pycommands inside an env where all the dependencies are available.For example to get the version of a package run the following command in the root of the repository:$ execute-517 "setup.py --version"LicenseThis project is Copyright (c) Stuart Mumford and licensed under
the terms of the BSD 3-Clause license. This package is based upon
theOpenastronomy packaging guidewhich is licensed under the BSD 3-clause licence. See the licenses folder for
more information.Lots of the code in this repository is adapted from thebuildpackage which is licensed under the
terms of the MIT license.
Package: executecmd
多线程并发执行远程主机文件复制及远程命令执行======================INSTALL-------ubuntu>>>>>>::git clone https://github.com/ShichaoMa/exec_cmd.gitsudo python setup.py  installorsudo pip install executecmdSTART>>>>>::ubuntu@dev:~$ exec-cmd -husage: exec-cmd [-h] {sftp,smc,ssh} ...ssh or sftp cmd execute.positional arguments:{sftp,smc,ssh}  cmdsftp          use sftp to send or receive files or floders to or fromremote.smc           simple cmd to execute.ssh           use ssh execute cmd in remote.optional arguments:-h, --help      show this help message and exitCommand 'sftp'usage: exec-cmd sftp [-h] [--host-file HOST_FILE] [-p]Command 'smc'usage: exec-cmd smc [-h] --host HOST [--port PORT] -u USER -p PASSWORD -cCOMMANDCommand 'ssh'usage: exec-cmd ssh [-h] [--host-file HOST_FILE] [-f] [-b]DESCRIPTION>>>>>>>>>>>- --host_file 指定配置文件 格式参见: ssh_, scp_。.. _ssh: https://github.com/ShichaoMa/exec_cmd/blob/master/host_file_ssh.. _scp: https://github.com/ShichaoMa/exec_cmd/blob/master/host_file_sftp- stfp 模式- -p 是否显示进度条- ssh 模式- -f 每个远程主机指令集是否顺序执行，或并发执行- -b 是否阻塞进程等待指令集执行完毕，并返回信息- smc 简单命令执行- --host host- --port port- -u username- -p password- -c command
Package: execution-asserts
execution-assertsA collection of asserts for testing performance of the methods.List of assertsassertMaximumExecutionTime(max_execution_time_seconds, func, *args, **kwargs)assertMaximumMemoryUsage(max_memory_usage, func, *args, **kwargs)How to useLook at this sample :import unittest

from execution_assets import ExecutionTest

def my_method(input_parameter):
    pass


class MyTestCase(unittest.TestCase, ExecutionTest):
    def test_execution_time(self):
        self.assertMaximumExecutionTime(0.3, my_method, 'test_value')

    def test_memory_usage(self):
        self.assertMaximumMemoryUsage(12, my_method, 'test_value')
Package: executiontime
executiontimeThis module provides a simple function decorator to display its execution time on the console or in the logs.InstallationSimply install the package withpip:pipinstallexecutiontimeUsageYou simply need to decorate the function and specify a message template.fromexecutiontimeimportprintexecutiontime@printexecutiontime("My function's execution took{0}")defmy_function():passif__name__=='__main__':my_function()By default, the message will be displayed on the console. But it is also possible to specify a log function, for example.fromloggingimportinfo,INFO,basicConfigfromexecutiontimeimportprintexecutiontime@printexecutiontime("My function's execution took{0}",display=info)defmy_function():passif__name__=='__main__':basicConfig(level=INFO)my_function()It is also easy to add a little bit of color:fromexecutiontimeimportprintexecutiontime,LIGHTBLUE@printexecutiontime("My function's execution took{0}",color=LIGHTBLUE)defmy_function():passif__name__=='__main__':my_function()
Package: execution-time-wrapper
Execution Time WrapperA simple package with a few method to get the execution time of methods through wrapping.UsageCurrently, the package contains two methods, one which returns to sdout (print) and one which goes to a logger. The method prints the time in a nice way, i.e. milliseconds, seconds, minutes or hours. For example:fromexecution_time_wrapperimportget_execution_time_print,get_execution_time_log@get_execution_time_printdefmy_fun():print("Hello World!")my_fun()>> Hello World!>> Computation time for my_fun: 0.02 msHowever, if the function takes more time:fromexecution_time_wrapperimportget_execution_time_print,get_execution_time_logfromtimeimportsleep@get_execution_time_printdefmy_fun():sleep(4)print("Hello World!")my_fun()>> Hello World!>> Computation time for my_fun: 4.00 sThe same for the other method given, i.e.get_execution_time_log.TODOs[ ] Implement logger level@2022, Leonardo AlchieriPeople-Centered Computing Lab -Università della Svizzera italiana, Switzerland
Package: executor-exporter
executor-exporterAPrometheusmetrics exporter for Pythonconcurrent.futuresexecutors. Provides instrumented drop-in replacements forThreadedPoolExecutorandProcessPoolExecutor.Public domain photo by Patsy Lynch.More infoInstall it from PyPIpipinstallexecutor-exporterUsagefromexecutor_exporterimportThreadPoolExecutor# orfromexecutor_exporterimportProcessPoolExecutorIf you stick to the public APIs ofconcurrent.futureexecutors (consisting of__init__,submit,mapandshutdownmethods), you just need to replace the builtin executor with its instrumented version provided by this package.The provided executors act asproxiesfor the builtin executor while collecting the following metrics:The__init__methods of the instrumented executors take an additionalexporter_id : Optional[str]parameter, used as the value forexportermetric label. If your use multiple executor instances of the same type you can measure them separately by defining a unique id for each instance. Conversely, by using the same id across multiple instances their metrics will be combined and exported as if they came from a single instance.Custom executorsThe instrumented executors are just wrappers around the builtin executors provided for convenience, whileInstrumentedExecutorProxydoes the heavy-lifting. If you're using a custom executor, you can wrap it like this:fromexecutor_exporterimportInstrumentedExecutorProxy,ExecutorExportermax_workers=42executor=YourCustomExecutor(max_workers)exporter=ExecutorExporter(executor)instrumented_executor=InstrumentedExecutorProxy(executor,exporter,max_workers)TODOTestingHousekeepingMakefilemetrics table genCI/CDcodecov
Package: exec-wrapper
exec-wrapperAllows creating executable wrappers for any executable.
Tested on Linux, Windows.Exampleimportosimportsubprocessfromexec_wrapperimportwrite_exec_wrapperwrapper='/tmp/ssh-wrapper'write_exec_wrapper(wrapper,['ssh','-i','my-key','-o','BatchMode=yes'])subprocess.run(['git','fetch','...'],env={**os.environ,'GIT_SSH':wrapper})
Package: execy
ExecyThe execy@exec_timedecorator is a utility that measures the execution time of a function. It can be used to easily track and log the time taken by a function to execute, both for synchronous and asynchronous functions.Table of ContentsExecyTable of ContentsInstallationUsageInstallationpipinstallexecyUsageTo use the exec_time decorator, follow these steps:fromexecyimportexec_timeimportasyncioimporttime@exec_timedefsync_function():# Simulate a time-consuming synchronous tasktime.sleep(2)@exec_timeasyncdefasync_function():# Simulate a time-consuming asynchronous taskawaitasyncio.sleep(2)# Call the decorated synchronous functionsync_function()# Call the decorated asynchronous functionasyncio.run(async_function())The result will beFunction'sync_function'executedin2.0001089572906494seconds.
Function'async_function'executedin2.001432180404663seconds.
Package: exemelopy
exemelopy aims to be an easy-to-use tool for building an XML
document from native Python data-types without any intervention;
akin to thejsonandsimplejsonmodules, but for XML.This package depends onlxmlto create valid XML output.USAGEfrom exemelopy import XMLEncoder
xml = XMLEncoder({'a': 1, 'b': True, 'spam': 'eggs'}).to_string()
print xmlWhich will return the following output:<?xml version='1.0' encoding='UTF-8'?>
<document>
  <a>1</a>
  <b nodetype="boolean">true</b>
  <spam>eggs</spam>
</document>
Package: exem-logs
LogsLog anything from anywhere.A better and simplified logging system.How it worksInitialise your log with:log = Log()To log info, warning, error or debug use the corresponding methods:log.info("This is an info")
log.warning("This is a warning")
log.error("This is an error")
log.debug("This is a debug")A folder namedlogswill automatically be created at the root of the project.When logging a folder with thecurrent dateas name is created in thelogsfolder, and a file for each script
that as a log is created with the corresponding script as name.ex:logs/2021-05-05/main.logIf you want to change the name of the logfile use:log = Log("my_log_file_name")Theany.logfile in each sublogsfolder contains all the logs from all the scripts.More details inLog.pyIf you are using an old version of python <= 3.6, before installing the library you need to do:pip3 install --upgrade pip
python3 -m pip install --upgrade setuptools
Package: exem-odoo
OdooQuery and send data on a Odoo server.To add this library to your project, from your root project folder simply use:
> git submodule add https://gitlab.com/exem2/libraries/api/odoo.gitYou need your project to be git init to add this project as a submodule.Getting startedCreate your Odoo instance with:odoo = Odoo()Connect to your Odoo with yoururl,database name,user,passwordwith:odoo.connect({ 
    Odoo.URL: "your url", 
    Odoo.DB_NAME: "your db", 
    Odoo.USER: "your user", 
    Odoo.PASSWORD: "your password" 
})And query your data with:get_ids(module, filters, *args)
get_ids_count(module, filters)
get_fields(module, ids, fields, *args)
get_fields_name(module)
set_fields(module, ids, values)
create(module, values)
delete_field(module, ids)
create_attachment(self,attachment)
create_attachment_file(module, obj_id, file_name, file_path)
get_fields_by_conditions(module, filters, fields, **args)Amoduleis in format "my.module"Afieldis in format ["field_name",]Afilteris in format [("fields", "condition", "value"),]AnAttachmentis an inner object of the Odoo classMore details inOdoo.pySet fieldsThere are many ways to set_fields:one2many(0, 0,  { values })    link to a new record that needs to be created with the given values dictionary
(1, ID, { values })    update the linked record with id = ID (write *values* on it)
(2, ID)                remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well)
(3, ID)                cut the link to the linked record with id = ID (delete the relationship between the two objects but does not delete the target object itself)
(4, ID)                link to existing record with id = ID (adds a relationship)
(5)                    unlink all (like using (3,ID) for all linked records)
(6, 0, [IDs])          replace the list of linked IDs (like using (5) then (4,ID) for each ID in the list of IDs)Example:odoo.set_fields("module", ids, {"the_one2many_field": [(0, 0, {'field_name':field_value_record1, ...}), (6, 0, [78, 3])]})many2oneSet the id of the many2one field.Example:odoo.set_fields("module", ids, {"the_many2one_field": 78})AttachmentYou can use The Odoo.Attachment object to transform your file into an Odoo Attachment.Example:my_file = open("my_file_path", "rb")

attachment = odoo.Attachment()
attachment.name = "my_file_name"
attachment.datas = base64.b64encode(my_file.read())
attachment.datas_fname = "my_file_name"
attachment.res_model = "module"
attachment.res_id = module_id_to_attach_to
attachment.mimetype = "application/pdf"

odoo.create_attachment(attachment)Search conditionsWhen you query ids or fields by conditions, you can use the following conditions:like : [('name', 'like', 'John%')]
ilike : [('name', 'ilike', 'John%')]
= : [('product_id', '=', 122)]
in : [('state', 'in', ('draft', 'done'))]
< : [('price_unit', '<', 14.50)]
<= : >[('price_unit', '<=', 14.50)]
> : [('price_unit', '>', 14.50)]
>= : [('price_unit', '>=', 14.50)]
!= : [('product_id', '!=', 122)]Example:odoo.get_ids("type.commentaire", [("name", "ilike", ("2023"))])
Package: exemp1
pacotepypiexmp1Programa que guarda e consulta dadosDependÃªnciasPython 3.6ou posteriorPacotenumpyComeÃ§ando o usoVocÃª vai precisar instalar o pacoteexmp1, para isso basta executar:pip install exmp1FunÃ§Ã£oarmazenamento()- armazena os dados do usuÃ¡rioconsulta()- consulta os dados do usuÃ¡riointeracao()- pede os dados ao usuÃ¡rio
Package: exem-vault
VaultThis project provides a simple, object-oriented Python API for interacting with an HashiCorp's Vault
using the hvac library.How toUsageInitInit the vault api with:vault = Vault("your.token")By default the vault access is set to the local vault server.If the vault is distant you can specify the url with:vault = Vault("your.token", "http://your.vault.url:port")TokenYou can create a token with:vault.create_token("token_name", "policy_name")InteractYou can interact with the vault with the following methods:vault.read("engine_mount_path", "data_path")
vault.write("engine_mount_path", "data_path", {"key": "value"})
vault.delete("engine_mount_path", "data_path", "key_to_delete")PoliciesYou can create a policy with:path_guest = Path("/path/to/secret", Right.GUEST)
path_write = Path("/path/to/other_secret", Right.WRITE)

policy = Policy(path_guest, path_write)And add it to the vault with:vault.add_policy("your_policy_name", policy)If your version of python is >= 3.6 do the following before installing exem-vault:pip uninstall ply
pip uninstall pyhcl
pip install ply
pip install pyhcl
Package: exencolor
ExenColorA modern module for colored output.InstallationThe module is available for installation from PyPI via pip:$pipinstallexencolorExamplesForegroundfromexencolorimportcolored,Colorprint(colored("Hello World!",foreground=Color.GREEN))Backgroundfromexencolorimportcolored,Colorprint(colored("Hello World!",background=Color.BLUE))Decorationsfromexencolorimportcolored,Decorationprint(colored("Hello World!",decoration=Decoration.UNDERLINE))fromexencolorimportcolored,Decorationprint(colored("Hello World!",decorations=[Decoration.UNDERLINE,Decoration.BOLD]))Combinedfromexencolorimportcolored,Decoration,Colorprint(colored("Hello World!",foreground=Color.BRIGHT_CYAN,background=Color.BRIGHT_YELLOW,decoration=Decoration.UNDERLINE))
Package: exendb
ExenDBA simple library that covers sqlite3's basic functionality.Copyright 2022-presentExenifix.
Licensed underMIT License, see LICENSE for details.InstallationUsing pip$python-mpipinstall-Uexendb#or$pipinstall-UexendbFrom source$pipinstall-Ugit+https://github.com/Exenifix/ExenDBQuickstartCreating a tablefromexendbimportDatabase,SQLTypedb=Database('test')table=db.create_table('users',id=SQLType.UNIQUE(SQLType.INT),#column named id with type INT with unique valuename=SQLType.TEXT,#named name, type TEXTsurname=SQLType.TEXT,#named surname, type TEXTis_male=SQLType.BOOL)#named is_male, type BOOLAdding values to table...table.insert_row(151,'John','Wisley',True)table.insert_row(157,'Joe','Astley',True)table.insert_row(651,'Mary','Bart',False)...Getting dict-like values...all_rows=table.get_all_rows()#type: list[dict]single_row=table.get_single_row('id = 151')#type: dict...Updating existing row...table.update('id = 651',name='Marie')...Deleting row...table.delete_row('name = "John" AND surname = "Wisley"')...More examples insample_table.pyClassesDatabaseClass representing a database.Attributesname:strName of the database (without file extension).file_name:strFilename of the database we connect to.tables:property, strList of tables that belong to this database.Methodsget_table(name: str)->TableReturnsTableobject if found in database's tables list.create_table(name: str, **columns: SQLType)->TableCreates a new table and returnsTableobject.delete_table(name: str)Removes an existing table from the database.select(*args, **kwargs)->Union[dict, list]Performs aSELECTquery to the database.TableClass representing a database table. You don't construct this by yourself.Attributesdb:DatabaseThe database this table belongs to.name:strName of the table.columns:property, list[str]List of column names.Methodsrename(new_name: str)Renames the table to a new name.delete()Deletes the table from the database.add_column(name: str, _type: SQLType)Creates a new column with the given name and type.remove_column(name: str)Removes a column with the given name.rename_column(name: str, new_name: str)Renames a column with the given name to a new name.get_single_row(*columns, where: str)Returns a SINGLE row of data indictformat, where keys are column names and values are rows values.get_multiple_rows(*columns, **kwargs)Returns all the rows matching the given conditions.get_all_rows(*columns, **kwargs)Returns all the rows. Equivalent to toget_multiple_rowswithoutwherekwarg.insert_row(*data)Inserts a row into the database for the given column names.update(_where: str = None, **data)Sets the values of the row(s) meeting the condition to the new data.delete_row(where: str):Deletes all the rows in the table meeting the condition.
Package: exendlr
ExenDLRExenifix's Docker Logs ReaderDescriptionModule for reading docker logs for GitHub actions. Includes CLI and program tools.UsageCLI$python3-mexendlr<container-name><stop-phrase># example$python3-mexendlrmy-nice-bot"bot is ready!"CodefromexendlrimportReaderreader=Reader("my-nice-bot","bot is ready!")code=reader.start()ifcode==0:print("Bot was started successfully!")elifcode==1:print("There was an error running the bot!")
Package: exenenv
ExenENVEnvironment variables verifier and type converter.InstallationLibrary is available for installation from PyPI$pipinstallexenenvBasic UsageimportosfromexenenvimportEnvironmentProfileos.environ["REQUIRED_VARIABLE"]="20"# assume it's set to thisclassEnvironment(EnvironmentProfile):REQUIRED_VARIABLE:intDEFAULT_VALUE_VARIABLE:float=30.0env=Environment()env.load()print(f"{env.REQUIRED_VARIABLE=}\n{env.DEFAULT_VALUE_VARIABLE=}")env.REQUIRED_VARIABLE=20
env.DEFAULT_VALUE_VARIABLE=30.0Using EnvVarsimportosfromexenenvimportEnvironmentProfile,EnvVaros.environ.update({"REQUIRED_VAR":"10","ALT_NAME_VAR":"40","CONVERTER_VAR":"gamer,coder,python"})# assume our environment is thisclassEnvironment(EnvironmentProfile):REQUIRED_VAR:intDEFAULT_VALUE_VAR:str=EnvVar(default=20)OTHER_VAR:int=EnvVar(env_name="ALT_NAME_VAR")CONVERTER_VAR:list[str]=EnvVar(converter=lambdax:x.split(","))env=Environment()env.load()print(f"""\{env.REQUIRED_VAR=}{env.DEFAULT_VALUE_VAR=}{env.OTHER_VAR=}{env.CONVERTER_VAR=}""")env.REQUIRED_VAR=10
env.DEFAULT_VALUE_VAR=20
env.OTHER_VAR=40
env.CONVERTER_VAR=['gamer', 'coder', 'python']Union TypehintsSincev1.2, library supports converting toone of provided types.importosfromexenenvimportEnvironmentProfileos.environ.update({"UNION_VAR":"union"})classEnvironment(EnvironmentProfile):UNION_VAR:int|strOPTIONAL_VAR:float|None=Noneenv=Environment()env.load()print(f"{env.UNION_VAR=}\n{env.OPTIONAL_VAR=}")env.UNION_VAR='union'
env.OPTIONAL_VAR=NoneIn this case, converting toUNION_VARtoint, so library used next provided type. Default value forOPTIONAL_VARstill has to be declared explicitly.
Package: exenworldgen
ExenWorldGenModule for quicks maze-like 2D world generationsInstallationLibrary is available on PyPI:$pipinstallexenworldgenCode UsagefromexenworldgenimportWorldworld=World((25,25))data=world.generate()# data can also be obtained via world.dataworld.print()# print the worldCLI Usagepython-mexenworldgen25x25# one world of size 25x25python-mexenworldgen10x1030# 30 worlds of size 10x10
Package: exergi
ExergiThis project is a part of the Datadriven Production & Distribution DepartmentProject Intro/ObjectiveThe purpose of this project is to gather all exergi specific code in one repo and share it easily across the organisation.Modulesaws.s3. Module for S3 related functions such as import, export.aws.rds. Module used to connect, import and export data from PostgreSQL databases on RDS or local docker environment.plot. Common plotting library based on plotly.InstallationA step by step series of examples that tell you how to get a development env runningSay what the step will bepip install exergiTo update exergi package please usepip install --upgrade exergiAutomated release processThis project utilized gitlab ci for automated release process. For more information see the following linkhttps://towardsdatascience.com/setup-version-increment-and-automated-release-process-591d87ea1221Contributing MembersLeads :Kasper JanehagContributor :Johan WållgrenMembers:NameRole[Kasper Janehag]Data Scientist[Johan Wållgren]Data Scientist
Package: exesexe
Inspired by programs that return 1 on success, exesexe lets you wrap a callto an executable and selectively override its return codes. This allows you,for example, to use an aberrant installer with configuration managementsoftware that expects programs to return 0 when successful.exesexe will use the first argument it receives as its own directive, but allother arguments will be executed without modification. The directive is acomma-separated list, where each segment may have one of these forms:```1      whitelist 1 (convert to 0)-1=2   substitute -1 with 25:8=9  substitute 5, 6, 7, and 8 with 9!1     blacklist 1 (don't convert 1 at all; convert everything else to 0)*=3    substitute all others with 3```Examples:* `1,-1,2=3`* Convert 1 and -1 to 0.* Convert 2 to 3.* `!2`* Don't convert 2.* Convert everything else to 0.* `!-4=2`* Don't convert -4.* Convert everything else to 2.* `*=10`* Return 10 no matter what.The precedence order is whitelists, specific substitutions, blacklists,then *-substitutions, so `*=4,1=2,!3` would convert 1 to 2 rather than 4 or 0.The lexical order only matters for overlapping segments, like `1=0,1=2`,where the rightmost segment overrides the left segments.Suppose you want to run the executable `foo`. You could issue any of these:```exesexe 1 foo         # return 0 if foo returns 1exesexe 3=4 foo       # return 4 if foo returns 3exesexe *=0 foo       # always return 0exesexe !2 foo        # return 0 if foo does not return 2exesexe !2,3=4 foo    # if foo returns 3, return 4;# else, if foo does not return 2, return 0;# else, pass back foo's real return code```You can also use exesexe as a library:```pythonimport exesexewhitelist, blacklist, substitutions = exesexe.parse_directive("1,!2,3=4")exesexe.interpret("foo --bar",whitelist=[1],blacklist=[2],substitutions={3: 4, "*": 1})```