Saravanan666/pypi-org huggingface dataset:
Package: pypay
pypay provides a clean API for confirming Paypal payments via PDT or IPN. It takes the boilerplate out of interacting with these services and normalises the Paypal response into something sensible.Under the hood pypay uses the excellentRequestslibrary for handling http.InstallationpipinstallpypayUsageTo check a payment viaPDTimportpypayresponse=pypay.pdt_confirm('your_transaction_id','your_identity_token')To check a payment viaIPNimportpypayresponse=pypay.ipn_confirm('query_params_from_paypal')You can pass the query params as either a string (e.g. ‘quantity=1&name=joe’) or a dict. This is particularly useful if you’re using Django as you can drop in request.POST and everything will just work.Response objectsResponse objects always have two propertiesresponse.confirmed# bool indicating if payment is verifiedresponse.details# dict containing all the Paypal variables that were returnedHandling exceptionsIn the event of a problem making the http call to Paypal, pypay will raise apypay.exceptions.RequestError.The values passed topdt_confirmandipn_confirmare sanity checked and apypay.exceptions.InvalidPaypalDatawill be raised if they are of the wrong type.Python version supportpypay runs on Python 2.6, 2.7, 3.3, 3.4, 3.5 and 3.6 using theSixcompatibility library.Running testsRun the test suite withToxpipinstalltoxTests are written withpytest
Package: py-pay
py-payPython pay library.pip install -U py-pay微信支付from py_pay.wechat import WechatPay
wechat_conf = {
    'app_id': 'appid',
    'mch_id': '商户号',
    'key': '签名key',
    # 需要双向证书的配置下面两行
    # 'cert_file': '/path/to/cert_file',
    # 'cert_key': '/path/to/cert_key',
}
wechat_pay = WechatPay(**wechat_conf)

# 示例
params = {'foo': 'bar'}
wechat_pay.unifiedorder(params)  # 统一下单
wechat_pay.orderquery(params)  # 查询订单
wechat_pay.closeorder(params)  # 关闭订单
wechat_pay.refund(params)  # 申请退款
wechat_pay.refundquery(params)  # 退款查询
wechat_pay.pay_notify(request.body)  # 支付通知
wechat_pay.response(False, '签名失败')  # 支付通知

wechat_pay.promotion_transfers(params)  # 企业付款
Package: pypayex
# pypayexpypayex is a Python module for interacting with the PayEx SOAP API.The PayEx implementation manual is available here:http://www.payexpim.com/## InstallationInstall `pypayex` (available on PyPi):```shellpip install pypayex```Requires the `suds` SOAP library, and `ordereddict` on Python < 2.7.## Usage```pythonfrom payex.service import PayExservice = PayEx(merchant_number='YOUR_MERCHANT_NUMER', encryption_key='YOUR_ENCRYPTION_KEY', production=False)# Initialize paymentresponse = service.initialize(purchaseOperation='SALE',price='5000',currency='NOK',vat='2500',orderID='test1',productNumber='123',description=u'This is a test.',clientIPAddress='127.0.0.1',clientIdentifier='USERAGENT=test&username=testuser',additionalValues='PAYMENTMENU=TRUE',returnUrl='http://example.org/return/',view='PX',cancelUrl='http://example.org/cancel/')```User performs the payment on the URL in `response['redirectURL']`, and is redirected back to the `returnUrl`.```python# When user is redirected back to the returnUrl, check the status of the transactionresponse = service.complete(orderRef='GENERATED_ORDER_REF')# Transaction was successfully performedresponse['status']['errorCode'] == 'OK' and response['transactionStatus'] == '0'```
Package: pypayment
PyPaymentPayment providers API wrapperDocumentation•Providers•Installation•Quickstart•Contributing•LicensePyPaymentis a Python wrapper for API of different payment providers.
It is designed to be a simple and easy to use library for developers to integrate payment into their applications.Main idea is to provide a unified interface for different payment providers.For more details seedocumentation.Providers:Qiwi P2PYooMoneyPayOkBetaTransferLava(under development)InstallationInstall the current version withPyPIpipinstall-UpypaymentQuickstartChoose payment provider and authorize. For example, for QiwifrompypaymentimportQiwiPaymentQiwiPayment.authorize("my_secret_key")Create a payment and get it'surlfrompypaymentimportPayment,QiwiPaymentpayment:Payment=QiwiPayment(amount=100)# E.x. commission is 10%print(payment.url)# https://oplata.qiwi.com/form/?invoice_uid=payment_unique_idWait for payment to be completed and get it's incomeUseupdate()method to update payment'sstatusandincomefrompypaymentimportPaymentStatuswhilepayment.status!=PaymentStatus.PAID:input("Press Enter to update payment status and income")payment.update()print("Payment is completed!")print(payment.income)# 90.0SummaryfrompypaymentimportPayment,QiwiPayment,PaymentStatusQiwiPayment.authorize("my_secret_key")payment:Payment=QiwiPayment(amount=100)# E.x. commission is 10%print(payment.url)# https://oplata.qiwi.com/form/?invoice_uid=payment_unique_idwhilepayment.status!=PaymentStatus.PAID:input("Press Enter to update payment status")payment.update()print("Payment is completed!")print(payment.income)# 90.0ContributingBug reports and/or pull requests are welcomeLicenseThe module is available as open source under the terms of theApache License, Version 2.0
Package: pyPayNowSg
pyPayNowSgGenerate PayNow Singapore QR codes in PythonSummaryWhat it says on the tin. This is mainly for frameworks/backends which rely on
generation of a PayNow QR code without the use of NodeJS/JavaScript,
such as sending e-mails or generating PDF files.DocumentationThis library only generates the ASCII code to be embedded in a QR
code image generator. However, there is sample code to generate the QR code
image using Pillow. Seetests/test_payload.pyfor an example.TODORaise Exceptions when user-specified texts/parameters exceed character limits
as per the EMVCO specificationsEnforce QR code version (version 11?) to fix output image sizeReferencesEMVCO QR Code SpecificationSocialLike my work? Buy me a coffee!
Package: pyPayokAPI
pyPayokAPIPython implementation ofPayok.iopublicAPIThis library may not fully implement API. However I will continue to maintain it, so if you need some not implemented methods - just open an issue.InstallationInstallation using pip (a Python package manager):$ pip install pyPayokAPIUsageEverything is as simple as theAPIitself.Create pyPayokAPI instanceAccess API methodsMost methods return result as correspondent class, so you can access data as fieldsfrom pyPayokAPI import pyPayokAPI
client = pyPayokAPI(
    xxxx,        # API ID
    "xxxxxxx")   # API key
balance = client.balance()
print("Balance: {}\nRef.balance: {}".format(balance.balance, balance.ref_balance))You can also check tests.py.ExceptionsExceptions are rised using pyPayokAPIException class.
Package: pypaypal
PyPaypal Client LibraryUnofficial python Paypal API client with v1 and v2 endpoint support and strongly type hinted objects.Currently developed API calls:InvoicingOrdersPayment ExpiriencePaymentsPayoutsPaypal SyncReferenced PayoutsSubscriptionsWebhooksDeveloped based on the available documentation at theofficial Paypal API reference.Basic UsageInstalationInstall from PyPi using pippipinstallpypaypalStarting a sessionSessions can be started by importinghttpmodule which supports different ways of authentication and session types.You can start a session using the "for_token" method providing a valid access token object and a session mode (LIVE or SANDBOX), for example:importjsonfrompypaypal.httpimport(SessionMode,PayPalToken,session_from_token)token=PayPalToken.serialize(json.loads('A paypal OAuth token'))# Live session from a tokenlive_session=session_from_token(token=token,session_mode=SessionMode.LIVE)# Sandbox session from a tokensandbox_session=session_from_token(token=token,session_mode=SessionMode.SANDBOX)Alternatively you can start a session by authenticating via the client library.In order to start a session based on authentication you need to specify the following:client: API client ID.secret: API client secret.auth_type: Which authorization type you'll use to communicate with the API. These can be:BASIC: Using basic auth for all request.TOKEN: Authenticate once and use a token and keep the session until the token expires.REFRESHABLE: Mix of BASIC and TOKEN to limit the amount of times the credentials are send back and forth a network. basically you authenticate the first time and get a token and the process will refresh the token logging in again with the credentials for an specified amount of sessions.mode: Session mode (LIVE or SANDBOX)Authentication samplesPython samples for each auth method.frompypaypal.httpimportauthenticate,SessionModesession_mode=SessionMode.SANDBOX# Starting a session with basic authbasic_session=authenticate(client,secret,session_mode,AuthType.BASIC)# Authenticate to start a session with a one time tokentoken_session=authenticate(client,secret,session_mode,AuthType.TOKEN)# Starting a session with refreshable tokens (refreshing up to 3 times)refresh_session=authenticate(client,secret,session_mode,AuthType.REFRESHABLE,refresh_limit=3)Making requestsAfter the session is stablished you can perform requests by importing the client library of your choice, all requests objects and calls are based on theofficial Paypal API reference.Sample requestimportjsonfrompypaypal.httpimport(SessionMode,PayPalToken,session_from_token)frompypaypal.clients.ordersimportOrderClientfrompypaypal.entities.baseimportPaypalApiResponseorder_id='some id'token=PayPalToken.serialize(json.loads('A paypal OAuth token'))# Sandbox session from a tokensandbox_session=session_from_token(token=token,session_mode=SessionMode.SANDBOX)client=OrderClient.create(sandbox_session)response:PaypalApiResponse=client.show_order_details(order_id)
Package: pypaystack2
PyPaystack2A developer-friendlyPaystackAPI wrapper.InstallationCreate yourPaystack accountto get your paystack secret key that is required to use this
package from your account's settings.Store your paystack secret key in your environment variable asPAYSTACK_AUTHORIZATION_KEYor pass it into the
pypaystack api wrapper on instantiation. (protect your secret key at all costs, never push it to a remote version
control system. it is advisable to start trying out this package with your test private key).Installpypaystack2package.pipinstall-Upypaystack2DocumentationSeeDocumentationfor more on this package.
Package: pypayz
PAYZ SDKProject OverviewThe PAYZ SDK is a software development kit that provides a set of tools and utilities for integrating with the PAYZ payment gateway.Table of ContentsGetting StartedInstallationFeaturesContributingLicenseGetting StartedThis section provides instructions on how to get started with the PAYZ SDK.InstallationpipinstallpypayzFeaturesThis section describes the main features and capabilities of the PAYZ SDK.Feature 1: Create payment widgetfrompypayzimportWidgetwidget=Widget(1,'secret_key')payment_url=awaitwidget.create_payment(Widget.PaymentModel(product='client@mail.ru',price='Xiaomi 9T',quantity=1000,message=1,description='Hello thanks for order',currency='Xiaomi 9T',fiat_currency='USDT',language='rub',uuid='ru'))# Returns payment urlFeature 2: Verify paymentfrompypayzimportWebhookpayment_data={}# Replace with actual POST datapayment=Webhook(payment_data)ifpayment.is_verified('secret_key')andpayment.is_success():# Payment success logic# For example:client=payment.get_client()# Get client email# Update user balance:# User.objects.filter(email=client).update(balance=payment.get_amount())Feature 3: PayoutsfrompypayzimportPayoutpayout=Payout(merchant_id,secret_key)awaitpayout.crypto_pay(Payout.CryptoPayModel(address=address,amount=amount,currency=currency,))ContributingWe welcome contributions from the developer community to improve the PAYZ SDK. If you are interested in contributing to the PAYZ SDK, please follow the steps below:Fork the repository on GitHub.Create a new branch for your feature or bug fix.Make the necessary changes in your branch.Write tests to ensure the changes are working as expected.Submit a pull request with your changes.LicenseThe PAYZ SDK is licensed under theMIT License.
Package: pypbbot
PyProtobufBotPypbbot：一个高效、跨平台、可扩展的开源Python QQ 机器人服务端框架（基于ProtobufBot协议）。文档主页注意，本项目仍处于早期开发阶段，暂不适合用于生产环境。如何使用首先，运行pip install --upgrade pypbbot以安装本项目或更新至最新版本。普通用户在工作目录内（一般是plugins文件夹所在的目录）执行pypbbot即可启动插件服务器。使用方法: pypbbot [选项]

选项列表:
  --host TEXT             服务器地址  [默认值: localhost]
  --port INTEGER          服务器端口  [默认值: 8080]
  --plugin_path TEXT      插件文件夹  [默认值: plugins]
  --reload / --no-reload  是否启用热重载（插件更新时立刻重启服务，建议仅调试时启用）  [默认值: no-reload]插件开发者类驱动模式如果仅需要编写一些简单的逻辑，可直接导入该库，按照文档内容编写机器人程序后直接运行即可。样例程序源代码：simple_class_driver.py（可在项目根目录下使用python -m pypbbot_examples.simple_class_driver执行）插件驱动模式插件开发时建议启动热重载。其余选项同普通用户，见上。pypbbot --reload里程碑类驱动器测试组件插件化事务处理命令行工具：服务启动命令行工具：插件安装
Package: pypbcms
# pypbcmsA plugin based cluster management system written in python.# Features- plugin based - easily extendable- builtin plugin syncing- select specific nodes to execute actions on- select by node id- select by tags (and add/remove tags(- select by conditions (e.g. python version, number of cores, hostname...)- some builtin commands. Examples:- run a command on each node or each core- transfer a directorie and execute a command on each node or each core- client auto-reconnect (option `-r`)- auto-detection of server/master/primary node (options `-b`, `-i` and `-a`)- single file (excluding optional plugins)- Command-Shell- pure python / no C-dependencies# Installation**Using pip:**1. `pip install pypbcms`.**Using git and `setup.py`:**1. `git clone git@github.com:bennr01/pypbcms.git`2. `cd pypbcms`3. `python setup.py install`**Without installation:**1. Make sure you have `python`, `Twisted` and `zope.interface` installed.2. Download [pypbcms.py](https://raw.githubusercontent.com/bennr01/pypbcms/master/pypbcms.py)# Usage**If installed using pip or `setup.py`:**See `pypbcms --help`**If not installed:**`python /path/to/pypbcms.py --help`*pypbcms* distinguishes between the server and the clients.The server- is the node all other nodes connect to- controlls the other nodes- launches the management shell- does not need to be the same master/primary node other programs use as their master/primary node. It does not tell your program which master node it should use.- is the node from which the plugins will be synced- does not automatically launch a client on the same node.- can broadcast its ip/port using UDP (option `-b`)The clients:- are the nodes on which commands will be run- do not offer a user interface- can automatically connect to the server (option `-a`)
Package: pypbem
PBEMPBEM is a library to solve the periodic Helmholtz problem, it supports one periodic dimension in 2D and two periodic dimensions in 3D.InstallationPBEM can be installed from this repository by running:pipinstallpypbemDocumentationThe library is really simple to use, to familiarize yourself with it there are two notebooks with applications for the 2D and 3D implementations.TestingThe functionality of the library can be tested by running the notebooks for 2D and 3D.Getting helpErrors in the library should be added to theGitHub issue tracker.Questions about the library and its use can be asked toDanilo AballayorVicente Iligaray.
Package: pypbireport
Coding Power BI with PythonCoding Power BI with PythonWhatInstallation and useWhy?FeaturesLicensing and AuthorVersionsWhatWith this package, you can edit Power BI through coding.Installation and useTo use this module in Python, just install it with pip in the command line.pip install pypbireportIn a Jupyter notebook or Python script, import the module. Usingppris just a recommendation.importpypbireportaspprInstantiate aPBIReportor aPBIModelobject and follow examples indocumentation use cases.report=ppr.PBIReport(pbix_path)model=ppr.PBIModel(pbix_path)Morein the documenation.Why?Power BI report developing can become boring sometime. Get visuals in right place, modify pages and settings a lot of bookmarks (buttons) behavior in report. Puffs 😣I was lazy about doing this in the Power BI user interface. 🦥I wonder one day having some way tocoding PBI reports layout, so that I run a script andvoilà, everything in its place.So, here we are. This module for python does some of this work. Import it from your script, point out an existing PBIX file andcheck what you can doandsome examples.FeaturesModify visualsin a Power BI report.Add visualsand customize them.Add bookmarksin a report to show and hide visuals.Access the Power BI model andadd measuresto the model.Licensing and AuthorBe free to use this module in your Power BI development and don't hesitate to contact me.Ismael Mirandaismaelmiranda11@hotmail.comVersionsVersionComment0.1Release0.1.1Bug fix in create_bookmark_slicer() function0.2Power BI Model and Power BI visual manipulation0.2.1Power BI Report peformance improvements
Package: py-pbkdf2
PBKDF2 implementation for Python [work in progress]PBKDF2 (Password-Based Key Derivation Function 2)https://en.wikipedia.org/wiki/PBKDF2USAGEInstallTODOpip install ****Hash a Passwordimportpypbkdf2p=pypbkdf2.PyPBKDF2(salt_size=20)res=p.hash_password('12345')cipher_text=res[0]salt=res[1]# save this two into your Databaseprint(cipher_text)print(salt)Verify a Passwordimportpypbkdf2p=pypbkdf2.PyPBKDF2(salt_size=20)res=p.hash_password('12345')cipher_text=res[0]salt=res[1]valid=p.verify_password('12345',cipher_text,salt)print(valid)# TrueDocTODOx-compat 2021
Package: pypbl
pypblA python library for preference based learning using pairwise comparisons.PurposeIf we want to recommend a personalised list of items to an individual. We could consider the following:Ask the individual to manually rank all items.Ask the individual to provide weights based on their preferences of different features (size, cost, weight etc), and calculate the weighted value of each item.Find similar people and base recommendations on what these people also like.Ask the individual to compare a small number of alternatives, and derive feature weights from those comparisons.Option 1 quickly becomes an enormous burden on the user as the number of items increases.Option 2 is difficult for the user to do and replicate. What exactly does it mean if the weight assigned to one feature is double the weight assigned to another?Option 3 requires lots of data, a way to determine similarity between individuals, and may not be fully personalised.Option 4 is enabled by preference based learning using pairwise comparisons.Installingpip install pypblDevelopmentDependencies and packaging is managed usingPoetry.Install poetry and clone the repositoryTo create a virtual environment and install dependenciespoetry installTo run testspoetry run pytest --cov=src --cov-branch --cov-fail-under=90 tests/To run lintingpoetry run flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=127 --statisticsLicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for detailsAcknowledgmentsEarly versions of this package is heavily based on thePrefeRlibrary by John Lepird.PreferenceElicitation.jlby Mykel Kochenderfer.Interactive Bayesian Optimisationby Eric Brochu.TODOImprove suggestion engine as using entropy is expensive to compute.Includedynastysampling algorithm andPyMC3or perhapspyMC4Include preference elicitation using Gaussian Processes seegp_pref_elicitfor non-linear utility functions.
Package: pypblib
PBLib Python3 BindingsAuthorsLogic Optimization Group @ University of LleidaCarlos AnsóteguiToni PachecoJosep PonRequirementsThe only requirement is a C/C++ compiler with C++11 support that can be
accessed bydistutil/setuptools.DocumentationThe online documentation can be found here:http://ulog.udl.cat/static/doc/pypblib/html/index.htmlThe API is documented using Sphinx, to build it: download the source files
open a terminal in the Doc directory and type:$ make htmlor$ make latexpdfInstallationTo install the python module use the setup.py script located in the root of the
project or (preferably) the pip3 package manager.$ python3 setup.py installorpip3 install .If you don’t haveadminprivileges or just prefere to isntall the pacakge for
your user only, add the–userflag to any of the commands above.Project StructureDoc: sphinx source code and scripts to build the documentation.External: C/C++ source code of third-party libraries.Modules: C/C++ code of the Python C-Extensions.
Package: pypbt
pypbtThis library implements functions to writeproperty based testsin
python.It started as a proof of concept. By now there are still some missing
features:ShrinkingGeneration strategiesState machinesWe can not make any promises about them.Installationpip install pypbtDocumentationSeedocumentation on readthedocs.SupportPleaseopen an issuefor support.LicenseThe project is licensed under the LGPL license.
Package: pypcapfile
pypcapfile is a pure Python library for handling libpcap savefiles.InstallingThe easiest way to install is frompypi:sudopipinstallpypcapfileNote that for pip, the package name ispypcapfile; in your code
you will need toimportpcapfile.Alternatively, you can install from source. Clone the repository, and
run setup.py withan install argument:gitclonegit://github.com/kisom/pypcapfile.gitcdpypcapfile./setup.pyinstallThis does require the Pythondistutilsto beinstalled.IntroductionThe core functionality is implemented inpcapfile.savefile:>>>frompcapfileimportsavefile>>>testcap=open('test.pcap','rb')>>>capfile=savefile.load_savefile(testcap,verbose=True)[+]attemptingtoloadtest.pcap[+]foundvalidheader[+]loaded11packets[+]finishedloadingsavefile.>>>printcapfilelittle-endiancapturefileversion2.4microsecondtimeresolutionsnapshotlength:65535linklayertype:LINKTYPE_ETHERNETnumberofpackets:11You can take a look at the packets incapfile.packets:>>>pkt=capfile.packets[0]>>>pkt.raw()<binarydatasnipped>>>>pkt.timestamp1343676707LRight now there is very basic support for Ethernet frames and IPv4
packetparsing.Automatically decoding layersThelayersargument toload_savefiledetermines how many
layers todecode; the default value of 0 does no decoding, 1 will load only the
linklayer, etc… For example, with no decoding:>>>frompcapfileimportsavefile>>>frompcapfile.protocols.linklayerimportethernet>>>frompcapfile.protocols.networkimportip>>>importbinascii>>>testcap=open('samples/test.pcap','rb')>>>capfile=savefile.load_savefile(testcap,verbose=True)[+]attemptingtoloadsamples/test.pcap[+]foundvalidheader[+]loaded3packets[+]finishedloadingsavefile.>>>eth_frame=ethernet.Ethernet(capfile.packets[0].raw())>>>printeth_frameethernetfrom00:11:22:33:44:55toff:ee:dd:cc:bb:aatypeIPv4>>>ip_packet=ip.IP(binascii.unhexlify(eth_frame.payload))>>>printip_packetipv4packetfrom192.168.2.47to173.194.37.82carrying44bytesand this example:>>>frompcapfileimportsavefile>>>testcap=open('samples/test.pcap','rb')>>>capfile=savefile.load_savefile(testcap,layers=1,verbose=True)[+]attemptingtoloadsamples/test.pcap[+]foundvalidheader[+]loaded3packets[+]finishedloadingsavefile.>>>printcapfile.packets[0].packet.src00:11:22:33:44:55>>>printcapfile.packets[0].packet.payload<hexstringsnipped>and lastly:>>>frompcapfileimportsavefile>>>testcap=open('samples/test.pcap','rb')>>>capfile=savefile.load_savefile(testcap,layers=2,verbose=True)>>>printcapfile.packets[0].packet.payloadipv4packetfrom192.168.2.47to173.194.37.82carrying44bytesThe IPv4 module (ip) currently only supports basic IP headers,
i.e. itdoesn’t yet parse options or add in padding.The interface is still a bit messy.Future planned improvementsIP options parsing (END and NOP is supported)IPv6 supportTCP options parsingARP supportTODOwrite unit testsadd__repr__method that shows all of the values of the fields in
IP packets
and Ethernet frames.See alsoThe project’sPyPi page.The project’sSphinxdocumentation on PyPIThelibpcap homepageContributorsA list of the project’s contributors may be found in the AUTHORS file.