Saravanan666/pypi-org huggingface dataset:
Package: pyler
Pyler is a lib that helps tackling Project Euler problems using PythonHow ?$pipinstallpylerGenerate a file#generatesthefileforproblem1$pylergen1#generatesthefileforproblems1to10,14and17to24$pylergen1-10,14,17-24#generatesthefirstnot-yet-generatedproblem$pylergennext#generatesallavailableproblems$pylergenallYou get the idea !This will generate a file that has more or less everything for beginning the real work.
Just fill the variables and code your solution into solver.frompylerimportEulerProblemclassProblem0001(EulerProblem):"""
    If we list all the natural numbers below 10 that are multiples of 3 or 5, we
    get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the
    multiples of 3 or 5 below 1000.
    """problem_id=1simple_input=0simple_output=1real_input=0defsolver(self,input_val):return0if__name__=='__main__':importunittestunittest.main()You can change the path where the files are being generated using--pathand
the template used with--template=path/to/template.py, the template file must be compatible
with Python’s [.format](https://pyformat.info/) function and will recieve 2 variables :docandproblem_idBTW : yes, the docstring is scraped from the website.Test your solution#Teststheimplementationofthefirstproblem$pylertest1#WellI'msureyouknowwhatthisdoes$pylertest1-10,14,17-24#Teststhelastproblem$pylertestlastYou may also use unittest or the testing tool of your choice that accept unittest TestCases.
Calling Python on the problem file directly will also launch the tests.Launching the tests on your solution module will test your solution for :The simple test case (the one that’s given in the statement)The real test case (it will check on the real website to do so). The first
time, it will ask for your credentials (stored in a local file.pyler.conf) and now and then, it will ask you to solve the captchas. If
you have already validated the problem, it will check the solution from the
page. Otherwise, it will submit the solution for you.A test ensuring that your implementation takes less than 1 minute. If you’re
not using Windows, it will stop at 1 minute. Otherwise, it will fail when
the computation is over.You can use any number of--only=xand--skip=xflags with x
beingsimple,real,time.
Package: pylertalertmanager
PylertAlertManagerPylertAlertManager aims to be an easy-to-use interface for interacting with the Alert Manager API.Getting StartedThe latest stable release is available from PyPI:pip install pylertalertmanagerOtherwise you can install from git:pip install git+https://github.com/ABORGT/PylertAlertManager.gitUsageHere we cover some basic usage examples to get folks off and running. We are importing json here just to pretty print our objects. Additionally, we have an Alert Manager instance running in docker to target.>>>importjson>>>fromalertmanagerimportAlertManager>>>fromalertmanagerimportAlert>>>>>># Provide some test data to be converted into an Alert object.>>>test_data={..."labels":{..."alertname":"TestAlert",..."instance":"TestInstance",..."severity":"critical"...},..."annotations":{..."description":"This is a test alert",..."info":"Test Alert",..."summary":"A simple Test alert"...}...}>>># Run the from_dict method on our test_data.>>>test_alert=Alert.from_dict(test_data)>>>type(test_alert)<class'alertmanager.alertmanager.Alert'>>>>>>># Add an annotation with the add_annotation method.>>>test_alert.add_annotation('test_annotation','this is a test annotation')>>>print(json.dumps(test_alert,indent=4)){"labels":{"alertname":"TestAlert","instance":"TestInstance","severity":"critical"},"annotations":{"description":"This is a test alert","info":"Test Alert","summary":"A simple Test alert","test_annotation":"this is a test annotation"}}>>># Add a label with the add_label method.>>>test_alert.add_label('test_label','this is a test label')>>>print(json.dumps(test_alert,indent=4)){"labels":{"alertname":"TestAlert","instance":"TestInstance","severity":"critical","test_label":"this is a test label"},"annotations":{"description":"This is a test alert","info":"Test Alert","summary":"A simple Test alert","test_annotation":"this is a test annotation"}}>>># Specify an Alert Manager host to connect to.>>>host='http://127.0.0.1'>>>a_manager=AlertManager(host=host)>>>>>># Post an alert to our Alert Manager.>>>a_manager.post_alerts(test_alert)<Box:{'status':'success'}>>>># Return a list of alerts from our Alert Manager.>>>alerts=a_manager.get_alerts()>>>print(json.dumps(alerts,indent=4))[{"labels":{"alertname":"TestAlert","instance":"TestInstance","severity":"critical","test_label":"this is a test label"},"annotations":{"description":"This is a test alert","info":"Test Alert","summary":"A simple Test alert","test_annotation":"this is a test annotation"},"startsAt":"2018-11-08T16:25:02.327027475Z","endsAt":"2018-11-08T16:30:02.327027475Z","generatorURL":"","status":{"state":"unprocessed","silencedBy":[],"inhibitedBy":[]},"receivers":["team-X-mails"],"fingerprint":"e6b119b9ce57e0c4"}]Running the testsTODO: Add testsContributingFork it.Create a branch describing either the issue or feature you're working.Making changes, committing along the way.Follow PEP8, except where ridiculous.Include tests for any functionality changes.Push the changes and create a pull request :D.Built WithPython3- Beautiful language.AuthorsTyler Coil-Other ProjectsJustin Palmer-Other ProjectsAcknowledgmentsKenneth Reitz ->setup- Thanks!
Package: pylet
pyto/pyletSimple python managerPyto abstracts over all tools you love to bring a uniform experince.Inspired bycargo,racoandyeoman.
Written in pure typed Python.Whole Python ecosystem in one command line.Even for simple projects we recommend usingpytoas it structures all the code and makes sure all your project are consistentPyto works the same on all OS and has same commands.Pyto always defaults to the newest PEPs to be shiny.
But you can ovveride behavioyr usingpyto.tomlHow setup lookspytonew

Choosebuild:[*]setuptools[]poetry[]flitCLI# initialize a new python package in current directory# from existing setup or anew (easy to convert existing project)pytoinit# create a new directorypytonewNAME# set default pythonpytosetglobalpython3# install all packagespytoinstall# uninstall all packagespytouninstall# Create new virtual envpytoenv# run scriptpytorun[--no-check]target=.# compile codepytobuild# clean env from unused dependenciespytoclean# run static checkspytochecktarget=.# generate docspytodocs# extend pytopytoaddCOMPONENT# pin python requirmentspytopin# publish packagepytopublish[--dry-run]pytopublish[--testpypi]# install locallypytoinstallLarge Toolcondapip-toolsOtherbumpverCreate PackagepyscaffoldVersioningpyenvp-@unmaintainedpewExecutioncpythonpypystacklessmicropythonrustpythonPackagingHistory:distutils -> setuptools -> ...distutils-@deprecatedin favor of setuptoolsbento-@unmaintainedBuilddistutils-@deprecatedin favor of setuptoolssetuptoolsbuildpackagingpipenvpybuilderDependeciespippipxpoetryeasy_install-@deprecatedin favor of setuptoolsrezPublishingtwineflitEnvironmentvenvvirtualenvDynamic ChecksType Checker[]Static ChecksType Checkermypypytypepyrightpyre-checkpyanalyzeSecurity ChecksbanditLintingflake8pycodestylepyflakesmccabepydocstylepylintpylamaradonblackisortpylava-@unmaintainedautopep8pycheckereradicatevultureyapfpep8ify-@unmaintainedDocumentationdoxygendocutilssphinxautodocTestingnoseunittesttoxhypothesispytestPEPsPEP 518- minimum build systemRead and Removehttps://packaging.python.org/en/latest/key_projects/#virtualenvpip install —editable .Sample Python ModulePython TypingPython Project TemplateAwesome PythonTesting & PackagingPackaging a python librarySource distribution formatPyPi publish package
Package: pylettes
Pylettesv0.2.0pylettesis a lightweightmatplotlib-compatible collection of beautiful palettes for Python 3.See all currently available paletteshere.Installationpylettescan be easily installed withPiPypip install pylettes.To install the latest (unreleased) version you can download it from this repository by runninggit clone https://github.com/fcomitani/pylettes
cd pylettes
python setup.py installThe only requirement ismatplotlib >= 1.3.1.UsagePalettes can be imported directly from thepylettespackage.
They can be transformed intomatplotlibcolor maps by instantiating the class and calling itscmapattribute.from pylettes import Acapulco2Paris

custom_cmap = Acapulco2Paris().cmapSingle colors can be directly accessed by index.first_color = Acapulco2Paris()[0]Theshow_colorsmethod allows you to visualize and inspect any palette.Acapulco2Paris().show_colors()The list of colors can be visualized as a continuous scale by providing thecontinuousargument.Acapulco2Paris().show_colors(continuous=True)Palettes can be reversed by activating thereverseflag upon initialization.Acapulco2Paris(reverse=True).show_colors()All currently available palettes can be inspected withlist_all_palettes(),
whilelist_palettes_by_tag()allows you to search palettes by keywords.
All available tags can be listed withlist_all_tag().
Finally, to visualize multiple palettes at once useshow_multiple_palettes().
For example, you can inspect all colorblind-friendly palettes withfrom pylettes import list_palettes_by_tag, show_multiple_palettes

show_multiple_palettes(list_palettes_by_tag('colorblind'))ContributionsI plan to keep this library updated and add more options with time.New palette submissions are welcome!
Submitting a palette is easy, all you need is a name,
the list of colors in hex format and associated tags.
Package: pylev
A pure Python Levenshtein implementation that’s not freaking GPL’d.Based off the Wikipedia code samples athttp://en.wikipedia.org/wiki/Levenshtein_distance.RequirementsPython 2.7.X, Python 3.3+ or PyPy 1.6.0+UsageUsage is fairly straightforward:importpylevdistance=pylev.levenshtein('kitten','sitting')assertdistance==3LicenseNew BSD.TestsSetup:$ git clone https://github.com/toastdriven/pylev.git
$ cd pylevRunning:$ python -m unittest testsVersion Historyv1.4.0Updated for current versions of PythonIntegrated a better Travis matrix. Thanks to @grainert!Fixed mistaken docs about theassert. Thanks to @adamchainz!Reorganized the package.Blacked all the source code.v1.3.0Implemented a considerably faster variants (orders of magnitude).Tested & working on Python 2.7.4, Python 3.3.1 & PyPy 1.9.0.v1.2.0Fixed all incorrect spellings of “Levenshtein” (there’s no “c” in it).Old methods are aliased for backward-compatibility.v1.1.0Implemented a much faster variant (several orders of magnitude).The older variant was renamed toclassic_levenschtein.Tested & working on Python 3.3 & PyPy 1.6.0 as well.v1.0.2Python packaging isREALLYhard. Including the READMEthis time.v1.0.1Python packaging is hard. Including the README this time.v1.0.0Initial release, just the naive implementation of Levenshtein.
Package: pylev3
A Python3 Levenshtein distance (re)implementation ofpylev.Calculation of Levenshtein distance between strings.
Based on theWikipedia code samples.What’s new?RequirementsPython Python 3.3+ or PyPy3Installationpipinstallpylev3UsageUsage is fairly straightforward:frompylev3importLevenshteinassertLevenshtein.classic('','cat'),3assertLevenshtein.damerau('cat','cat'),0assertLevenshtein.wf('kitten','sitting'),3assertLevenshtein.wfi(['cat','kitten'],'abc'),[3,6]assertLevenshtein()(['cat','kitten'],['cat','abc']),[[0,3],[5,6]]Or use old way (like in pylev):frompylev3importwf_levenshtein,wfi_levenshtein,damerau_levenshtein,classic_levenshteinassertclassic_levenshtein('','cat'),3assertdamerau_levenshtein('cat','cat'),0assertwf_levenshtein('kitten','sitting'),3assertwfi_levenshtein(['cat','kitten'],'abc'),[3,6]assertwf_levenshtein(['cat','kitten'],['cat','abc']),[[0,3],[5,6]]LicenseNew BSD (as authored).Tests# get$gitclonehttps://github.com/hell03end/pylev3.git$cdpylev3# run$python-munittesttests
Package: pylevel
pylevelPyLevel is a LevelDB driver for python.
It use rust reimplementation of LevelDBhttps://docs.rs/rusty-leveldb.Requirementspython3.8+Rusthttps://www.rust-lang.org/Install$ sudo apt-get install python3-dev
$ pip install pylevelExamplesimple put/get/deleteimport pylevel
db = pylevel.DB("/tmp/testdb", create_if_missing=True)

db.put(b'key', b'value')
v = db.get(b'key')      # 'value'

db.delete(b'key')
v = db.get(b'key')      # None

db.close()
Package: pylevenshtein
#Py-LevenshtienPython levenshtein project used to calculate the difference between two stringsDownload from command prompt using:
pip install git+git://github.com/Redstomite/py-levenshtein#egg=py-levenshtein
(pip needs to be installed first)
or
pip install py-levenshteinHow to use it:
import py-levenschtein as pylevword1 = “”
word2 = “”distance = pylev.distc(word1, word2)print(distance)https://pypi.org/project/py-levenshtein/1.0/Algorithm:https://en.wikipedia.org/wiki/Levenshtein_distance
Package: pylexa
pylexais a library that aims to ease development of anAlexa
Skills
Kits.pylexaallows one to define a simple Flask application that will be
able to accept requests and return appropriate responses to the Alexa
service.ExampleLet’s say you want to define an Alexa Skill that echoes whatever the
user says. So far, you’ve:created a skill in theAmazon Developer
ConsoleAdded anEchointent with a single slot,message:{"intent":"Echo","slots":[{"name":"message","type":"AMAZON.LITERAL"}]}Added an utterance to allow users to interact with the skill:Echo echo { something | message }Now, you’re ready to create a server that will accept the request and
return a response echoing the input. Usingpylexa, we’d need only
the following code to accomplish this:fromflaskimportFlaskfrompylexa.appimportalexa_blueprintfrompylexa.intentimporthandle_intentfrompylexa.responseimportPlainTextSpeechapp=Flask(__name__)app.config['app_id']='amzn1.echo-sdk-ams.app.my_app_id'app.register_blueprint(alexa_blueprint)@handle_intent('Echo')defhandle_echo_intent(request):returnPlainTextSpeech(request.slots.get('message','Nothing to echo'))And that’s it! You can push the above code, configure the skill to point
to the server running theflaskapp and use the service simulator to
test your skill.TestingAfter installing requirements withpip install-rrequirements.pip,
tests can be run withnosetests.Alexa ConfigurationConfiguration of an Alexa Skill is done in three parts in the developer
console:the intent schemalist of utterancescustom slot definitionspylexacomes with a command line tool that aims to simplify this
configuration by allowing one to define a YAML file with the necessary
information and generate the intent schema, utterances, and custom slots
from that.For example, let’s say you had the following YAML schema defined:intents:-TestIntent:foo:AMAZON.NUMBERbar:CUSTOM_SLOT-OtherIntent-AMAZON.YesIntentutterances:TestIntent:-'dosomethingwith{foo}and{bar}'-'{foo}{bar}'OtherIntent:-'dosomethingelse'slots:CUSTOM_SLOT:-value 1-value 2This defines a skill that handles three intents (TestIntent,OtherIntent, andAMAZON.YesIntent), specifies utterances forTestIntentandOtherIntent, and contains a custom slot
definition.If we have that YAML definition inconf/schema.yml:$treeconfconf└──schema.yml0directories,1fileWe can then run the command line toolgenerate-alexa-confto create
the requisite files:$generate-alexa-confconf/schema.ymlWe now have the intent schema, utterances, and slots defined in their
own files:$treeconfconf├──intent_schema.json├──schema.yml├──slots│├──CUSTOM_SLOT└──utterances.txt1directory,4filesThe contents of each file can then be copied + pasted in to the
appropriate sections of the Alexa Skill configuration.
Package: pylexer
pylexerA python implementation of a lexical analyzer which supports full scan, state based lexing and lookaheadWarningThis is not a GENERATOR like classical lexer is. It does not produce any python code. It's a simple plain scanner
of the given input string and tokenizer into given set of tokens by matching regular expressions.
Thus, at runtime you can change the token definition and use one same code for any token setInstallationInstall in your project with pip:pipinstallpylexerUsageAn example use:frompylexerimportPyLexerconfig={'\\s':'','\\d+':'number','\\+':'plus','-':'minus','\\*':'mul','/':'div',}#Static Scan method that returns list of tokenstokens=PyLexer.scan(config,'2 + 3')map(lambdax:x.get_name(),tokens)#PyLexer Config is a dict, so you can also use it likelexer=PyLexer()lexer.set_input('2 + 3')lexer.move_next()whilelexer.get_look_ahead():print(lexer.get_look_ahead().get_name())lexer.move_next()Token DefinitionTokens are defined withTokenDefinitionclass that holds token name and regular expression. Token name can be empty, and in that case lexer will ignore/skip such tokensLexer ConfigurationThe lexer configuration holds a list of all token definitions. With LexerDictConfig it can be easily created from an array where keys are regular expressions and values are names of tokensFull scanPylexer's static scan method can be used to scan given input string and returns a list of tokens, Pylexer can also be used to walk through scanned tokens with single look aheadLicenseMIT license. SeeLICENSE.mdfor more information.ContributorsPylexer is inspired from PHP's Lexer(https://github.com/tmilos/lexer) and takes code heavily from doctrine API, all credits due with Milos Tomic
Package: pylexicon
PyLexicon: A Dictionary Module for Python======================================PyLexicon is an updated and streamlined dictionary module for Python 3 toget meanings, synonyms, antonyms, and translations. It uses `WordNet`_for definitions, `Thesaurus.com`_ for synonyms and antonyms, and `GoogleTranslate`_ for translations.This module uses ``requests`` and ``BeautifulSoup4`` as dependencies.Installation------------``pip install PyLexicon``Usage-----PyLexicon is designed with simplicity in mind, which makes it easy to use.PyLexicon has only three functions: ``define``, ``synonym`` ,and``antonym``Define:~~~~~~~.. code:: python>>> print(PyLexicon.define('hello')){'Noun': ['an expression of greeting']}Synonym:~~~~~~~~.. code:: python>>> print(PyLexicon.synonym('happy'))['cheerful', 'contented', 'overjoyed', 'ecstatic', 'elated']Antonym:~~~~~~~~.. code:: python>>> print(PyLexicon.antonym('happy'))['melancholy', 'upset', 'disappointed', 'sorrowful', 'unfriendly'].. _WordNet: https://wordnet.princeton.edu/.. _Thesaurus.com: http://www.thesaurus.com/.. _Google Translate: https://translate.google.com/
Package: pylext
PyLExtallows you to add the following constructions to the Python language:new operators with specified priorities,syntax extensions given byLR(1)grammars,macros associated with new syntax rules,new token types and literals.Language extension system works in two stages: parsing text and
expanding macros, i.e. transforming syntax tree from extended
grammar to standard Python grammar.
This procedure is applied to each statement in file separately,
so it is possible to define new syntax and use it in the next statement.Simple examplesCustom operatorsThe simplest syntax extension is a new operator. For example, we want to define
left-associative operator /@
that applies function to each element of collection and this operator has the lowest priority.
Than we should create file simple.pyg# Import syntax extension for new operator definitiongimportpylext.macros.operator# Add new operatorinfixl(0)'/@'(f,data):return[f(x)forxindata]# Test new operator:frommathimport*deftest(n):print(exp/@range(n))Main file should be a Python file, so we create main.py:importsimplesimple.test(10)Custom operators may be useful as a syntactic sugar for
symbolic computations libraries such as SymPy or SageMath.Function literals for binary operatorsSometimes we need to use binary operator as a function object, for example if we want
to reduce array using some binary operation.# define new literalnew_token('op_lambda','"(" [<=>+\\-*/%~?@|!&\\^.:;]+ ")"')defmacroop_lambda(expr,op:*op_lambda):op=op[1:-1]# remove parenthesestry:return`(lambdax,y:x{op}y)`exceptRuntimeErrorase:# exception will be thrown if op is not binary operatorpassraiseException(f'`{op}` is not a binary operator')This simple macro for each binary operatoropcreates function literal(op)which represents lambda functionlambda x, y: x op y.After macros expansion these 2 lines will be equivalent:reduce((^),range(100))reduce(lambdax,y:x^y,range(100))We can write test function checking that result is the samedeftest():fromfunctoolsimportreduceresult=reduce((^),range(100))# reduce array by XOR operationcorrect=reduce(lambdax,y:x^y,range(100))returnresult==correctSee more examples and the documentation atgithub.RequirementsC++ compiler supporting c++17:Visual Studio 2019gcc 8 or laterapple clang 11 or laterCMake 3.8 or laterPython >= 3.6. Recommended is Python 3.8.Package python3-dev (for Ubuntu)Installation:You can install pylext from PyPI using pip:$pipinstallpylext
Package: pyley
pyleyPythonclient for an open-source graph databaseCayleyhttps://github.com/google/cayley.Cayley is an open-source graph inspired by the graph database behindFreebaseand Google’sKnowledge Graph. Its goal is to be a part of the developer’s toolbox whereLinked Dataand graph-shaped data (semantic webs, social networks, etc) in general are concerned.Install via pipYou can install pyley using:$ pip install pyleySampleImport pyley:frompyleyimportCayleyClient,GraphObject# Create cayley client# this creates client with default parameters `http://localhost:64210/api/v1/query/gizmo`client=CayleyClient()# or  specify `url` and `version` parametersclient=CayleyClient("http://localhost:64210","v1")g=GraphObject()# Query all vertices in the graph, limit to the first 5 vertices found.g.Vertex().GetLimit(5)# Start with only one vertex, the literal name "Humphrey Bogart", and retrieve all of them.query=g.Vertex("Humphrey Bogart").All();response=client.Send(query)# response.result contains JSON data and response.r contains raw responseprintresponse.result# `g` and `V` are synonyms for `graph` and `Vertex` respectively, as they are quite common.query=g.V("Humphrey Bogart").All()response=client.Send(query)# "Humphrey Bogart" is a name, but not an entity.# Let's find the entities with this name in our dataset.# Follow links that are pointing In to our "Humphrey Bogart" node with the predicate "name".query=g.V("Humphrey Bogart").In("<name>").All()response=client.Send(query)# Notice that "name" is a generic predicate in our dataset.# Starting with a movie gives a similar effect.query=g.V("Casablanca").In("name").All()response=client.Send(query)# Relatedly, we can ask the reverse; all ids with the name "Casablanca"query=g.V().Has("name","Casablanca").All()response=client.Send(query)# Let's get the list of actors in the filmquery=g.V().Has("name","Casablanca")\.Out("/film/film/starring")\.Out("/film/performance/actor")\.Out("name")\.All()response=client.Send(query)# But this is starting to get long.# Let's use a morphism -- a pre-defined path stored in a variable -- as our linkagefilm_to_actor=g.Morphism().Out("/film/film/starring").Out("/film/performance/actor")query=g.V()\.Has("name","Casablanca")\.Follow(film_to_actor)\.Out("name")\.All()response=client.Send(query)# Add data programatically to the JSON result list. Can be any JSON type.query=g.Emit({'name':"John Doe",'age':41,'isActor':True})response=client.Send(query)BugsIf you encounter a bug, performance issue, or malfunction, please add anIssueswith steps on how to reproduce the problem
or feel to free to open a pull request.TODOImprove Gizmo implementation (Basic steps implemented at the moment)Add more testsAdd more documentationOpen Source  Projects in Userequestsby @kennethreitzLicense@ziλasal & @abdullahselek
Package: pylf
PyLfA lightweight Python library for simulating Chinese handwritingTutorial|Examples|Release Notes|ContributingVisionReveal the nature of Chinese handwriting and use it to implement beautiful, simple and easy-to-use interfaces.Algorithm首先，在水平位置、竖直位置和字体大小三个自由度上，对每个字的整体做随机扰动。随后，在水平位置、竖直位置和旋转角度三个自由度上，对每个字的每个笔画做随机扰动。Installationpip install pylfQuick StartfromPILimportImage,ImageFontfrompylfimportTemplate,handwritetext="我能吞下玻璃而不伤身体。"template=Template(background=Image.new(mode="1",size=(1024,2048),color=1),font_size=100,font=ImageFont.truetype("path/to/my/font.ttf"),)forimageinhandwrite(text,template):image.show()更多信息请参阅Tutorial。Gallery前出师表.py