Saravanan666/pypi-org huggingface dataset:
Package: easy-ast
easy-astThis packageeasy-astcontains several utility about AST transformer.Installpip install easy-ast.DocumentsAstDecoratorThis example exchange all plus and mult.importastfromeasy_astimport*classPlusMultExchange(AstDecorator):defvisit_BinOp(self,node):ifisinstance(node.op,ast.Add):result=ast.BinOp(left=node.left,op=ast.Mult(),right=node.right)elifisinstance(node.op,ast.Mult):result=ast.BinOp(left=node.left,op=ast.Add(),right=node.right)else:result=nodereturnself.generic_visit(result)@PlusMultExchange()defadd(a,b):returna+bassertadd(2,3)==6Get AST instanceProvideStatementsandExpressionto get the AST instance of code.ExecandEvalis used to exec/eval code directly on ASTimportastfromeasy_astimport*@Expressiondeftree():(x+1)**2assertisinstance(tree,ast.Expression)x=6assertEval(tree)==49Because ofthe limit of python,
executing code will not effect variable in time, which may be solved in the future,
seepep558andpep667.
Currently, the only way to use variable updated in exec is to visit it vialocals()manually,
or use it inside exec content directly.importastfromeasy_astimport*@Statementsdeftree():y=x+1z=y*2assertz==6assertisinstance(tree,ast.Module)x=2Exec(tree)assertlocals()["z"]==6MacroClassMacrois used to create macro. Here is a simple example to do operator directly on python list.importastfromeasy_astimport*classList(Macro):def__init__(self):super().__init__()self.symbol_current=0defvisit_BinOp(self,node):i=f"__list_loop_variable_{self.symbol_current}"self.symbol_current+=1j=f"__list_loop_variable_{self.symbol_current}"self.symbol_current+=1# Return [op(left, right) for i,j in zip(left, right)]returnast.ListComp(elt=ast.BinOp(op=node.op,left=ast.Name(id=i,ctx=ast.Load()),right=ast.Name(id=j,ctx=ast.Load()),),generators=[ast.comprehension(target=ast.Tuple(elts=[ast.Name(id=i,ctx=ast.Store()),ast.Name(id=j,ctx=ast.Store()),]),iter=ast.Call(func=ast.Name(id="zip",ctx=ast.Load()),args=[self.generic_visit(node.left),self.generic_visit(node.right),],keywords=[],),ifs=[],is_async=0,)],)a=[1,2,3]b=[1,2,3]@List().evaldefc():a*bassertc==[1,4,9]Tensor contractThis repository implements an AST transformer for Einstein notation based onMacrofor numpy array.importnumpyasnpfromeasy_ast.tensor_contractimportTensorContractb=np.array([1,2])c=np.array([1,2])expect=-np.array([[1,2],[2,4]])@TensorContract().execdef_(i,j):a[i,j]=-b[i]*c[j]assertnp.all(a==expect)a=np.random.randn(3,2,6,5)b=np.random.randn(3,4)c=np.random.randn(5,4,2)d=np.einsum("ijk,il,klm->mj",a[:,0],b,c)assertd.shape==(2,6)r=np.zeros([6,2,2])@TensorContract().execdef_(i,j,k,l,m):# i3, j6, k5, l4, m2r[j,m,1]=a[i,0,j,k]*b[i,l]*c[k,l,m]-d[m,j]assertnp.sum(np.abs(r))<1e-6It also supports non-standard Einstein notation.importnumpyasnpfromeasy_ast.tensor_contractimportTensorContracta=np.array([1,2])b=np.array([1,2])@TensorContract().execdef_(i):c[i]=a[i]*b[i]assertnp.all(c==[1,4])d=a[i]assertd==3
Package: easy-async
easy_async请你忘记asyncio的存在。这是一个对asyncio进行高度封装的库，让你可以像写同步代码一样写异步代码，支持多线程，多进程。功能功能支援多线程✅多进程✅简单易用✅全局退出管理✅安装pipinstalleasy-async使用importasyncioimportmultiprocessingimportthreadingfromeasy_asyncimportEasyAsync,MISSION# scheduler will initial when every process start,# so different process will have different scheduler#                                                Maximum 4k concurrent mission-taskscheduler=EasyAsync(task_default_type=MISSION,complicating_limit=4096)# if you don't create scheduler before get_scheduler, it will create a scheduler with default params# scheduler = get_scheduler()# when you decorate a function with scheduler.as_mission,# it will be use `scheduler.create_task` when you call it@scheduler.as_missionasyncdefsleep(n):print(f'mission_task: sleep{n}')awaitasyncio.sleep(n)print(f'wake up:{n}')# 在此处不要触发循环，stop之后函数需要返回。ifn==5:print('sys stop')scheduler.stop()# scheduler.stop(force=True)# assign it is a daemon task, the scheduler will stop when all daemon-task finish.# when you call a non-args `scheduler.run` all registered daemon-task will be called.@scheduler.daemon()asyncdefassist():print('assist1 start')print('new_pid: ',multiprocessing.current_process().pid)print('new_tid: ',threading.current_thread().native_id)awaitsleep(1)print('assist1 end')@scheduler.daemon()asyncdefmain():print('main start')print('mian scheduler',scheduler)# start_by_processscheduler.new(assist,method='process')# start mission-task manuallyawaitscheduler.add_mission(sleep(5))# start_by_thread# scheduler.new(assist, method='thread')# just use `scheduler.new` like `Process` or `Thread`awaitasyncio.sleep(3)print('main end')if__name__=='__main__':# run all daemon_task# scheduler.run()# just run main()scheduler.run(main())
Package: easy-audit-farrux
Yet another Django audit log app, hopefully the simplest one.Quick startAdd “easyauditfarrux” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'easyauditfarrux',
]Add easyauditfarrux’s middleware to your MIDDLEWARE (or MIDDLEWARE_CLASSES) setting like this:MIDDLEWARE = (
    ...
    'easyauditfarrux.middleware.easyaudit.EasyAuditMiddleware',
)Run ‘python manage.py migrate easyauditfarrux’ to create the audit models.That’s it! Now every CRUD event on your whole project will be registered in the audit models, which you will be able to query from the Django admin app. Additionally, this app will also log all authentication events and all URLs requested.
Package: easy-augment
Easy AugmentorEnd to end software to capture new objects using RGBD camera and augment them to get a annotated dataset to train deep netsPipeline to artificial generate annotated data for training deep learning models.Pipeline includes starting from capturing images using provided camera (Realsense),
generate semantic labels of the captured image and then generate the artificial images.GUI required for the end user from capturing to labelling and generating new data.RequirementsUbuntu 16.04 (Testing for Ubuntu 18.04)Intel Realsense CameraProcesser intel i5 or higherlibpcl-dev==1.7python 3.5LimitationsNumber of classes captured should be more than or equal to 2.InstallationLinux:pip3installeasy-augmentorRelease History1.0.0First release for crowd testing1.1.0Now user can save RGB, pointcloud, depth, boundingbox, semantic labelContinous mode addedContributorsSantosh Muthireddy              –https://github.com/santoshreddy254Naresh Kumar Gurulingan         -https://github.com/NareshGuru77Deepan Chakravarthi Padmanabhan -https://github.com/DeepanChakravarthiPadmanabhanM.Sc Deebul Nair                -https://github.com/deebulsDistributed under the MLP license. SeeLICENSEfor more information.
Package: easy-auth
Create a centralized Authentication and Authorization token server. Easily secure FastAPI endpoints based on Users, Groups, Roles or Permissions to minimize database access requirements of Auth.Documentationhttps://easyauth.readthedocs.io/en/latest/Key FeaturesCentralized Auth - Single location for Users & Permissions to share across appsGranular Endpoint Security - Verify user identity, and define explicitly who and what each user or groups of users may accessAdmin GUI - easy management of users, permissions, tokens, oauth and more!Advanced JWT - Token Based Client authorization with built in invalidation capabilitiesGoogle Oauth - Easy to configure google loginIntegrated Login & Cookie Management - Users are not just authenticated and authorized, they are re-directed on token expiration to login pages via cookie system and sent back to last location afterwardsQuick Start$virtualenv-p<python3.X>easy-auth-env
$sourceeasy-auth-env/bin/activate(easy-auth)$pipinstalleasy-auth[server](easy-auth)$pipinstalleasy-auth[client]# without dbBasic ServerConfigure require env variables via a .json$cat>server_env.json<<EOF{"DB_TYPE": "sqlite","DB_NAME": "auth","ISSUER": "EasyAuth","SUBJECT": "EasyAuthAuth","AUDIENCE": "EasyAuthApis","KEY_PATH": "/my_key-location","KEY_NAME": "test_key"}EOF#test_server.pyfromfastapiimportFastAPIfromeasyauth.serverimportEasyAuthServerserver=FastAPI()server.auth=EasyAuthServer.create(server,'/auth/token',auth_secret='abcd1234',admin_title='EasyAuth - Company',admin_prefix='/admin',env_from_file='server_env.json')Start Severuvicorn--host0.0.0.0--port8330test_server:serverBasic Client#test_client.pyfromfastapiimportFastAPIfromeasyauth.clientimportEasyAuthClientfromeasyauthimportget_userserver=FastAPI()server.auth=EasyAuthClient.create(server,token_server='0.0.0.0',token_server_port=8090,auth_secret='abcd1234',default_permissions={'groups':['users']})# grants access to users matching default_permissions@server.auth.get('/default')asyncdefdefault():returnf"I am default"# grants access to only specified users@server.auth.get('/',users=['jane'])asyncdefroot():returnf"I am root"# grants access to members of 'users' or 'admins' group.@server.auth.get('/groups',groups=['users','admins'])asyncdefgroups(user:str=get_user()):returnf"{user}is in groups"# grants access to all members of 'users' group# or a groups with role of 'basic' or advanced@server.auth.get('/roles',roles=['basic','advanced'],groups=['users'])asyncdefroles():returnf"Roles and Groups"# grants access to all members of groups with a roles granting 'BASIC_CREATE'@server.auth.get('/actions',actions=['BASIC_CREATE'])asyncdefaction():returnf"I am actions"ServerSee 0.0.0.0:8330/docsGUIClient
Package: easy-automation-test
#easy automation testThis library is to help developer or tester write automation
testcases faster and easier. Include web, api, Android and iOS.
For web UI automation basic framework depends on selenium, Api
test depends on requests library and mobile UI automaton test
depends on Appium.basic commandeasy-automation -h
you can watch all command help.position param:startWebProject/ startApiProject/ startAndroidProject/ startIosProjectprojectNameexample: easy-automation startWebproject web_project_nameyou can create a new project quickly by execute this command.
just like django create project/app, it will auto create project
directory structure.basic modulecore:This module include all base class. base_appium, base_page
and base_request. It is mainly responsible for init test
driver and environment.contribThis module provide some mixin class to help write page class,
that encapsulation some basic selenium or appium find method,
make them easier and more efficient.utilsThis module provide some util class, like custom_logging,
custom_faker, yaml_loader, you can quick prepare test data
or record test log by them.
Package: easyaws
ABOUT EASYAWS:Scripts in easyaws package allow easy access to EC2 and S3 (intended to be used by developers). The goal is to create easy-to-use interfaces, analogous to 'cp', 'ssh', 'scp' (which developers are assumed to be already comfortable with), for EC2 and S3.SETUP EASYAWS:To setup, run 'aws configure' to enter your AWS credentials and configuration. Enter your AWS Access Key ID, AWS Secret Access Key, Default region name and Default output format (as "text").USING EASYAWS:Once you have configured your AWS credentials, you can use following scripts that are installed with 'easyaws' package:1. 'ec2list': List your EC2 instances2. 'ec2ssh':  SSH into EC2 instances using instance name/tagCOMING SOON:I am working on following scripts:1. 'ec2scp': Script to easily 'scp' files to/from EC2 instances.2. 's3cp':   Script to cp files to/from S3 buckets (i.e. 'cp' for S3)
Package: easy-aws
Tool for easy deploying django-projects to Amazon AWS. Just two commands:easy-aws pushandeasy-aws deployQuick startStage 1. InstallingEnsure that have installedpython3-devInstalleasy-aws:pip install easy-awsStage 2. PreparingConfigure boto (enter AWS credentials and select region):easy-aws configure(optional) To specify python module dependencies add filerequirements.txtto django project directory. Example ofrequirements.txt:Django
mock(optional) To specify system dependencies add filesystem-requirements.txtto django project directory. Specified packages will be install viaapt-get install. Example ofsystem-requirements.txt:python3-dev
libpq-devStage 3. Deploying processAll commands should be run in django project directory.Create and setup temporary instance, upload your django project on instance, create image and remove instance:easy-aws pushCreate load balancer, create launch configuration based on the created image and create auto scaling group (auto scaling up to 3 instances when CPU-load > 70):easy-aws deployStage 4. Undeploying processTo remove auto scaling group and launch configuration execute:easy-aws undeploy(optional) To full clean AWS cloud, i.e remove all auto scaling groups, launch configurations, load balancers, images, instances, key pairs and security groups execute:easy-aws cleanOtherShow debug messages, eg:easy-aws -d <command>Print help, eg:easy-aws -h
easy-aws <command> -hCreate VPN-server:easy-aws vpn createTerminate VPN-server:easy-aws vpn terminate
Package: easy-aws-login
easy-aws-loginThe easiest way to log in to your AWS console. Get started by runningpip install easy-aws-loginLeverages the existingaws-cliprofiles that you've already set up.Also clearly shows which profile (hence account) the user is in.to login with your default credentials, type:easy-aws-loginto login with a profile, type:easy-aws-login my-profileto login with a profile and change the default session duration of 3600 seconds, type:easy-aws-login my-profile 7200
Package: easyb
pyeasybPython tools for EASYBus Sensor modules from GMH Messtechnik GmbHFeatureseasyb-tool.py to run commands for a list of devices or reading data continuously.InstallationYou can install unqlite usingpip.pip install easybUsageUsage: easyb-tool.py [options] arg1 arg2

Options:
  -h, --help            show this help message and exit
  -v 1, --verbose=1     run verbose level [0..3]
  -r, --read            read values continuously
  -l, --list            list device and commands
  -i 2.0, --interval=2.0
                        interval between measurements for read mode (in seconds)

  Device Options:
    Set device type, command or address to use.

    -d DEVICE, --device=DEVICE
                        use device
    -c 0, --command=0   run command

  Serial Options:
    Set serial port options.

    -p /dev/ttyUSB0, --port=/dev/ttyUSB0
                        serial port
    -b 4800, --baudrate=4800
                        serial port baudrate
    -t 2, --timeout=2   serial port timeout (in seconds)
    -w 2, --writetimeout=2
                        serial port write timeout
    -o excel/text, --output=excel/text
                        output type
    -f measurement, --filename=measurement
                        filename for output

  Output Options:
    Set output to file.
Package: easybase
EasyBaseEasyBaseis a developer-friendly Python library to interact withApache HBase. The original source code
forked fromHappyBase.Feature highlighteasy usingsupport HBase Thrift 2 protocol(HBase Thrift 1 is NO longer supported)usingthriftpy2instead of
old thriftpyInstallationpipinstalleasybaseUsageConnectimporteasybasehost,port='localhost',9000tbl='test1'conn=easybase.Connection(host=host,port=port)table=conn.table(tbl)rs=conn.scan(limit=10)forrowinrs:print(row)Create Tabletable_def={'cf1':dict(),'cf2':{'max_versions':2000}}conn.create_table('test1',table_def)Write row to tableputs={'cf1:c1':'v1','cf1:c2':'v2''cf2:c2':'v3'}tbl=conn.table('test1')tbl.put(row='rk1',puts)Get row from tablerk='rk1'tbl=conn.table('test1')rs=tbl.row(rk)Scan rowstbl=conn.table('test1')scanner=tbl.scan(row_start='rk_0001',row_stop='rk_0100')forrowinscanner:print(row)Get all namespacefornsinconn.list_namespaces():print(ns)You can get detail inDemoClient.pyLicenseMIT Licensehttp://www.opensource.org/licenses/MIT.
Package: easybase-python
Table of ContentsAbout the ProjectBuilt WithGetting StartedPrerequisitesInstallationUsageRoadmapContributingLicenseContactAbout The ProjectPython library to make REST requests to EasyBase.io. Although this library is not necessary to interface with EasyBase, it makes it Python integration much simpler.Built WithrequestsEasyBase.ioGetting StartedPrerequisitesThis is an example of how to list things you need to use the software and how to install them.pipPython 3Installationpipinstalleasybase-pythonUsagefromeasybaseimportget,post,update,deletelimit=10password="my_integration_pass"get_id="sF7sh78sd_sdf7"get_res=get(get_id,limit=limit,authenticaion=password)print(get_res)# <- JSONRoadmapSee theopen issuesfor a list of proposed features (and known issues).ContributingContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make aregreatly appreciated.Fork the ProjectCreate your Feature Branch (git checkout -b feature/EasybaseFeature)Commit your Changes (git commit -m 'feature')Push to the Branch (git push origin feature/EasybaseFeature)Open a Pull RequestLicenseDistributed under the MIT License. SeeLICENSEfor more information.ContactYour Name -@easybase_io-hello@easybase.ioProject Link:https://github.com/easybase/easybase-python
Package: easybash
Abouteasybash Basher helps you to easily and safely run BASH commands in a Python program using subprocess Popen.It's basically a subprocess Popen wrapper.The idea is to provide an easy way to execute shell commands without compromising safety. Even though it's possible to passshell=Trueto Popen in order to execute complex commands, it's not recommended and it's mostly not needed with this package.Used librariesshlex
subprocess
timeThis package requires no Python third party libraries.InstallationYou can install it directly from PyPi using pip:pip install easybashYou can also install it directly from this repository:pip install git+https://github.com/andreluisos/easybash.gitUsageImportingBasher is an object of easybash. So you can import it with the following code:fromeasybashimportBasherRunning a command and waiting for the execution to endfromeasybashimportBasherBasher('sleep 3')You can add a messagefromeasybashimportBasherBasher('sleep 3',msg='Sleeping for 3 seconds')You can debug the executionfromeasybashimportBasherBasher('sleep 3',msg='Sleeping for 3 seconds',debug=True)You can print the stdout/stderr of the commandfromeasybashimportBasherprint(Basher('ls',msg='Listing files in this dir').stdout)You can do whatever you want with the outputfromeasybashimportBasher[print(line)forlineinBasher('ls').stdout.split()]You don't have to wait for command execution to keep running your codefromeasybashimportBashercmd=Basher('sleep 20',wait=False)print(cmd.pid)Basher will automatically reconize pipes, so you can easily run commandsRedirections are being implemented.fromeasybashimportBasherprint(Basher('ls | wc -l | wc -l').stdout)You can change the current working directoryfromeasybashimportBasherprint(Basher('ls',cwd='/home/andreluisos/test').stdout)You can pass shell=True, but it's not recomended!The idea of the module is to provide an easy way to execute shell commands without compromising safety.
Redirections will be implemented soon.fromeasybashimportBasherBasher('ls',shell=True)
Package: easybill-rest
easybill_rest (py-ebrest)easybill_restis a library to work with the easybill REST API (https://www.easybill.de/api/) written in Python.All Resources are available.The library supports only theBearerAuthentication and calls the API only
throughHTTPS.pipinstalleasybill_restUsagefromeasybill_restimportClientclient=Client("API-KEY")result=client.documents().get_document("2")# Returns the document model. Therefore, a field "title" is included in the dict.print(result['title'])
Package: easy-binary-file
Easy Binary File PackageEasy way to use binary files with built in class and functions.Installation from PYPIYou can find last version of project in:https://pypi.org/project/easy-binary-file/Command to install:pip install easy-binary-fileQuick useSimply import and use functions or classExample of function to dump a single value:fromeasy_binary_fileimportdump_single_valuedump_single_value("test_file_single.tmp","test_value")Example of function to load a single value:fromeasy_binary_fileimportload_single_valuevalue=load_single_value("test_file_single.tmp")print(value)Example of instance of class to dump several values:fromeasy_binary_fileimportEasyBinaryFilewithEasyBinaryFile("test_ebf_object.tmp")asebf:ebf.dump("First value")ebf.dump("Second value")Example of instance of class to read all items:fromeasy_binary_fileimportEasyBinaryFilewithEasyBinaryFile("test_ebf_object.tmp","rb")asebf:foriteminebf:print(item)ImportImport functions, class or all.fromeasy_binary_fileimport*ContentThis is a review of class and functions content inside.The difference between use functions vs class:Functions open and close file in each use (For use a lot, functions are slower than class)Instance of class maintain open the file until end of use (or call toclose)You have complete docstring documentation in code and more examples/tests in doctest format.Functions:dump_ensure_space: Only dump value if space enough in disk.dump_single_value: Open a file in the binary mode, dump a single value and close fileload_single_value: Open a file in the binary mode, load a single value, return it and close filedump_items: Serialize one iterable in a single fileload_items: Deserialize item by item in one stream generatorquick_dump_items: Quick open a file in ab or wb mode and dump items one by one from iterator, when generator is exhausted then close the file.quick_load_items: Quick open a file in rb mode and load items in one generator, when generator is exhausted then close the file.Class:EasyBinaryFile: Open (or create if not exist) a new binary file.close: Close the binary file.dump: Dump one single value in file.dump_ensure_space: Dump one single value in file only if space enough in disk.load: Load from file one single value.get_cursor_position: Get last position of cursor in file.seek: Seek file in position.get_by_cursor_position: Get value by cursor position in file.dump_items: Serialize one iterable in a file.load_items: Deserialize item by item in one stream generator.__iter__: wrap ofload_itemsresult to use directly in aforloop.Is useful for you?Maybe you would be so kind to consider the amount of hours puts in, the great effort and the resources expended in
doing this project. Thank you.
Package: easybird
easybirdEasybirdis python toolkit for Bird Activity Detection (BAD).Setup and InstallWe recommend usingcondafor environment management, since we use conda-forge to install an essential librarylibsndfile. To setup, copy the following command to your terminal.condacreate-nbird
condaactivatebird
condainstall-cconda-forgelibsndfile-yAfter setup the virtual env, install with pip.pipinstalleasybirdSingle WavIdentify bird activities for single waveform.fromeasybirdimportdetectionhasBird,confidence=detection.from_wav('bird.wav')Outputprint(hasBird)>>>Trueprint(confidence)>>>0.9996312260627747Multiple WavsIdentify bird activities for multiple wavforms.fromeasybirdimportdetectionresults=detection.from_wavs(['bird1.wav','bird2.wav','bird3.wav'])Outputprint(results)>>>[(bird1,True,0.99963122),(bird2,True,0.37834975),(bird3,True,0.87340939)]