Saravanan666/pypi-org huggingface dataset:
Package: pynmeaparser
pyNMEAParserA package to parse general form of NMEA sentences. It is not specific to just certain devices only.
After successfully parsing an NMEA data, it will return a list of fields in the NMEA sentence.APINMEAParser()Description:The constructor for NMEAParser class.Returns:NMEAParser object.# Create NMEAParser objectparser=NMEAParser()add_handler(id:str, fn:Callable)Description:Attach a handler function to be called whenidmatches the key.Parameters:id: A string representing the key.fn: The handler function of which will be called ifidmatches the key. The function needs to accept a list as a parameter.defmy_handler(fields):print(fields)parser.add_handler('GPGGA',my_handler)process(sentence:str)Description:Process the string passed to the function. This string will be concatenated with the previously incomplete processed string.Parameters:sentence: NMEA string format. This can be an arbitrary data, but needs to adhere to NMEA standard.# Process an NMEA stringparser.process('$GPZDA,024008.97,24,11,2022,00,00*62')parser.process('$MY_OWN,SOME,DATA,HERE*2F')# Can be arbitrary as long as adhering to NMEA standard.get_buffer()Description:Process the string passed to the function. This string will be concatenated with the previously incomplete processed string.Returns:The string currently in the buffer.print('Unprocessed string:',parser.get_buffer())# Display the string that is still not processed.UsageExamplesSimple parsefrompynmeaparserimportNMEAParserdefmy_handler(fields):print(fields)parser=NMEAParser()# Create parser objectparser.add_handler('GPZDA',handler)# Add handler. The handler function will be called if the first field contains the key.parser.process('$GPZDA,024008.97,24,11,2022,00,00*62')# Process NMEA string here.# Output: ['GPZDA', '024008.97', '24', '11', '2022', '00', '00']
Package: pynml
Python library for the Network Markup Language (NML) standard for network
topologies representation.https://www.ogf.org/documents/GFD.206.pdfDocumentationhttp://pynml.rtfd.org/LicenseCopyright (C) 2015-2016 Hewlett Packard Enterprise Development LP

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
Package: pynmmso
Python implementation of the Niching Migratory Multi-Swarm Optimser, described
in: “Running Up Those Hills: Multi-Modal Search with the Niching Migratory Multi-Swarm Optimiser”
by Jonathan E. Fieldsend published in Proceedings of the IEEE Congress on Evolutionary Computation,
pages 2593-2600, 2014 (http://hdl.handle.net/10871/15247)Please reference this paper if you undertake work utilising this code.Documentation for pynmmso can be found at:https://github.com/EPCCed/pynmmso/wikiInstall pynmmsoThe Python implementation of NMMSO requires Python 3 and Numpy (https://www.numpy.org/).You can install pynmmso using pip:pip install pynmmsoUsing NMMSOWe will demonstrate using NMMSO to solve a one-dimensional optimisation problem. The function will we optimise is:-x4+ x3+ 3x2Plotting this function with x in the range [-2, 3] gives:This function has two optima (one global and one local).  We can use NMMSO to find these optima.First we need to write Python code that captures the problem we wish to solve. Problems must be written as a Python class that implements two functions:fitnessandget_bounds.Thefitnessfunction takes one argument. This argument is a 1D Numpy array containing a value for each parameter of the problem.  Since our problem is one dimensional this array will contain a single value. The function must return a single scalar value which is thefitnessfor the given parameter values.  This is where we implement the function to be optimised.Theget_boundsfunction takes no arguments and returns two Python lists that define the bounds of the parameter search.  The first list specifies the minimum value for each parameter, the second list specifies the maximum value for each parameter.  As our problem is one dimensional there will only be one value in each list.The implementation of our problem in Python is therefore:classMyProblem:@staticmethoddeffitness(params):x=params[0]return-x**4+x**3+3*x**2@staticmethoddefget_bounds():return[-2],[3]The following code uses NMMSO to solve this problem. TheNmmsoobject is constructed with an instance of the problem class.  The algorithm is then run and will stop at the end of the iteration where the number of fitness function evaluations exceeds the given
amount. When run the algorithm returns a list of objects that contain the location and value for each of the discovered modes.frompynmmsoimportNmmsoclassMyProblem:@staticmethoddeffitness(params):x=params[0]return-x**4+x**3+3*x**2@staticmethoddefget_bounds():return[-2],[3]defmain():number_of_fitness_evaluations=1000nmmso=Nmmso(MyProblem())my_result=nmmso.run(number_of_fitness_evaluations)formode_resultinmy_result:print("Mode at{}has value{}".format(mode_result.location,mode_result.value))if__name__=="__main__":main()Running this code produces output similar to the following:Modeat[1.65586203]hasvalue5.247909824656198Modeat[-0.90586887]hasvalue1.0450589249496887It has correctly found the two peaks in the graph.Further documentation is describing more advanced usage is available at:https://github.com/EPCCed/pynmmso/wiki
Package: pynmr
pynmrpyNMR is a set of python modules to parse, process, and analyze NMR data.There are some fragments of a graphical user interface but at this point pyNMR is best used together with Jupyter Lab.Currently supported NMR formats are Bruker TopSpin and RS2D.There is some code for parsing files from Tecmag NTNMR, Magritek, and Varian under pynmr/model/parser, but at this point these formats are not
officially supported.Installationpynmr is available at pip. It may be installed
with::pip install pynmrUsageTo import a Bruker dataset instantiate an nmr Data  object:..code:: pythonimport pynmr
 path = "pathToTopSpin/"
 
 import pynmr.model.parser.topSpin as T
 import pynmr.model.processor as P
 import pynmr.model.operations as O
 
 import matplotlib.pyplot as plt
 import numpy as np
 
 data = T.TopSpin("./data/bruker/dnp_210316_1_solids/1/")
 
 Processor = P.Processor([O.LeftShift(21),
                     O.LineBroadening(0.2),
                     O.FourierTransform(),
                     O.Phase0D(190)])
 Processor.runStack(data)Internal NotesTo install this package locally and install for development, use this commandpip install -e ./More info available here:https://packaging.python.org/tutorials/installing-packages/MIT LicenseCopyright (c) 2022 Benno MeierPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Package: pynmrstar
A Python module for reading, writing, and manipulating NMR-STAR files.Python versions supported: 3.6, 3.7, 3.8, 3.9, 3.10, 3.11OverviewThis library was developed by the BMRB to give the Python-using NMR
community tools to work with the NMR-STAR data format. It is used
internally and is actively maintained. The library is thoroughly
documented such that callinghelp(object_or_method)from an
interactive python session will print the documentation for the object
or method. An even more convenient way to learn how to use this library
is to read the documentation atread the docs.
Package: pynnacle
PynnacleA utility class to simplify sending emails.Pynnacle provides a wrapper to mimetypes, smtplib and email.message libraries to provide a simplified facade
interface to make sending emails as simple as possible. It abstracts away all the low level details and when
imported into other modules provides a clean, clutter-free interface.InstallationOS X & Linux:pip3installpynnacleWindows:pipinstallpynnacleUsage exampleFirstly import the modulefrompynnacle.pynnacleimportSendEmailPynnacle stores the configuration of email servers in an 'ini' configuration file.
If a service is already configured then the main class can be instantiated with only 3 arguments e.g.:mailer=SendEmail(service="gmail",user_id="jsmith",user_pass="P@zzw0rd1",)If the service has not been configured, simply pass "custom" as the service and pass the other smtp arguments
to the initializer e.g.:mailer=SendEmail(service="custom",user_id="jsmith",user_pass="P@zzw0rd1",smtp_server="smtp.abc.com",smtp_port=25,smtp_authentication="yes",smtp_encryption="yes",)Then simply send the emailmailer.message_send(subject="Hi There",sender="sender@abc.com",recipient="recipient@xyz.com",body="This is where the text of the email body goes",)cc, bcc and attachments arguments can also be used, supplied as listsmailer.message_send(subject="Hi There",sender="sender@abc.com",recipient="recipient@xyz.com",body="This is where the text of the email body goes",cc=["person1@def.com","person2@ghi.com"],bcc=["person3@jkl.com","person4@mno.com"],attachments=["path_to_file1","path_to_file2"])Further simplificationsStoring and Reusing SMTPAdditional setting can be saved in the "ini" file as and when you like.e.g.config.ini[gmail]smtp_server=smtp.gmail.comsmtp_port=587smtp_authentication=yessmtp_encryption=yespop3_server=pop.gmail.compop3_port=995pop3_authentication=yespop3_encryption=yesStoring credentialsTo avoid hard-coding any credentials I use the Pythonkeyringlibraryservice="gmail"user_id=keyring.get_password(service,"service_id")user_pass=keyring.get_password(service,"service_password")For more examples and usage, please refer to theWiki.A Note on gmail authenticationAs of 30/05/2022 Google will no longer support the use of third-party apps or devices that only ask for your username and password.
The "Less secure app access" setting has now been turned off.
The application now has to be assigned a 16 byte code which can be configured from your account as follows:1 Log onto your account:https://myaccount.google.com2 Goto security3 Enable 2-step verification4 click "App password" to generate the keyThen simply use this along with the account email address to authenticateDocumentationRead the DocsExample UsageCreditsChangelogAPI ReferenceWikiMetaStephen R A King :sking.github@gmail.comDistributed under the MIT license. Seefor more information.Created with Cookiecutter template:pydoughversion 1.2.1
Package: pynndb2
PYNNDB2 - Python Native Nosql DataBase libraryThis is version 2 of the Python NoSQL database library, for more complete documentation
please visithttps://pynndb.madpenguin.ukor browse around the source code in this
repository.Please note that this library should be backwards compatible with V1 with regards to databases butNOTthe API.
The API has been reworked so you will need to modify any existing applications in order to use V2. The changes are more semantic than structural
and upgrading should not be too onerous. Also, there are new features in V2 which are not available in V1, so once you've
started using a database with the V2 library, it's probably best not to move backwards, although if you've not used compression
or full function indexes, moving back should be ok.PyNNDB is a NoSQL Database library implemented in Python utilising the LMDB key-value storage store for back-end functionality. Although there might be an immediate perception that this idea might result in something that is a little "slow", it consists of a python layer backed by a powerful engine written in 'C', much like other popular Python database solutions and as a result generally compares favourably.The idea of database logic coded in Python came about after many years of using both SQL and NoSQL databases with Python to write Cloud based microservices and coming across issued that were difficult to address with current main-stream solutions. Notably, it became apparent that the performance bottleneck in these applications ended up being in the Python layer between the application and the back-end database, a layer often added as a compatibility options to allow Python applications to access the database. This raised the question, "what if we pick a faster back-end, and make this Python layer a first-class component rather than an after-thought?"FeaturesNoSQL database library written in Python using the LMDB C-extension as a base KV storePrimary ObjectId() based indexes for all objectsMutiple secondary indexes based on Python functions, supporting unique and duplicatesTransparent compression / decompression (currently zStd and Snappy)Powerful and flexible search routinesDesigned to work in a multi-processor environment / multiprocessing IPCInherits the features of LMDB including ACID transaction processingNotesIF you are upgrading from 2.0 to 2.1 please be aware that the format of ObjectId has changed, so if your code relies on the ordering of ObjectId and you work with persistent data, you will probably want to rewrite your data with the new ObjectId for consistency.About the codeVersion 2 is coded for Python 3.7+ and makes use of Python3's new "typing" module with a view to self-documentation. All of
the API documentation (and many of the examples) are documented automatically 100% from source code using the documentation
routes contained within this repository, for example;If you have problems or spot any bugs, please feel free to log an issue on theBug Trackeror alternatively
connect onKeybase
Package: pynng
This is pynng.Ergonomic bindings fornanomsg next generation(nng), in Python.
pynng provides a nice interface on top of the full power of nng.  nng, and
therefore pynng, make it easy to communicate between processes on a single
computer or computers across a network.  This library is compatible with Python
≥ 3.6.  nng is therewritingofNanomsg, which is the spiritual successor toZeroMQ.GoalsProvide a Pythonic, works-out-of-the box library on Windows and Unix-y
platforms.  Like nng itself, the license is MIT, so it can be used without
restriction.InstallationOn Windows, MacOS, and Linux, the usualpip3 install pynngshould suffice.  Note that on 32-bit Linux and on macOS no binary distributions
are available, soCMakeis also required.Building from the GitHub repo works as well, natch:git clone https://github.com/codypiersall/pynng
cd pynng
pip3 install -e .(If you want to run tests, you also need topip3 install trio curio pytest pytest-asyncio pytest-trio pytest-curio,
then just runpytest test.)pynng might work on the BSDs as well.  Who knows!Using pynngUsing pynng is easy peasy:frompynngimportPair0s1=Pair0()s1.listen('tcp://127.0.0.1:54321')s2=Pair0()s2.dial('tcp://127.0.0.1:54321')s1.send(b'Well hello there')print(s2.recv())s1.close()s2.close()Since pynng sockets support setting most parameters in the socket's__init__method and is a context manager, the above code can be written much shorter:frompynngimportPair0withPair0(listen='tcp://127.0.0.1:54321')ass1,\Pair0(dial='tcp://127.0.0.1:54321')ass2:s1.send(b'Well hello there')print(s2.recv())Using pynng with an async frameworkAsynchronous sending also works withcurio,trioandasyncio.  Here is an example
using trio:importpynngimporttrioasyncdefsend_and_recv(sender,receiver,message):awaitsender.asend(message)returnawaitreceiver.arecv()withpynng.Pair0(listen='tcp://127.0.0.1:54321')ass1,\pynng.Pair0(dial='tcp://127.0.0.1:54321')ass2:received=trio.run(send_and_recv,s1,s2,b'hello there old pal!')assertreceived==b'hello there old pal!'Many other protocols are available as well:Pair0: one-to-one, bidirectional communication.Pair1: one-to-one, bidirectional communication, but also supporting
polyamorous socketsPub0,Sub0: publish/subscribe sockets.Surveyor0,Respondent0: Broadcast a survey to respondents, e.g. to find
out what services are available.Req0,Rep0: request/response pattern.Push0,Pull0: Aggregate messages from multiple sources and load balance
among many destinations.ExamplesSome examples (okay, just two examples) are available in theexamplesdirectory.Git Branch PolicyTheonlystable branch ismaster.  There willneverbe agit push -fon master.  On the other hand, all other branches are not considered stable;
they may be deleted, rebased, force-pushed, and any other manner of funky
business.
Package: pynng-tls
This is pynng.Ergonomic bindings fornanomsg next generation(nng), in Python.
pynng provides a nice interface on top of the full power of nng.  nng, and
therefore pynng, make it easy to communicate between processes on a single
computer or computers across a network.  This library is compatible with Python
≥ 3.5.  nng is therewritingofNanomsg, which is the spiritual successor toZeroMQ.GoalsProvide a Pythonic, works-out-of-the box library on Windows and Unix-y
platforms.  Like nng itself, the license is MIT, so it can be used without
restriction.InstallationOn Windows, MacOS, and Linux, the usualpip3 install pynngshould suffice.  Note that on 32-bit Linux and on macOS no binary distributions
are available, soCMakeis also required.Building from the GitHub repo works as well, natch:git clone https://github.com/codypiersall/pynng
cd pynng
pip3 install -e .(If you want to run tests, you also need topip3 install pytestandpip3 install trio, then just runpytest.)pynng might work on the BSDs as well.  Who knows!Using pynngUsing pynng is easy peasy:frompynngimportPair0s1=Pair0()s1.listen('tcp://127.0.0.1:54321')s2=Pair0()s2.dial('tcp://127.0.0.1:54321')s1.send(b'Well hello there')print(s2.recv())s1.close()s2.close()Since pynng sockets support setting most parameters in the socket's__init__method and is a context manager, the above code can be written much shorter:frompynngimportPair0withPair0(listen='tcp://127.0.0.1:54321')ass1,\Pair0(dial='tcp://127.0.0.1:54321')ass2:s1.send(b'Well hello there')print(s2.recv())Using pynng with an async frameworkAsynchronous sending also works withtrioandasyncio.  Here is an example
using trio:importpynngimporttrioasyncdefsend_and_recv(sender,receiver,message):awaitsender.asend(message)returnawaitreceiver.arecv()withpynng.Pair0(listen='tcp://127.0.0.1:54321')ass1,\pynng.Pair0(dial='tcp://127.0.0.1:54321')ass2:received=trio.run(send_and_recv,s1,s2,b'hello there old pal!')assertreceived==b'hello there old pal!'Many other protocols are available as well:Pair0: one-to-one, bidirectional communication.Pair1: one-to-one, bidirectional communication, but also supporting
polyamorous socketsPub0,Sub0: publish/subscribe sockets.Surveyor0,Respondent0: Broadcast a survey to respondents, e.g. to find
out what services are available.Req0,Rep0: request/response pattern.Push0,Pull0: Aggregate messages from multiple sources and load balance
among many destinations.Feel free to check out thedocumentation, which
is currently a work in progress.ExamplesSome examples (okay, just two examples) are available in theexamplesdirectory.Git Branch PolicyTheonlystable branch ismaster.  There willneverbe agit push -fon master.  On the other hand, all other branches are not considered stable;
they may be deleted, rebased, force-pushed, and any other manner of funky
business.TODOMore docs.  Most of the public API has docstrings, but hosted documentation
at readthedocs will happen one day.
Package: pyNNMF
pyNNMF - Non-Negative Matrix Factorization (NNMF)Library for computing Non-Negative Matrix Factorisation with missing values imputation.AuthorsMário Antunes-mariolpantunesLicenseThis project is licensed under the MIT License - see theLICENSEfile for detailsStatusMIT LicenseCopyright (c) 2022 Mário AntunesPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.