Saravanan666/pypi-org huggingface dataset:
Package: postmodel
postmodelIntroductionPostmodel is an easy-to-useasyncioORM(Object Relational Mapper)inspired by Django and Tortoise ORM.Postmodel provides 90% Django ORM like API, to ease the migration of developers wishing to switch toasyncio.Currently, Postmodel provides following features:full active-record patternoptimistic locking100% code coverageBut, it still have some limits:only support Postgresqlno planing support SQLite, instead it will supports RediSQLno support relationPostmodel is supported on CPython >= 3.6 for PostgreSQL.Getting StartedInstallationYou have to install postmodel like this:pip install postmodelQuick TutorialPrimary entity of postmodel ispostmodel.models.Model.
You can start writing models like this:frompostmodelimportmodelsclassBook(models.Model):id=models.IntField(pk=True)name=models.TextField()tag=models.CharField(max_length=120)classMeta:table="book_test"def__str__(self):returnself.nameAfter you defined all your models, postmodel needs you to init them, in order to create backward relations between models and match your db client with appropriate models.You can do it like this:frompostmodelimportPostmodelasyncdefinit():# Here we connect to a PostgreSQL DB.# also specify the app name of "models"# which contain models from "app.models"awaitPostmodel.init('postgres://postgres@localhost:54320/test_db',modules=[__name__])# Generate the schemaawaitPostmodel.generate_schemas()Here we create connection to Postgres database, and then we discover & initialise models.Postmodel currently supports the following databases:PostgreSQL (requiresasyncpg)generate_schemagenerates the schema on an empty database. Postmodel generates schemas in safe mode by default which
includes theIF NOT EXISTSclause, so you may include it in your main code.After that you can start using your models:# Create instance by savebook=Book(id=1,name='Mastering postmdel',tag="orm")awaitbook.save()# Or by .create()awaitBook.create(id=2,name='Learning Python',tag="python")# Querybooks=awaitBook.filter(tag="orm").all()assertlen(books)==1ContributingPlease have a look at theContribution Guide <docs/CONTRIBUTING.md>_LicenseThis project is licensed under the MIT License - see theLICENSE <LICENSE>_ file for details
Package: postmonkey
PostMonkey 1.0bPostMonkeyis a simple Python (2.6+) wrapper for MailChimp’s API
version 1.3.Features100% test coverageConnection handling via the excellentRequestslibraryConfigurable timeoutSimpleExceptionsBasic UsageOnce you create aPostMonkeyinstance with your MailChimp API key,
you can use it to call MailChimp’s API methods directly:frompostmonkeyimportPostMonkeypm=PostMonkey('your_api_key')pm.ping()# returns u"Everything's Chimpy!"If the MailChimp method call accepts parameters, you can supply them in the form
of keyword arguments. SeeExamplesfor common use cases, and refer to theMailChimp API v1.3 official documentationfor a complete list of method calls,
parameters, and response objects.MailChimp has established guidelines/limits for API usage, so please refer
to theirFAQfor information.Note: it is the caller’s responsibility to supply valid method names and any
required parameters. If MailChimp receives an invalid request,PostMonkeywill raise apostmonkey.exceptions.MailChimpExceptioncontaining the
error code and message. SeeMailChimp API v1.3 - Exceptionsfor additional
details.ExamplesCreate a newPostMonkeyinstance with a 10 second timeout for requests:frompostmonkeyimportPostMonkeypm=PostMonkey('your_api_key',timeout=10)Get the IDs for your campaign lists:lists=pm.lists()# print the ID and name of each listforlistinlists['data']:printlist['id'],list['name']Subscribe “emailaddress” to list ID 5:pm.listSubscribe(id=5,email_address="emailaddress")Catch an exception returned by MailChimp (invalid list ID):frompostmonkeyimportMailChimpExceptiontry:pm.listSubscribe(id=42,email_address="emailaddress")exceptMailChimpException,e:printe.code# 200printe.error# u'Invalid MailChimp List ID: 42'Get campaign data for all “sent” campaigns:campaigns=pm.campaigns(filters=[{'status':'sent'}])# print the name and count of emails sent for each campaignforcincampaigns['data']:printc['title'],c['emails_sent']Changelog-Initial Release-2012-10-11: Quote JSON string before sending POST request-2013-07-03: Documentation updates and version bump (no code changes)
Package: postnl-api
python-postnl-api(Unofficial) Python wrapper for the PostNL API (Dutch Postal Services), which can be used to track packages and letter deliveries. You can use yourjouw.postnl.nlcredentials to use the API.Quick testWhen installed:python-mpostnl_api.test_postnl_apiUSERNAMEPASSWORDOr running directly:test_postnl_api.pyUSERNAMEPASSWORDCode Examplefrompostnl_apiimportPostNL_API# Login using your jouw.postnl.nl credentialspostnl=PostNL_API('email@domain.com','password')# Retrieve relevant incoming packagesprint("Getting relevant deliveries")rel_deliveries=postnl.get_relevant_deliveries()fordeliveryinrel_deliveries:print(delivery)# Retrieve all incoming packagesprint("Getting all deliveries")all_deliveries=postnl.get_deliveries()fordeliveryinall_deliveries:print(delivery)# Retrieve sent packagesprint("Getting all distributions (sent packages)")distributions=postnl.get_distributions()fordistributionindistributions:print(distribution)# Retrieve incoming lettersprint("Getting all letters, if that function is turned on")letters=postnl.get_letters()forletterinletters:print(letter)MiscellaneousThis blogpostdescribes the process of figuring out the API endpoints and shows how this can be done for other API's.ChangelogSee theCHANGELOGfile.Contributors@eavanvalkenburg@peternijssen@IcyPalm@0x00-0xFFLicenseMIT
Package: postnl-locations
A Python wrapper for using the PostNL locations SOAP API. You can find the source code
here:python-postnl-locations.CompatibilityThis package is depending onsuds-jurko, a fully compatible version of the original
package with some bug fixes and speed improvements, and has support for python3 as well.
So this package depends on it (suds-py3still has some compatibility issues).UsageTo use this package follow these steps:Install this python package someway. (pip installpostnl-locations)In your project, create a settings dictionary with at least the following parameters:MY_SETTINGS={# this is the testservice wsdl, see the PostNL documentation for the production settings'wsdl':"https://testservice.postnl.com/CIF_SB/LocationWebService/2_0/?wsdl",'countrycode':'NL','username':"my-username",# the password is SHA1 hashed'password':"my-sha1-hashed-password",}Use the client as following:frompostnl.locations.clientimportLocationslocations=Locations(settings=MY_SETTINGS)my_locations=locations.nearest_locations(postalcode="6821AD")Take a look at thesettings.pyfor more options (you can adjust the results with a custom resultstransform claass for example).
Package: postodon
postodonRandomly posts things to Mastadon from a pre-defined list, using the Mastodon API.The list of posts is a JSON file:[
    {"content": "Text of the post", "id": 1, "status": "unposted"},
    ...,
]The commandpostodonrandomly selects an unposted post, posts it to Mastodon,
and marks it as posted in the list. If there are no unposted items, an already-
posted item is used instead.RequirementsPostodon requires Python 3.7+. It is tested on Linux and macOS.InstallationPostodon is published as a Python package and can be installed withpipx(recommended), orpipwithin a virtual environment. Open up a terminal and
install with:pipx install postodonConfigurationRegister an application on Mastodon as described here:https://docs.joinmastodon.org/client/token/#appGet an access token as described here:https://docs.joinmastodon.org/client/authorized/#flowSecurely store the returnedaccess_tokenfor future referenceRunpostodon initto create an empty config file (note the location)Edit the config file to point to the name of the Mastodon instance (e.g.botsin.space) and the path to the posts file, e.g./path/to/posts.jsonPut the access token in an environment variable calledAUTH_TOKENexport AUTH_TOKEN=<your_access_token_here>UsageTo publicly post a random post from the list (marked as English), and update
the list (i.e. mark the post having been posted):postodonThis is a shortcut forpostodon post. NB if there are no unposted items left
in the list, a randomly-selected item from the 'posted' selection will be
posted instead.To randomly select an item from the list without either updating the list or
posting (dry-run mode):postodon post -nTo add new posts to the list for future posting:postodon add "Text of post"DevelopmentTo contribute to this library, first checkout the code. Then create a new
virtual environment:cd postodon
python -m venv .venv
source .venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[dev,tests]'To run the tests:pytest
Package: postolit
Postoperative Library for Image Transformation (PostoLIT)Postoperative Library for Image TransformationDeveloped: Prof. Anatoly Postolit
(doctor of technical Sciences, Professor, academician of the Russian Academy of transport),
Director of the company Smart Information Systems LTd)
e-mail:anat_post@mail.ruThis function library is designed for post-processing images and frame-by-frame processing of video files.
Can be used in computer vision systems (fixation of violations of traffic rules, assessment of drivers skills
and car control, control of unmanned vehicles, counting the number of the visitor in the public areas and
passengers in public transport, in medicine, in the advertising business, agriculture, etc.).
This is the first version of the library, which will be further developed and expanded.1.black_image(image)2.canny_edge_detector(image)3.get_video_param(file_input)4.gray_image(image)5.resize_height(image, height)6.resize_percent (image, percent)7.resize_width(image, width)8.resize_wh(image, width, height)9.rotate_image_fs(image, corner)10.rotate_image_is(mat, angle)11.set_video_param(file_input, width, height)12.segment_image(image)
Package: postopus
PostopusPostopus(the POST-processing of OctoPUS data) is an environment that
can help with the analysis of data that was computed using theOctopusTDDFT package.Note: ase is not listed as a dependency, but it will be needed, so please execute:pip install git+https://gitlab.com/ase/ase.git@master.
Context, for those who are interested:asehas already merged some of our feature requests that are needed for postopus, but they are not yet tag-released.Version supportPython versions supported: 3.8, 3.9 and 3.10.
Release 0.2.0 will support octopus@12.0, 12.1, 12.2.Recommended installationFor analyzing data, static (matplotlib) and interactive (holoviews) plotting inside Jupyter Notebooks are a common choice. Thus,pip install postopus[recommended]is recommended, which will install the needed packages for this purpose.
Package: postorius
Copyright (C) 1998-2021 by the Free Software Foundation, Inc.The Postorius Django app provides a web user interface to
access GNU Mailman.Postorius is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, version 3 of the License.Postorius is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
General Public License for more details.You should have received a copy of the GNU Lesser General Public License
along with mailman.client. If not, see <http://www.gnu.org/licenses/>.RequirementsPostorius requires Python 3.7+.The minimum Django version is 3.2.Postorius needs a running version of GNU Mailman version 3.3.5.InstallationTo install GNU Mailman Suite follow the instructions in the documentation:https://docs.mailman3.org/AcknowledgementsMany thanks go out to Anna Senarclens de Grancy and Benedict Stein for
developing the initial versions of this Django app during the Google Summer of
Code 2010 and 2011.
Package: post-orm
PostgreSQL Python ORMA minimal Python ORM for interacting with a PostgreSQL database (usingpsycopg2)Installationpipinstallpost-ormExamplefrompost_ormimportDatabase,Column,Table,ForeignKeydb=Database(database="test_database",user="postgres",password="1234",host="localhost",port="5432",)# Create tablesclassSchool(Table):country=Column(str)name=Column(str)classStudent(Table):name=Column(str)school=ForeignKey(School)db.create([School,Student])# Save schoolschool=School(name="Hogwarts",country="England")db.save(school)# Save studentsharry=Student(name="Harry Potter",school=school)ron=Student(name="Ron Weasley",school=school)db.save([harry,ron])# Make queriesall_students=db.all(Student)harrys_school=db.query(Student,name="Harry Potter",limit=1).school# use limit=1 to return a single object.hogwarts=db.query(School,country="Eng%",limit=1)# use % for wildcard search.assertharrys_school.country==hogwarts.countryRun tests in DockerPrepare a test-databasedocker run --rm -P -p 127.0.0.1:5432:5432 -e POSTGRES_PASSWORD="1234" --name pg postgres:alpine
psql postgresql://postgres:1234@localhost:5432/postgres
CREATE DATABASE test_database;Run testspython -m pytest .This project was heavily inspiered by the SQLite ORM inthis courseon testdriven.io
Package: postpone
An implementation of lazy strings. Can be used in combination withgettextfor the translation of web apps.It’s less beautiful thanspeaklater(an other implementation
of lazy strings), but I wanted lazy strings that work even if a
single thread interleaves the processing of many http requests (this happens with async frameworks).postponedoesn’t rely on a global state. And it doesn’t use thethread.local()trick thatspeaklateruses either.Example of use:>>>frompostponeimportevalr,LazyStringas_>>>translations={"Order{item}.":"Commander{item}.","Take a nap":"Faire une sieste","Stare at the wall for%sminutes.":"Fixer le mur pendant%sminutes.","a new pillow":"un nouvel oreiller"}>>>tasklist=[_("Order{item}.").format(item=_("a new pillow")),_("Take a nap")+'!',_("Stare at the wall for%sminutes.")%30]>>>evalr(tasklist,translations.get)['Commander un nouvel oreiller.','Faire une sieste!','Fixer le mur pendant 30 minutes.']evalrwalks python dictionaries, lists, tuples or sets and apply
a function to all the strings wrapped inside aLazyStringobject.To apply a function to the strings inside a single expression, you can use theevalmethod:>>>s=_("Take a nap")+'!'>>>s.eval(str.upper)'TAKE A NAP!'>>>s.eval(translations.get)'Faire une sieste!'Or, again, theevalrfunction>>>evalr(_("a new pillow").capitalize(),translations.get)'Un nouvel oreiller'For most projects containing more than a few strings or languages, you’ll probably want to
use thegettextmodule to supply you with a translation function.importgettexttranslation=gettext.translation("myproject","./locale",["fr"])translated_tasklist=evalr(tasklist,translation.ugettext)GitHub repo:https://github.com/leforestier/postpone
Package: postprice
postpriceБиблиотека Python для расчета стоимости почтовых отправлений Почтой России.Бибиотека использует API ресурсаpostprice.ru.Версия PythonВерсия, на которой велась разработка - 3.8, но функционал должен работать для любой версии Python 3.InstallationpipinstallpostpriceUsage examplesfrompostpriceimportPostPricejson=PostPrice().calculate(index_from='630000',index_to='620000',mass=40,valuation=500,vat=True)Другой вариант вызова:post=PostPrice(index_from='630000',valuation=500,vat=True)json=post.calculate(index_to='620000',mass=40)Пример json-ответа:{'code':100,'locality_from':'НОВОСИБИРСК ПОЧТАМТ','locality_to':'ЕКАТЕРИНБУРГ','city_from':'НОВОСИБИРСК','city_to':'ЕКАТЕРИНБУРГ','region_from':'НОВОСИБИРСКАЯ ОБЛАСТЬ','region_to':'СВЕРДЛОВСКАЯ ОБЛАСТЬ','simple_letter':31.2,'reg_letter':68.4,'val_letter':159.2,'simple_parcel':48,'reg_parcel':84,'val_parcel':164,'pkg':284.34,'ems':727.52,'letter_reg_1class':144,'letter_val_1class':228,'reg_parcel1class':186,'val_parcel1class':252,'pkg_1class':179,'pkg_val_1class':283,'cod':605}Описание параметровfrom- Почтовый индекс отправителя (6 цифр).to- Почтовый индекс получателя (6 цифр).index_from- alias для from.index_to- alias для to.mass- Масса отправления, в граммах (значения от 0 до 20000).valuation- Объявленная ценность, в рублях.vat- НДС 20% (1 — с НДС, 0 — без НДС). Возможна подача boolean.oversized- Негабаритная посылка (1 — негабаритная, 0 — обычная). Возможна подача boolean.month- Месяц отправки (от 1 до 12).day- День месяца отправки (от 1 до 31).date- Дата типа datetime.datetime (или datetime.date), подается вместо month и date.Обязательные параметры запроса: from, to.Changelog1.0.0 (2020-10-07)Первая рабочая версияТегиПочта России, доставка, почта, письмо, посылка, pochta.ru, russian post, russianpost
Package: postProcessingGEP
Usage of PostProcessingServiceYou can access following functions:The provided package is a collection of functions for text preprocessing and cleaning. Here is a brief explanation of each function:jaccard_similarity: To calculate jaccard similaritylevenshtein_distance: To calculate levenshtein distancescore: To calculate combined scoreFunction signature : score(score1, w1, score2, w2) where  score1,score2 is jaccard_similarity,levenshtein_distance & w1,w2 is weightage of score1, score2 resp.Example usage:pip install postProcessingGEP==1.0.0import postProcessingGEPprint(postProcessingGEP.PostProcessingService.jaccard_similarity(inputText1,inputText2))
Package: post-processing-library-llm
InstallationYou can install Post-processing-library-llm library using pip:pipinstallPost-processing-library-llmNamed Entity Recognition (NER)In this example, we’ll use the Post-processing-library-llm to perform NER on a set of documents and evaluate the results.frompost_processing_library_llm.nerimportner# Define ground truth and prediction dictionariestruth_dict={'airplane':["Boeing B-52 Stratofortress","predator drone"]}prediction_dict={'airplane':["drone","sparrow"]}# Perform NER and get resultsner_results=ner.named_entity_recognition(truth_dict,prediction_dict,fuzzy_threshold)# Print the resultsprint(ner_results)NER Output:{‘Correct Entities’: 1, ‘Missed Entities’: 1, ‘False Positive Entities’: 1}Text Matching ExampleHere’s an example of how to perform Text Matching using thePost-processing-library-llmlibrary:Text Matching involves comparing two text strings and determining how similar or different they are. The post_processing_library_llm provides various text matching algorithms, including direct matching, token overlap, and cosine similarity, and gives all the metrics as output.In this example, we’ll use the Text Matcher to compare a list of ground truth texts with predicted texts and calculate matching metrics.frompost_processing_library_llm.get_metricsimportTextMatcher# Define ground truth and prediction liststruth_list=["this is a ball","cat","Toyota Camry"]pred_list=["this is a ball","Ford Mustang","Toyota Corolla"]# Perform text matching with cosine similaritymetrics=text_matcher.match_texts(truth_list,pred_list,match_type='cosine_similarity')# Print the metricsprint(metrics)Text Matching Output:{‘Precision’: 1.0, ‘Recall’: 0.3333333333333333, ‘Specificity’: nan, ‘F1 Score’: 0.5, ‘Negative Predictive Value (NPV)’: 0.0, ‘False Positive Rate (FPR)’: nan, ‘False Negative Rate (FNR)’: 0.6666666666666666, ‘False Discovery Rate (FDR)’: 0.0, ‘Accuracy’: 0.3333333333333333, ‘True Positive Rate (TPR)’: 0.3333333333333333, ‘Positive Predictive Value (PPV)’: 1.0, ‘True Negative Rate (TNR)’: nan, ‘Macro Average Precision’: 0.5, ‘Macro Average Recall’: 0.16666666666666666, ‘Macro Average F1 Score’: 0.25, ‘Weighted Average Precision’: 1.0, ‘Weighted Average Recall’: 0.3333333333333333, ‘Weighted Average F1 Score’: 0.5}
Package: postprocessing_variant_calls
Post-processing of variant callsThis package provides a variety of commands for manipulating different types of common outputs (e.g. mafs, vcf and txt files) from different bioinformatic variant callers such as mutect and vardict.Supported File Types:mafvardictInstallationFor general use you can run:pip install postprocessing_variant_callsor a tagged version withpip install git+https://github.com/msk-access/postprocessing_variant_calls.git@<version>For setting up a development environment please see theSetting up a Dev Environmentsection.UsageSeeCLIfor commmand line usage of the package.Setting up a Dev EnvironmentInstall External DependenciesHave an environment with python >= 3.8 installed.Install poetry:pipinstallpoetryInstall Package DependenciesThen install project dependencies with Poetry.cd/path/to/postprocessing_variant_calls
poetryinstall.Accessing EnvironmentTo access the environment after initial setup up run:poetryshell
Package: post-qa
post-qaUpload metric definitions, measurements and blobs fromvalidate_drpto
theSQuaSH API.post-qais meant to run in a CI workflow, like
LSST Data Management’s Jenkins CI.Installpip install post-qaCommand Line Interfaceusage: post-qa [-h] --lsstsw LSSTSW_DIRNAME --qa-json QA_JSON_PATH --api-url
               API_URL --api-user API_USER --api-password API_PASSWORD [--test]

Upload JSON from validate_drp to the SQuaSH API.

This script is meant to be run from a Jenkins CI environment
and uses the following environment variables:

- ``BUILD_ID`` : ID in the ci system
- ``BUILD_URL``: ci page with information about the build
- ``PRODUCT``: the name of the product built, in this case 'validate_drp'
- ``dataset``: the name of the dataset processed by validate_drp
- ``label`` : the name of the platform where it runs


optional arguments:
  -h, --help            show this help message and exit
  --lsstsw LSSTSW_DIRNAME
                        Path of lsstsw directory
  --qa-json QA_JSON_PATH
                        Filename of QA JSON output file
  --api-url API_URL     SQuaSH API root URL
  --api-user API_USER   Username for SQuaSH API
  --api-password API_PASSWORD
                        Password for SQuaSH API
  --test                Print the shimmed JSON rather than uploading itFurther Readinglsst.validate.base metric measurement framework.SQR-008: SQUASH QA database.SQR-009: SQUASH dashboard prototype.License InfoCopyright 2017 AURA/LSSTMIT licensed open source.
Package: postr
PostrSmall python nostr client library for Python 3.10+Installationpip install postrExampleimportasyncioimportpostrasyncdefcontroller():user=postr.User()hub=postr.RelayHub()damus=awaithub.connect("wss://relay.damus.io")wellorder=awaithub.connect("wss://nostr-verified.wellorder.net")hub.publish(postr.RequestMessage(subscription_id="ABC",filters=postr.Filter(kinds=postr.SetMetadata),))#hub.publish(postr.EventMessage(event=user.sign(postr.TextNote(content="Hello there!"))))# parse messages as they are receivedwhileTrue:matchmessage:=awaithub.messages.get():casepostr.SubscriptionResponse(event=postr.TextNote()):event=message.eventlog.info(f"TextNote{event.content}")casepostr.SubscriptionResponse(event=postr.RecommendServer()):event=message.eventknown=set(map(lambdax:x.relay,hub.connections))ifevent.urlnotinknown:log.info(f"Connecting to '{event.url}'")socket=awaithub.connect(event.url)casepostr.SubscriptionResponse(event=postr.SetMetadata()):event=message.eventlog.info(f"Set Metadata:{event.content}")casepostr.SubscriptionResponse():event=message.eventlog.info(f"unknown kind{event.kind}")casepostr.EndOfStoredEventsResponse():log.info("Closing subscription at end of stored events")hub.publish(postr.CloseMessage(subscription_id=message.subscription_id),connection=message.relay,)case_:log.info("Received something else")if__name__=="__main__":logging.basicConfig(level=logging.INFO)