Saravanan666/pypi-org huggingface dataset:
Package: python-env-utils
env utilsThis library extends the standard library’sgetenvfunction, allowing
you to coerce the return value into a type.And that’s it.It’s been released as a library because every project we have includes the
same requirements - read in environment variables, coerce them into the
correct type.The problem is that environment variables are always stored as strings, but
Python will evaluate any string (even “”) as True if cast to a boolean. This
is almost never the desired behaviour. If you set an environment variable to
“”, “0” or “False”, you want it to be False.>>>os.environ['foo']="0">>>val=os.getenv('foo')>>>val"0">>>bool(val)Trueenv_utils.get_envwill coerce the value into the type you require. The package contains basic helper functions that coerce booleans, integers, decimals, floats, dates, lists and dictionaries.# FOO=0>>>env_utils.get_env('FOO')"0">>>env_utils.get_bool('FOO')False>>>env_utils.get_int('FOO')0# FOO=foo,bar>>>env_utils.get_list('FOO',separator=',')['foo','bar']# FOO='{"foo": true}'>>>env_utils.get_dict('FOO'){'foo':True}# FOO=2016-11-23>>>env_utils.get_date('FOO')datetime.date(2016,11,23)You can supply any function you like to coerce the value, e.g.:>>>importos>>>os.getenv('FOO_NAME')'bob'>>>classFoo(object):...def__init__(self,name):...self.name=name>>>coerce=lambdax:Foo(x)>>>importenv_utils>>>foo=env_utils.get_env('FOO_NAME',coerce=coerce)>>>foo.name>>>'bob'InstallationThe library is available at pypi as ‘python-env-utils’, and can installed using pip:$ pip install python-env-utilsTestsThe tests can be run usingtox:$tox
Package: python-eol
python-eolA simple tool to check if the current running python version is beyond or close to end of life (eol).Warns 60 days before eol, and errors when using a python version that is beyond eol.MotivationWe tend to often forget which python version we are using for a project and that those version eventually will not get security updates once they are beyond eol.
This tool can be used to check this, for example, in a CI/CD system or as a pre-commit hook.Installationpipinstallpython-eolUsageSimply invokeeolfrom your command lineeolOptions:usage:eol[-h][--fail-close-to-eol][--check-docker-files][--nep29]eolcheckifyourpythonversionisbeyondendoflife

options:-h,--helpshowthishelpmessageandexit--fail-close-to-eolFailifthepythonversionisclosetoeolinsteadofjustwarn--check-docker-filesSearchforDockerfile(**/*Dockerfile*)andcheckthepythonversionsspecifiedinsidethem--nep29UseNEP0029endoflifepolicyPre-commit-hookAdd the following to your.pre-commit-config.yaml:repos:-repo:https://github.com/mimre25/python-eol/rev:v0.0.3hooks:-id:python-eol-check
Package: pythoneon
===========
pythoneon'pythoneon' is a Python library for:producing sounds,organizing sounds in time and space.With 'pythoneon' one can write (compose) electronic music in a
traditional western manner.Please, read the files:
LIS_MOI.txt
COPYING.txt
UTILISATION.txt
LICENSE.txt
REMERCIEMENTS.txtRené Bastian, 2018
Package: python-equilibrium
equilibriumEquilibrium(noun): A state in which opposing forces or influences are balanced, resulting in a stable system
that does not undergo significant changes. In a broader sense, equilibrium can refer to a state of mental or emotional
balance, as well as the balance of forces in physical or chemical systems.Equilibrium is a framework for implementing control loops and is heavily Kubernets-inspired. A control loop is a
system that continuously monitors the state of a system and takes action to bring the system into a desired state.
It is designed to be extensible and flexible, allowing you to implement control loops that are tailored to your
specific use case.InstallationEquilibrium is available on PyPI. You need at least Python 3.10.pipinstallpython-equilibriumExampleCheck out theexamples/local_file/directory for a simple example of a control loop that
monitors a local file and takes action when the file is modified.graph LR
  subgraph Equilibrium
    LocalFile["Resource[LocalFile]"] --> LocalFileController
  end
  subgraph "Local filesystem"
    LocalFileController --> LocalFileModification["Local filesystem changes"]
  end
  subgraph "State Backend"
    LocalFileController --> State["Last known state"]
  endDifference to Kubernetes resourcesEquilibrium does not currently support any key other thanspecnext toapiVersion,kind, andmetadatain
a resource definition. This means Equilibrium cannot be used to deserialize actual KubernetesSecretofConfigresources.
Package: python-error
README.mdError Handling and Logging Toolkit for PythonA Python toolkit that provides enhanced error handling and logging capabilities, making it easier to identify and debug runtime errors when they occur.FeaturesCustom error handling withCustomErrorclass.Flexible error logging with customizable log formats.Example usage and unit tests included.InstallationYou can install the toolkit using pip:pipinstallpy-error-handling-toolkitUsageHere's how you can use the toolkit in your Python code:fromtoolkit.error_handlerimportCustomError,handle_errorfromtoolkit.loggerimportsetup_logger# Initialize the loggerlogger=setup_logger('error.log')try:# Code that may raise exceptionsraiseCustomError("This is a custom error.")exceptCustomErrorasce:handle_error(ce,log_function=logger.error)exceptExceptionase:handle_error(e,log_function=logger.error)else:logger.info("No errors occurred.")For more detailed usage instructions, see thefull documentation.ContributingContributions are welcome! Please check out thecontribution guidelinesfor details on how to contribute to this project.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.
Package: python-errorhandler
This Python package, 'python_errorhandler', simplifies error handling in your code.Thepython_errorhandlerpackage streamlines error handling in your Django projects by providing a convenient decorator that reduces the complexity of managing exceptions. This package is authored by Nimesh Prajapati (prajapatin953@gmail.com) and is currently at version v1.0.0.How to Use theerror_handlerDecorator:python_errorhandlerOverviewThepython_errorhandlerpackage simplifies error handling in Django, allowing you to streamline your code. With the providederror_handlerdecorator, you can easily manage exceptions and enhance your debugging experience. No more writing repetitive try-catch blocks—just import the package and apply the decorator with custom error messages to your functions.UsageInstallation:You can install the package using pip:pip install python-errorhandlerImport:Import theerror_handlerdecorator in your Python script:from python_errorhandler import error_handler_decorator3.How to use@error_handler_decorator(message="An error occurred while processing the data.")
def process_data(data):
    pass

message = you can pass your own custome message

The error_handler decorator wraps your function and adds error-handling logic. If an exception occurs within the process_data function, it will display the provided error message, making it easier to identify and debug issues.DependenciesThis package depends on the following Python libraries:Django
djangorestframework
Ensure you have these dependencies installed in your environment when using python_errorhandler.For more details and updates, reach out to the author for questions or support.
Package: python-escpos
Python ESC/POS is a library which lets the user have access to all those printers handled
by ESC/POS commands, as defined by Epson, from a Python application.The library tries to implement the functions provided by the ESC/POS-command-set and supports sending text, images,
barcodes and qr-codes to the printer.Text can be aligned/justified and fonts can be changed by size, type and weight.Also, this module handles some hardware functionalities like cutting paper, control characters, printer reset
and similar functions.Since supported commands differ from printer to printer the software tries to automatically apply the right
settings for the printer that you set. These settings are handled byescpos-printer-dbwhich is also used inescpos-php.DependenciesThis library makes use of:pyusbfor USB-printersPillowfor image printingqrcodefor the generation of QR-codespyserialfor serial printerspython-barcodefor the generation of barcodesDocumentation and UsageThe basic usage is:fromescpos.printerimportUsb""" Seiko Epson Corp. Receipt Printer (EPSON TM-T88III) """p=Usb(0x04b8,0x0202,0,profile="TM-T88III")p.text("Hello World\n")p.image("logo.gif")p.barcode('4006381333931','EAN13',64,2,'','')p.cut()Another example based on the Network printer class:fromescpos.printerimportNetworkkitchen=Network("192.168.1.100")#Printer IP Addresskitchen.text("Hello World\n")kitchen.barcode('4006381333931','EAN13',64,2,'','')kitchen.cut()Another example based on the Serial printer class:fromescpos.printerimportSerial""" 9600 Baud, 8N1, Flow Control Enabled """p=Serial(devfile='/dev/tty.usbserial',baudrate=9600,bytesize=8,parity='N',stopbits=1,timeout=1.00,dsrdtr=True)p.text("Hello World\n")p.qr("You can readme from your smartphone")p.cut()The full project-documentation is available onRead the Docs.ContributingThis project is open for any contribution! Please seeCONTRIBUTING.rstfor more information.DisclaimerNone of the vendors cited in this project agree or endorse any of the
patterns or implementations.
Its names are used only to maintain context.
Package: python-escpos-win
DescriptionPython ESC/POS is a library which lets the user have access to all those printers handled
by ESC/POS commands, as defined by Epson, from a Python application.The library tries to implement the functions provided by the ESC/POS-commandset and supports sending text, images,
barcodes and qr-codes to the printer.Text can be aligned/justified and fonts can be changed by size, type and weight.Also, this module handles some hardware functionalities like cutting paper, control characters, printer reset
and similar functions.DependenciesThis library makes use of:pyusb for USB-printersPillow for image printingqrcode for the generation of QR-codespyserial for serial printersDocumentation and UsageThe basic usage is:fromescpos.printerimportUsb""" Seiko Epson Corp. Receipt Printer M129 Definitions (EPSON TM-T88IV) """p=Usb(0x04b8,0x0202,0)p.text("Hello World\n")p.image("logo.gif")p.barcode('1324354657687','EAN13',64,2,'','')p.cut()The full project-documentation is available onRead the Docs.ContributingThis project is open for any contribution! Please see CONTRIBUTING.rst for more information.
Package: python-escpos-xml
escpos-xml is a library to parse XML defined receipt and print it on ESC/POS
Printer using python-escpos library.The module contains a RELAX NG schema for the XML:escpos_xml/escpos.rng.
The syntax is quite similar to HTML.Example:>>> import os
>>> from io import BytesIO, open
>>> from escpos.printer import Usb
>>> from escpos_xml import parse
>>> xml = BytesIO('''
... <receipt width="48">
...     <h1>Receipt!</h1>
...     <ul>
...         <li>
...             <span align="left" width="22">Product</span>
...             <span align="right" width="24">0.15€</span>
...         </li>
...     </ul>
...     <hr/>
...     <p size="2h">
...         <span align="left" width="24">TOTAL</span>
...         <span align="right" width="24">0.15€</span>
...     </p>
...     <barcode encoding='ean13'>
...         5449000000996
...     </barcode>
...     <cashdraw pin="2"/>
...     <cut/>
... </receipt>''')
>>> printer = Usb(0x0483, 0x5743)
>>> parse(printer, xml)
>>> parse(printer,
...      open(os.path.join('escpos_xml', 'tests', 'image.xml'), 'rb'))Documenation:RootThe root element isreceiptwith the optional attributewidthwhich is the
number of character in a line.In-lines:The tags for in-line elements are:bold,bandspan.
The attribute available are:bold,underline,size,font,invertedandcolor.
Thespanelement can have also the attributesalignandwidth.Blocks:The tags for block element are:p,h(1-5)andhr.
The attributes are the same as the in-line elements with in addition thealignwhich could beleft,rightorcenter.Lists:It is possible to have ordered or unordered lists with the elementsolandul. The type of bullet is defined by the attributetype. For ordered list,
the start number can be specify with thestartattribute.
Each item is defined by an elementliwhich has the same attributes as the
in-line elements.The list can be nested.Barcode:Thebarcodeelement print the code using theencodingattribute as format.
Other attributes are:width,height,positionandfont.Image:Theimgelement print the image defined by thesrcattribute using a base64
data-url format.
Example:<img src="data:image/png;base64,AAABAAMAEBAAAAEAIABoBAAANgAAAC..."/>Operations:Some operations are available:cut,partialcutandcashdraw.
Thecashdrawelement requires apinattribute.
Package: python-esileapclient
python-esileapclientPython API for interacting withESI-LeapOverviewThis is a client for the OpenStack Lease API. It provides:a openstack command-line plugin:openstack leasepython-esileapclient is licensed under the Apache License, Version 2.0, like the rest of OpenStack.InstallationTo install as a package:# pip install python-esileapclient`To install from source:$ git clone https://github.com/CCI-MOC/python-esileapclient
$ cd python-esileapclient
# python setup.py installopenstack leaseCLITheopenstack leasecommand-line interface is available when the lease plugin (included in this package) is used with theOpenStackClientThe client uses the OpenStack Identity API (Keystone) to authenticate users with an OpenStack cloud and to locate the lease service endpoint (seeherefor more info). Currently, overriding this endpoint is not supported. Credentials for authentication can be provided via command-line parameters (e.g.--os-username, --os-password, etc.) or by setting environment variables (e.g.OS_USERNAME, OS_PASSWORD).Usage Examples:openstack esi offer listwill make a GET request to ESI-Leap and print to screen a list of all the offers in the ESI-Leap database.openstack esi offer show <uuid>will make a GET request and print fields for offer with the given uuid.openstack esi offer create --resource-type dummy_node --resource-uuid 1718will make a POST request to ESI-Leap to create the offer with the given credentials. Prints to the screen the newly created offer with resource type 'dummy_node' and resource uuid '1718'.openstack esi offer delete <uuid>will make a DELETE request to ESI-Leap to delete the request with the given uuid. Prints to the screen whether the command was a success or not.This repository is currently a work in progress.
Package: python-espeak
This is a modified version of python-espeak (previous version here). It is a Python binding over theeSpeak speech synthesizerC library and does not simply make calls to theespeakbinary.ChangesSome highlights of the modifications.File output instead of only playback (espeak.init(playing=False)).Support for multiple instances of speakers (theespeak.Espeakclass). They have to take turns andnotsimultaneously speak.Easily setup multiple callbacks (espeak.add_callback).Wave file content sent through callbacks (forplaying=Falseonly since this is how the C library works).Slightly more uniform bindings in some places (espeak.const).Optional start and end position for synthesis.Unfortunately some of the renamings make this version not backwards compatible. (Maybe this library should be named differently. I will try to contact the original author about that. Their email "rainct ubuntu com" seems defunct.) The big one is thatespeak.init()now has to be called before anything else.CompatibilityThis library should (still) work with both Python 2 and 3.InstallationRequiresespeakand its libraries to be installedespeak/speak_lib.hshould be in your include path somewhere. Install withpython setup.py installorpython setup.py buildto get the library in thebuildwithout installation.ExamplesSimple usageimport espeak
espeak.init()
speaker = espeak.Espeak()
speaker.say("Hello world")
speaker.rate = 300
speaker.say("Faster hello world")Seeespeak.const['parameter']for all the values other thanratethat can be changes.Callback usagedef print_callback(*args):
    print args

import espeak
espeak.init()
speaker = espeak.Espeak()
speaker.add_callback(print_callback)
speaker.say("Hello world")This should print something like('', 2, 1, 0, 0, None)
('', 0, 1, 0, 0, None)
('', 1, 1, 5, 0, None)
('', 0, 1, 5, 0, None)
('', 1, 7, 5, 0, None)
('', 0, 7, 5, 0, None)
('', 5, 11, 0, 0, None)
('', 0, 11, 0, 0, None)Callback formatThe arguments of callback functions arewave_file_fragment, event, current_pos, length, num_samples, name.eventcan be reverse looked up in (or compare to)espeak.const['event'].wave_file_fragmentis a piece of a wave file (only inplayback=Falsemode, otherwise its always the empty string).current_posisevent->text_positionfromspeak_libthe C librarylengthisevent->lengthfromspeak_libnum_samplesisevent->lengthfromspeak_libnameis either(event->id).nameforplayandmarkevents,event->id.number(forsample_rateevents) orNoneotherwise.LicenceGPL v3. SeeCOPYINGfor full text.
Package: python-espeak-ng
This is a modified version of python-espeak (previous version here). It is a Python binding over theeSpeak speech synthesizerC library and does not simply make calls to theespeakbinary.ChangesSome highlights of the modifications.File output instead of only playback (espeak.init(playing=False)).Support for multiple instances of speakers (theespeak.Espeakclass). They have to take turns andnotsimultaneously speak.Easily setup multiple callbacks (espeak.add_callback).Wave file content sent through callbacks (forplaying=Falseonly since this is how the C library works).Slightly more uniform bindings in some places (espeak.const).Optional start and end position for synthesis.Unfortunately some of the renamings make this version not backwards compatible. (Maybe this library should be named differently. I will try to contact the original author about that. Their email "rainct ubuntu com" seems defunct.) The big one is thatespeak.init()now has to be called before anything else.CompatibilityThis library should (still) work with both Python 2 and 3.InstallationRequiresespeakand its libraries to be installedespeak/speak_lib.hshould be in your include path somewhere. Install withpython setup.py installorpython setup.py buildto get the library in thebuildwithout installation.ExamplesSimple usageimport espeak
espeak.init()
speaker = espeak.Espeak()
speaker.say("Hello world")
speaker.rate = 300
speaker.say("Faster hello world")Seeespeak.const['parameter']for all the values other thanratethat can be changes.Callback usagedef print_callback(*args):
    print args

import espeak
espeak.init()
speaker = espeak.Espeak()
speaker.add_callback(print_callback)
speaker.say("Hello world")This should print something like('', 2, 1, 0, 0, None)
('', 0, 1, 0, 0, None)
('', 1, 1, 5, 0, None)
('', 0, 1, 5, 0, None)
('', 1, 7, 5, 0, None)
('', 0, 7, 5, 0, None)
('', 5, 11, 0, 0, None)
('', 0, 11, 0, 0, None)Callback formatThe arguments of callback functions arewave_file_fragment, event, current_pos, length, num_samples, name.eventcan be reverse looked up in (or compare to)espeak.const['event'].wave_file_fragmentis a piece of a wave file (only inplayback=Falsemode, otherwise its always the empty string).current_posisevent->text_positionfromspeak_libthe C librarylengthisevent->lengthfromspeak_libnum_samplesisevent->lengthfromspeak_libnameis either(event->id).nameforplayandmarkevents,event->id.number(forsample_rateevents) orNoneotherwise.LicenceGPL v3. SeeCOPYINGfor full text.
Package: pythonesque
Pythonesque is a package of functions to make Python code more readable to non-Python programmers.Python is one of the most readable programming languages.However, there are some areas which are are not intuitive to non-Python progammers, and especially non-programmers.For example, the range() function and its parameters can be a source of confusion.Other programming constructs, eg. modulus operator, are obvious to programmers, but can be a real stumbling block for others.The aim of this package is to to facilitate writing pseudo code (that is actually Python code) in order to to convey logic more easily to non-Python programmers, or perhaps even non-programmers.If Python code can be written to resemble pseudo code, it would be a great way to:communicate your ideasdemonstrate logicallow stakeholders to play with your pseudo codeInstallationUse the package managerpipto install Pythonesque.pipinstallpythonesqueUsageExample:frompythonesqueimportconsecutive_numbers# or specify sub-modules:# from pythonesque.series import consecutive_numbers# much less confusing to non-programmers than "range(10, 0, -1)"forcountinconsecutive_numbers(10,1):print(count)print("Blast off!")For more examples, please refer to theDocumentationContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: python-esr
Parser library for Swiss ESR (“Einzahlungsschein mit Referenznummer”) account
statement records.FeaturesSupport for type 3 and 4 records (automatically detected)Implements various integrity checks according to record description manualConverts values to int, Decimal, etc.Getting startedRead data from a ESR file (usually ending with *.v11):from esr import ESR

with open('esr_file.v11', 'r') as f:
    data = f.read()

statement = ESR.parse(data)

for record in statement.records:
    print(record.amount)
print(statement.total_record.amount)
Package: python-esteid
Estonian ID-card “ecosystem” helper library and command line utility.The esteid utility helps to:query ldap.sk.ee in a meaningful wayconvert ID codes to SSH keysverify certificates against OCSPAccess to the Mobile-ID DigiDocService is currently excluded from
the source.This depends on M2Crypto either being available or being able to
build it, ditto for python-ldap.On Debian and derivatives:
sudo apt-get install build-essential libssl-dev swig libsasl2-dev libldap-dev python-dev
Package: python-etcd-lock
## Python Lock library for ETCD 2.0Since ETCD 0.4, all [the built in modules were removed](https://groups.google.com/d/msg/etcd-dev/ubcPWuL8wSg/7GeaxSHhIb0J), including the locking module. The API still provides an atomic compare-and-swap method to implement locking, thus providing the core functionality to create semaphores and mutexes. This library is built on top of that, matching the API that was in [python-etcd](https://github.com/jplana/python-etcd) before it was removed as much as possible.[![Circle CI](https://circleci.com/gh/appuri/python-etcd-lock.svg?style=shield)](https://circleci.com/gh/appuri/python-etcd-lock)#### Simple Usage```pythonimport etcdfrom etcdlock import Locklock = Lock(etcd.Client(), 'path/to/my/key')while lock# lock is acquired# lock will renew itself by default until released# do workrequest = ....# check if we still have the lockif lock.is_locked() is False:return```#### Explicit Usage```pythonimport etcdfrom etcdlock import Lockclient = client = etcd.Client(host='api.example.com', protocol='https', port=443, version_prefix='/etcd')lock = Lock(client, 'path/to/my/key', ttl=30, renewSecondsPrior=)if lock.acquire(timeout=20):t = Thread(target=someheavywork)t.run()t.wait()lock.renew()# some other worklock.release() # not recommended, use a context managerelse# failed to acquire the lock in 20 secondspass```Please see [the tests](https://github.com/appuri/python-etcd-lock/blob/master/tests/lock_tests.py) while the documentation is lacking, thanks.
Package: python-ethapi
Aboutpython-ethapiis a client and library that can be used to communicate
with theethermineAPI.Disclaimer: This is a work in progress. Please feel free to provide feedback
and contribute to the project !DocumentationNo documentation for the time being.TL;DR: See the providedexample file.Installing>From source:pip install git+https://git.cajun.pro/dirtycajunrice/python-ethapi>From pypi:pip install python-ethapiAuthorNicholas Totsch