Saravanan666/pypi-org huggingface dataset:
Package: py-easyio
easyioA set of tools to handle file input/output like excel, txt, csv, etc.Read excelAssume you have a xlsx file like this:Sheet1idNameAgeDescription1Peter45A man2Brain22A fooSheet2BookPriceLocationTo kill a mocking bird$9.9Level-2-rack-1Python cookbook$12.9Level-1-rack-2Then if you want to read all sheets:fromeasyioimportExcelReader# Path to xlsx filexlsx_file_path='easyio/excel/tests/test.xlsx'reader=ExcelReader(xlsx_file_path)# Print all sheets rowswithreader:forsheet,rows_ginreader.read_sheets(values_only=True):print(f'sheet:{sheet}')forrowinrows_g:print(row)Output:sheet: Sheet1
('id', 'Name', 'Age', 'Description')
(1, 'Peter', 45, 'A man')
(2, 'Brain', 22, 'A fool')
sheet: Sheet2
('Book', 'Price', 'Location')
('To kill a mocking bird', '$9.9', 'Level-2-rack-1')
('Python cookbook', '$12.9', 'Level-1-rack-2')If you want to print specific sheet:withreader:forrowinreader.read_sheet('Sheet1'):print(row)Output:('id', 'Name', 'Age', 'Description')
(1, 'Peter', 45, 'A man')
(2, 'Brain', 22, 'A fool')Specific the col you want to read:withreader:forrowinreader.read_sheet('Sheet1',cols=['id','Name']):print(row)# You can also specify cols by str like:forrowinreader.read_sheet('Sheet1',cols='id,Name'):...# or with range(1-based, 1:3 means from column 1 to column 2):forrowinreader.read_sheet('Sheet1',cols='1:3'):...# or just specify the column index(1-based)forrowinreader.read_sheet('Sheet1',copls='1,2'):...Output:('id', 'Name')
(1, 'Peter')
(2, 'Brain')Sometime, you do not want to read a xlsx-file with a list of tuples returned, you may want to get a list of dicts.Return rows as list[dict] formatwithreader:forrowinreader.read_sheet_as_dict():print(row)Output:{'id': 1,'Name': 'Peter', 'Age': 45, 'Description': 'A man'}
......You can also specify the headerswithreader:forrowinreader.read_sheet_as_dict(header={'id':'id','Name':'user_name','Age':'user_age','Description':'desc'}):print(row)Output:{'id': 1, 'user_name': 'Peter', 'user_age': 45, 'desc': 'A man'}There are 3 ways to specify header when you want to return a list of dicts:None: If header is None, thefirst rowwill be regarded as headerlist[str]: A list of string. eg:header = ['id', '', 'Name']will read column1 and column3, and ignore column 2dict[str, str]: A map of xlsx-file-header: header-you-want. eg:header = {'Name':'user_name'}will only read columnNameand return with {user_name: ...}
Package: pyeasyremote
pyeasyremotepyeasyremote can be used to control buttons, sliders, pan tilt controls and colorwheels of DMX lighting control software that supports the Easy Remote app. This library was only tested using the Daslight DVC4 software, but should work for other software too. Please let me know if you have tested the library with other software.NOTE: I am not affiliated with LIGHTINGSOFT, Daslight, Nicolaudie Group or any other related companies. This is an unofficial piece of software just for tinkering with Easy Remote using python.UsagefrompyeasyremoteimportEasyRemote# Initialize an EasyRemoteer=EasyRemote("192.168.1.100")# Turn on a button named "My Button" in your lighting softwareer.objects["My Button"].set_state(True)# Set a slider named "My Slider" to 255er.objects["My Slider"].set_value(255)# Set a pan tilt control named "My PanTilt" to the top right cornerer.objects["My PanTilt"].set_pan_tilt(65535,65535)# Set a colorwheel named "My Colorwheel" to red using RGBer.objects["My Colorwheel"].set_rgb(255,0,0)# Set a colorwheel named "My Colorwheel" to red using HSVer.objects["My Colorwheel"].set_hsv(0.0,1.0,1.0)In the case that initialization fails due to a timeout on the response from
your lighting software, the objects dict will be empty.
Package: py-easy-rest
py-easy-restIt is a lib to create fast and scalable rest apis based on JSON schema in a very simple way.
It is based onSanicand it has built in extensions to add repositories and caches.Getting StartedHow to installpip install py-easy-restCoding your appIt will use by default an in memory repository. It is not recommended to production applications.
The next sections of this documentation will show you ways to integrate your application with Mongo DB and ways to use cache strategies.
You can also create your own repositories and cache strategies to integrate your app with other technologies.PYRSanicAppBuilder.buildreturns aSanic App, so you can use it to extend and build new things in your app.#main.pyfromsanic_extimportExtendfrompy_easy_restimportPYRSanicAppBuilderfrompy_easy_rest.serviceimportPYRServiceconfig={"name":"ProjectName","schemas":[{"name":"Mock","slug":"mock","properties":{"name":{"type":"string"},"age":{"type":"integer"},},"required":["name"],}]}service=PYRService(config)sanic_app=PYRSanicAppBuilder.build(config,service)Extend(sanic_app)sanic_app.run(host='0.0.0.0',port=8000,debug=True,)Running itpython main.pyNow you can accesshttp://localhost:8000/docsto access your api documentation.Integrating with RepositoriesIt is possible to add a repository to your application persist data into some data base.
By default it will use a in memory repository, witch is not recommended to production environment.To create your own repository, you just need to follow theReposignature and pass it to the App:service=PYRService(api_config_mock,repo=MyOwnRepo())Repos ready to useMongo with Motor clientIntegrating with Cache StrategiesIt is possible to add a cache to your application.
By default it will not use a cache, but you can choice a built in option or create your own cache.To create your own cache, you just need to follow theCachesignature and pass it to the App:service=PYRService(api_config_mock,cache=MyOwnCache())Caches ready to useRedisMemoryAPI Descriptionpy_easy_rest.PYRSanicAppBuilder.build()PropertiesRequiredDefaultDescriptionapi_configTrueNoneObject with project and schemas configserviceTruePYRService()Service use to handle the operationspy_easy_rest.services.PYRService()PropertiesRequiredDefaultDescriptionapi_configTrueNoneObject with project and schemas configrepoFalsePYRMemoryRepo()Repository used as data resourcecacheFalsePYRDummyCache()Cache strategycache_list_seconds_ttlFalse10TTL to cache the list results in secondscache_get_seconds_ttlFalse60 * 30TTL to cache the get results
Package: py-easy-rest-memory-cache
py-easy-rest-memory-cacheCache lib to use withpy-easy-restGetting StartedHow to installpip install py-easy-rest py-easy-rest-memory-cacheIntegrating with yourpy-easy-restapp#main.pyfrompy_easy_restimportPYRSanicAppBuilderfrompy_easy_rest.serviceimportPYRServicefrompy-easy-rest-memory-cacheimportPYRMemoryCacheconfig={"name":"Project Name","schemas":[{"name":"Mock","slug":"mock","properties":{"name":{"type":"string"},"age":{"type":"integer"},},"required":["name"],}]}cache=PYRMemoryCache()service=PYRService(api_config_mock,cache=cache)sanic_app=PYRSanicAppBuilder.build(api_config_mock,service)sanic_app.run(host='0.0.0.0',port=8000,debug=True,)
Package: py-easy-rest-mongo-motor-repo
py-easy-rest-mongo-motor-repoMongo repo to use withpy-easy-restGetting StartedHow to installpip install py-easy-rest py-easy-rest-mongo-motor-repoIntegrating with yourpy-easy-restappMongo Repository#main.pyfrommotor.motor_asyncioimportAsyncIOMotorClientfrompy_easy_restimportPYRSanicAppBuilderfrompy_easy_rest.serviceimportPYRServicefrompy_easy_rest_mongo_motor_repoimportPYRMongoRepoconfig={"name":"Project Name","schemas":[{"name":"Mock","slug":"mock","properties":{"name":{"type":"string"},"age":{"type":"integer"},},"required":["name"],}]}repo=PYRMongoRepo()service=PYRService(api_config_mock,repo=repo)sanic_app=PYRSanicAppBuilder.build(api_config_mock,service)@sanic_app.listener('before_server_start')definit(app,loop):mongo_db_instance=AsyncIOMotorClient("mongodb://localhost:27017/db")db=mongo_db_instance.get_default_database()repo.set_db_connection(db)sanic_app.run(host='0.0.0.0',port=8000,debug=True,auto_reload=True,)
Package: py-easy-rest-redis-cache
py-easy-rest-redis-cacheCache lib to use withpy-easy-restGetting StartedHow to installpip install py-easy-rest py-easy-rest-redis-cacheIntegrating with yourpy-easy-restapp#main.pyfrompy_easy_restimportPYRSanicAppBuilderfrompy_easy_rest.serviceimportPYRServicefrompy_easy_rest_redis_cacheimportPYRRedisCacheconfig={"name":"Project Name","schemas":[{"name":"Mock","slug":"mock","properties":{"name":{"type":"string"},"age":{"type":"integer"},},"required":["name"],}]}cache=PYRRedisCache("redis://localhost")service=PYRService(api_config_mock,cache=cache)sanic_app=PYRSanicAppBuilder.build(api_config_mock,service)sanic_app.run(host='0.0.0.0',port=8000,debug=True,)
Package: pyeasyrpc
PyEasyRPCPyEaseRPC is a Python RPC framework easy to use, which using Redis as backend.ExampleServer# example_server.py
from pyeasyrpc.rpc import remote_method
from pyeasyrpc.rpc import RPCService


class ServiceInstance(RPCService):
    @remote_method
    def add(self, a, b):
        return a + b

    @remote_method
    def sub(self, a, b):
        return a - b

    @remote_method
    def make_dict(self, **kwargs):
        return dict(kwargs)

    @remote_method
    def make_list(self, *args):
        return list(args)


def main():
    instance0 = ServiceInstance(process_request_in_thread=True)
    instance0.start_background_running()

    input("press any key to stop")

    instance0.stop_background_running()


if __name__ == '__main__':
    main()Client# example_client.py
from pyeasyrpc.rpc import RPCClient


def main():
    client = RPCClient("ServiceInstance")
    print("method_list", client.get_methods())

    print("add", client.add(1, 2))
    print("sub", client.sub(100, 1.1))
    print("make_dict", client.make_dict(a=1, b=2, c=3))
    print("make_list", client.make_list(1, [2], {3}))

    try:
        client.add()
    except Exception as ex:
        print(type(ex), ex)


if __name__ == '__main__':
    main()Async Client# example_client_async.py

import asyncio
from pyeasyrpc.rpc import AsyncRPCClient


def main():
    client = AsyncRPCClient("ServiceInstance")
    print("method_list", client.get_methods())

    async def add():
        print("add", await client.add(1, 2))

    async def sub():
        print("sub", await client.sub(100, 1.1))

    async def make_dict():
        print("make_dict", await client.make_dict(a=1, b=2, c=3))

    async def make_list():
        print("make_list", await client.make_list(1, [2], {3}))

    async def catch_exception():
        try:
            await client.add()
        except Exception as ex:
            print(type(ex), ex)

    async def func():
        task = [add(), sub(), make_list(), make_dict(), catch_exception()]
        # task.extend([add() for i in range(100)])
        # task.extend([sub() for i in range(100)])
        # task.extend([make_list() for i in range(100)])
        # task.extend([make_dict() for i in range(100)])
        # task.extend([catch_exception() for i in range(100)])
        await asyncio.wait(task)

    loop = asyncio.get_event_loop()
    loop.run_until_complete(func())


if __name__ == '__main__':
    main()
Package: py-easy-scrap
Py-Easy-ScrapDescriptionA useful package for web scraping with SeleniumInstallationpipinstallpy-easy-scrapRequirementsPython 3.7 or higherSelenium, along withGeckoDriver(Firefox)UsageIn your project directory, create a new directory for your logs - it can be just called 'logs':mkdirlogsThen, import the package:importpyeasyscrapaspesGet WebDriverdriver=pes.get_webdriver(headless)This will return an instance of webdriver.Firefox (GeckoDriver).Get Elementelement=pes.get_element(driver,value="element_xpath")This will return the web element found using the specified driver and value. By default, this function uses 'XPATH' as the method of searching. However, you can change this by providing 'ID' or 'LINK_TEXT' as the 'by' argument.Please be aware that the method of searching ('XPATH', 'ID', or 'LINK_TEXT') highly depends on the webpage structure. Therefore, it is essential to inspect the webpage beforehand.Also, please remember to replace"element_xpath"with the actual Xpath, ID, or link text of the element you want to find.Scroll to Elementpes.scroll_to(driver,element)This will use JavaScript to scroll the view of the given webdriver to the specified web element.Ask for Datarequired_data=("username","password")file_name_no_extension="user_credentials"pes.ask_for_data(required_data,file_name_no_extension)This will return a dictionary containing the collected data and will create a JSON configuration (.conf) file.Check Filepes.check_file("path_to_file")This will return either True or False based on file existencePlease note that the above code snippets are basic examples of how to use those functions. Depending on the exact specifications of your use case, additional setup may be necessary (e.g. logging into a website before trying to scroll to an element).ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseMIT
Package: py-easy-scrape
Py-Easy-ScrapeDescriptionA useful package for web scraping with Selenium.This package provides useful wrapping of some of the more cumbersome aspects of using Selenium directly, such as initializing the WebDriver, scrolling, and handling elements.Also, it simplifies some common tasks in web scraper bots, such as  asking the user to manually input some data when necessary and checking if some file exists in the user's computer.Moreover, it kind of does the same with Logging: Py Easy Scrape comes with built-in logging, which can be a significant advantage for quickly deploying, debugging, and monitoring your web scraping project!Installationpipinstallpy-easy-scrapeRequirementsPython 3.7 or higherSelenium, along withGeckoDriver(Firefox)UsagePy-Easy-Scrape has a built-in logging system that, so far, needs a directory for all the logs that are going to be generated. Hence, in your project directory, create a new directory called 'logs':mkdirlogsThen, import the package:importpyeasyscrapeaspesGet WebDriverdriver=pes.get_webdriver(headless=True)This will return a headless instance of webdriver.Firefox (GeckoDriver).Get Elementelement=pes.get_element(driver,value="element_xpath")This will return the web element found using the specified driver and value. By default, this function uses 'XPATH' as the method of searching. However, you can change this by providing 'ID' or 'LINK_TEXT' as the 'by' argument.Please be aware that the method of searching ('XPATH', 'ID', or 'LINK_TEXT') highly depends on the webpage structure. Therefore, it is essential to inspect the webpage beforehand.Also, please remember to replace"element_xpath"with the actual Xpath, ID, or link text of the element you want to find.Scroll to Elementpes.scroll_to(driver,element)This will use JavaScript to scroll the view of the given webdriver to the specified web element.Ask for Datarequired_data=("username","password")file_name_no_extension="user_credentials"pes.ask_for_data(required_data,file_name_no_extension)This will return a dictionary containing the collected data and will create a JSON configuration (.conf) file.Check Filepes.check_file("path_to_file")This will return either True or False based on file existencePlease note that the above code snippets are basic examples of how to use those functions. Depending on the exact specifications of your use case, additional setup may be necessary (e.g. logging into a website before trying to scroll to an element).ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.LicenseMIT
Package: pyeasysocket
pyeasysocketPython TCP and UDP sockets made easy.installpipinstallpyeasysocketquick startCreate a TCPReceiver:frompyeasysocket.udpimportUDPReceiverfrompyeasysocket.tcpimportTCPReceiverreceiver_udp=UDPReceiver('localhost',8001)receiver=TCPReceiver('localhost',8000)try:# run background thread for receivereceiver.start()# wait for datareceived_data=receiver.datafinally:receiver.join()# closes the background threadOr use the advantage of a with statement with the guarantee that the connection will be closed.importtimefrompyeasysocket.tcpimportTCPReceiver,TCPClientclient=TCPClient('localhost',8000)withTCPReceiver('localhost',8000)asreceiver:client.send('test')time.sleep(0.2)# only for timing purposereceived_data=receiver.data# testissue trackerhttps://github.com/SlashGordon/pyeasysocket/issuese
Package: pyeaze
pyeazepyeazeis a Python package for animating values with easing functions. It supports float, int, and hex color values (specified as strings), and can animate multiple values at the same time.InstallationUse the package managerpipto install pyeaze.pipinstallpyeazeUsageAnimating single value,importpyeazeanim=Animator(current_value=0,target_value=100,duration=1,fps=60,easing='ease',reverse=False)forvalueinanim:print(value)Animating multiple values,anim.add_animator(current_value='#e01a6d',target_value='#ffffff',easing='ease')anim.add_animator(current_value='#006effff',target_value='#ffffff00',easing='ease')forvalue,color1,color2inanim:print(value,color1,color2)More information
Package: pyebl
pyebl implements a simply scripting interface for
creating .ely files. Syntax and function is reminiscent of matplotlib’s pyplot.
See docs/examples for usage. It may be useful for quickly tuning
highly-repetitive structures, arrays where some parameter should be varied over
each structure in the array, and approximations of smooth curves using the
polygon primitive. pyebl requires python 3, there is no python 2 version.
Package: pyebooks
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Description: pyebooks : A python wrapper around http://it-ebooks-api.info/ API===================================================================**What is it?******************pyebooks is a Python wrapper for the it-ebooks API.It allows quick and easy comsumption of it-ebooks API from your Python application.pyebooks reqires Python 3.**Install*************You can install pyebooks using:.. code ::$ pip3 install pyebooksBuild from source.. code ::$ git clone https://github.com/aksbuzz/pyebooks.git$ cd pyebooks$ make**Usage************API Key*^^^^^^^^^For access to the eBook API you would need a API Key.You can get the API Key from here http://api.eBook.in/*Using the module*^^^^^^^^^^^^^^^^^^.. code :: python>>> eBook = pyebooks.Ebook()>>> '''Search the books'''>>> search_ = eBook.search("php mysql")>>> print(search_.error)>>> print(search_.time)>>> print(search_.total)>>> print(search_.page)>>> print(search_.books)>>> '''This will return a list of dictionary with following details:ID,Title,SubTitle (optional),Description,Image'''Get book detail>>> book_ = eBook.book_detail(869476162)>>> print(book_.download)**Examples**************You can find example usage in the examples folder.**Contribution******************Contributions are welcome!.**Documentation*******************Documentation at http://it-ebooks-api.info/**Todo**********- Add Python 2 support- Add detailed documentationPlatform: UNKNOWN
Package: pyebsdindex
PyEBSDIndexPython based tool for Radon based EBSD orientation indexing.The pattern processing is based on a GPU pipeline.  Details can be found
in D. J. Rowenhorst, P. G. Callahan, H. W. Ånes. Fast Radon transforms for
high-precision EBSD orientation determination using PyEBSDIndex. Journal of
Applied Crystallography, 57(1):3–19, 2024. and is based on the work of S. I.
Wright and B. L. Adams. Metallurgical Transactions A-Physical Metallurgy and
Materials Science, 23(3):759–767, 1992, and N. Krieger Lassen. Automated
Determination of Crystal Orientations from Electron Backscattering Patterns.
PhD thesis, The Technical University of Denmark, 1994.The band indexing is achieved through triplet voting using the methods outlined by A.
Morawiec. Acta Crystallographica Section A Foundations and Advances, 76(6):719–734,
2020.Additionally NLPAR pattern processing is included (original distributionNLPAR; P. T. Brewick, S. I.
Wright, and D. J. Rowenhorst. Ultramicroscopy, 200:50–61, May 2019.).Documentation with installation instructions, a user guide, API reference, changelog,
and contributing guide is available athttps://pyebsdindex.readthedocs.io.InstallationSeethe documentationfor installation instructions.
Package: pyebur128
pyebur128A Cython implementation of thelibebur128library for audio loudness in media files.RequirementsOperating Systems: Linux, macOS, or WindowsPython: 3.6+Dependencies: None!InstallationPyPIpip install pyebur128From Sourcegit clone --recurse-submodules https://github.com/jodhus/pyebur128
cd pyebur128
pip install .TODOWorking on getting official documentation written/uploaded. In the meantime, all definitions are documented in within their docstrings.
Package: pyeccodes
pyeccodes:warning: This is anexperimental project: do not use in operations. The code has only been tested on a handful of GRIB files.This is an experiment of a pure Python GRIB decoder based oneccodes.
The code is automatically generated from the definition files and tables.The package does not support encoding.The difference with other Python bindings are:All arrays and lists are returns as numpy arraysMissing data values are set to numpy.NaNAsking for a missing key is not an error. The value None is returnedIf a key returns a missing value  (e.g. 255), None is returned insteadYou can use pyeccodes withcfgribwith a version greater or equal to 0.9.8.1.Accessing data values:frompyeccodesimportReaderreader=Reader("test.grib")forgribinreader:print(grib.get('date'))print(grib.get('values'))To get a list of all available keys:frompyeccodesimportReaderreader=Reader("test.grib")grib=next(reader)grib.dump()