Saravanan666/pypi-org huggingface dataset:
Package: python-redpocket
python-redpocketA simple, fully tested, Pythonic wrapper around RedPocket Mobile's API.Example UsagefromgetpassimportgetpassfromredpocketimportRedPocketusername=input("RedPocket Username: ")password=getpass("Password:")rp=RedPocket(username=username,password=password)lines=rp.get_lines()print(lines)# [#     RedPocketLine(#         account_id='12345',#         number=1234567890,#         plan='Annual- Unlimited Everything + 8GB high speeds',#         expiration=datetime.date(2022, 1, 2),#         family=False#     )# ]line_details=lines[0].get_details()print(line_details)# RedPocketLineDetails(#     number=1234567890,#     product_code='GSMA',#     status='Active',#     plan_id='355',#     plan_code='E240GSMA',#     expiration=datetime.date(2021, 5, 12),#     last_autorenew=datetime.date(2021, 12, 3),#     last_expiration=datetime.date(2022, 1, 2),#     main_balance=-1,#     voice_balance=-1,#     messaging_balance=-1,#     data_balance=7657,#     phone=RedPocketPhone(model='Apple iPhone 12 A2172', imei='', sim='', esn='')print(line_details.remaining_days_in_cycle)# 11print(line_details.remaining_months_purchased)# 8There is also a helper function to get all the lines and line details in one call:fromredpocketimportRedPocketrp=RedPocket(username="",password="")lines=rp.get_all_line_details()print(lines)# [#     (#         RedPocketLine(#             account_id='12345',#             number=1234567890,#             plan='Annual- Unlimited Everything + 8GB high speeds',#             expiration=datetime.date(2022, 1, 2),#             family=False),#         RedPocketLineDetails(#             number=1234567890,#             product_code='GSMA',#             status='Active',#             plan_id='355',#             plan_code='E240GSMA',#             expiration=datetime.date(2021, 5, 12),#             last_autorenew=datetime.date(2021, 12, 3),#             last_expiration=datetime.date(2022, 1, 2),#             main_balance=-1,#             voice_balance=-1,#             messaging_balance=-1,#             data_balance=7657,#             phone=RedPocketPhone(model='Apple iPhone 12 A2172', imei='', sim='', esn='')#         )#     )# ]If you know the hash or account number of the specific account you want to retrieve, you can do that as well:fromredpocketimportRedPocketrp=RedPocket(username="",password="")my_line_hash=rp.get_lines()[0].account_hashprint(my_line_hash)# 'MTIzNDU2'details=rp.get_line_details(account_hash=my_line_hash)print(details)# RedPocketLineDetails(#     ...# )
Package: python-redsys
Welcome to python-redsys!A simple, clean and less dependant client to handle payments through the
Redsys platform using one of the available methods:redirect connectionor (secure method).The purpose of this library is to provide a normalized interface between
Redsys and other Python applications.About RedirectClientAlthoughredirect connectiondepends on a webserver to resolve the
communication step, the RedirectClient provided in this library does not
assume any kind of procedure to resolve that step; it merely prepares
the necessary parameters to make a request and handles the corresponding
response parameters. That's what less dependant means.Example usingredirect connection0. Install python-redsysYou can add python-redsys to your project with pip:pip install python-redsysOr with poetry:poetry add python-redsys1. Instantiate the redirect clientfromdecimalimportDecimalasD,ROUND_HALF_UPfromredsys.constantsimportEUR,STANDARD_PAYMENTfromredsys.clientimportRedirectClientsecret_key="123456789abcdef"client=RedirectClient(secret_key)2. Set up the request parametersparameters={"merchant_code":"100000001","terminal":"1","transaction_type":STANDARD_PAYMENT,"currency":EUR,"order":"000000001","amount":D("10.56489").quantize(D(".01"),ROUND_HALF_UP),"merchant_data":"test merchant data","merchant_name":"Example Commerce","titular":"Example Ltd.","product_description":"Products of Example Commerce","merchant_url":"https://example.com/redsys/response",}3. Prepare the requestThis method returns a dict with the necessary post parameters that are
needed during the communication step.args=client.prepare_request(parameters)4. Communication stepRedirect theuser-agentto the corresponding Redsys' endpoint using
the post parameters given in the previous step.After the payment process is finished, Redsys will respond making a
request to themerchant_urldefined in step 2.5. Create and check the responseCreate the response object using the received parameters from Redsys.
The methodcreate_response()throws aValueErrorin case the
received signature is not equal to the calculated one using the
givenmerchant_parameters. This normally means that the responseis
not coming from Redsysor that ithas been compromised.signature="YqFenHc2HpB273l8c995...."merchant_parameters="AndvIh66VZdkC5TG3nYL5j4XfCnFFbo3VkOu9TAeTs58fxddgc..."response=client.create_response(signature,merchant_parameters)ifresponse.is_paid:# Do the corresponding actions after a successful paymentelse:# Do the corresponding actions after a failed paymentraiseException(response.code,response.message)Methods for checking the response:According to the Redsys documentation:response.is_paid: ReturnsTrueif the response code is
between 0 and 99 (both included).response.is_canceled: ReturnsTrueif the response code
is 400.response.is_refunded: ReturnsTrueif the response code
is 900.response.is_authorized: ReturnsTrueif the response ispaid,refundedorcanceled.Also, you can directly access the code or the message defined in Redsys
documentation usingresponse.codeorresponse.message.ContributionsPlease, feel free to send any contribution that maintains theless
dependantphilosophy.
Package: python-reformat
格式化正则内容输出===============$0、$1、$2 分别对应 match中的g0、g1、g2、g3multi是否为多重匹配，是则返回所有结果，否则返回首匹配>>> data = '12m34kjdg8946o'>>> pn = '(\d)([a-z])'>>> fm = '$1,$2'>>> result = extract(pn, data, fm)>>> result'2,m'>>> result = extract(pn, data, fm, multi= True)>>> result['2,m', '4,k', '6,o']
Package: python-regrex
^regrex$This tool is a string generator based on regex pattern inspired bypemistahl/grex.FeaturesGenerate strings based on regex patternCheck if generated url are valid or not by accessing them in parallelMatch strings with regex pattern (WIP)Getting Started>pipinstallpython-regrex

>regrexgen-p"\d{4}-([a-z]+){6}@([a-z]+)mail\.com"-c3-i0-sdesc--disable-progress-bar5864-znufkb@pmail.com3322-sgfkkn@zmail.com1751-wnnolm@umail.com>regrex-h

usage:src/cli.py[{gen,check,match}][-h][-pPATTERN][-cCOUNT][-lLIMIT][-tTIMEOUT][-iINTERVAL][-s{natural,asc,desc,random}][-d][-oOUTPUT_PATH]GenerateURLswithspecifiedregexpatternandchecktheirvalidity.

positionalarguments:{gen,check,match}Mode:gen,check,ormatch(default:gen)options:-h,--helpshowthishelpmessageandexit-oOUTPUT_PATH,--output_pathOUTPUT_PATHOutputpath-pPATTERN,--patternPATTERNRegularexpressionpatternforgeneratingrandomstrings-cCOUNT,--countCOUNTMaxnumberofurls(default:10)-lLIMIT,--limitLIMITMaxstringlengthrangelimit(default:1)[WIP:onlyworksinrandom]-tTIMEOUT,--timeoutTIMEOUTTimeoutforHTTPrequests(default:5seconds)-iINTERVAL,--intervalINTERVALIntervalbetweenrequests(default:1second)-s{natural,asc,desc,random}[{natural,asc,desc,random}...],--sort{natural,asc,desc,random}[{natural,asc,desc,random}...]Sort:generate,asc,ordesc(default:random)-d,--downloadEnabledownloadingcontentsforvalidURLs(default:False)--disable-progress-barDisabletheprogressbar.ContributionWe welcome new contributors and look forward to growing this project together. Whether you'd like to request new content, promote it on social media, improve documentation, provide creative materials, sponsor the project, or make tip donations, contributions in any form are highly appreciated.
Package: python-relic
Python bindings for relicpython-relic(pyrelicfor short) provides Python bindings forrelic. Note though, that the bindings are driven by my
personal needs and they do not cover the fullrelicAPI.Dependenciespyrelicrequires the following dependencies to successfully build and install:relic >= 0.5.0with pairing support enabled.Cython >= 0.28(optional, only for building). If Cython is not available, the C files are not
regenerated from their source.pkgconfig(optional, only for building). Ifpkgconfigis not available, the build system
assumes thatreliccan be linked as-lrelic.Quick installation guideIf you are running Ubuntu 20.04, the easiest way to installpyrelicis via myPPA:sudoadd-apt-repository-uppa:s-ramacher/ait
sudoaptinstallpython3-pyrelicIt comes with a pre-built version ofrelicconfigured for the pairing-friendly BLS12-381 curve.Otherwise,pyreliccan be installed viapip:pipinstallpython-relicor by running:python3setup.pyinstallNote though that these two approaches require a pairing-enabled build ofrelicto be available.Examplespyrelicincludes some examples that demonstrate the use of the module and also showcases some
pairing-based schemes:examples/bls.py: Implements theBoneh-Lynn-Shacham signature
scheme.examples/bfibe.py: Implements theBoneh-Franklin identity-based encryption
scheme(BasicIdent).examples/hpra.py: Implementshomomorphic proxy
re-authenticatorsfor linear functions.examples/bfe.py: ImplementsBloom Filter KEMbased on the BF IBE.examples/spseq.py: Implements astructure-preserving signature
scheme on equivalence classes.examples/chac: Implementscore/helper anonymous
credentials.LicenseThe code is licensed under the MIT license and was written by Sebastian Ramacher (AIT Austrian
Institute of Technology).AcknowledgementsThis work has been partially funded by the European Union’s Horizon 2020
research and innovation programme under grant agreement No 871473
(KRAKEN) and by ECSEL Joint Undertaking under grant
agreement No 826610 (Comp4Drones).
Package: python-reload
PyReloadLibrary for quick interaction with the code in the file.
PyReload - allows you to update the code in real timeConfigurationIn order not to keep track of all the files, they can be placed in the ignore file, according to the standard it is '._ingore'. To do this, you will need:1. Create a ignore file
2. Add ignored files
3. Run the script (if the file is called differently, then pass its name through the 'ignore_file' parameter)

ps: Creating a file is optional# Example ignore filepr=PyReload(ignore_file='custom_name_ignore_file.txt')Examplespyreload + aiogram# update code in framework aiogramimportosfrompyreloadimportPyReload...asyncdefpyreload_task():while1:awaitpr.update_file.hash().async_run()awaitasyncio.sleep(1)asyncdefon_startup(_):logging.info("Bot started")logging.info("Started waiting reload")asyncio.create_task(pyreload_task())if__name__=='__main__':pr=PyReload(path=os.listdir())executor.start_polling(dp,skip_updates=True,on_startup=on_startup)pyreload + vkbottle# update code in framework aiogramimportosfrompyreloadimportPyReload...@bot.loop_wrapper.interval(seconds=1)asyncdefpyreload_task():awaitpr.update_file.hash().async_run()if__name__=='__main__':pr=PyReload(path=os.listdir())bot.run_forever()
Package: python-repeatable-iterable
python-repeatable-iterableA new type RepeatableIterable for Python and a way to obtain one instanceSince in Python an Iterator is an Iterable and that you cannot iterate multiple times on an iterator,
you may encounter WTF bugs, even with type checking.
This package provides possible solutions to this problem.
See here for a discussion on this problem:https://stackoverflow.com/questions/63104689/what-is-the-pythonic-way-to-represent-an-iterable-that-can-be-iterated-over-multBefore:deffoo(iterable:Iterable):forthatiniterable:bar(that)forthatiniterable:# possible bugbaz(that)foo(something)After solution 1:frompython_repeatable_iterableimportRepeatableIterabledeffoo(iterable:RepeatableIterable[object]):forthatiniterable:bar(that)forthatiniterable:baz(that)something_else=RepeatableIterable(something)foo(something_else)After solution 2:frompython_repeatable_iterableimportRepeatableIterabledeffoo(iterable:Iterable):iterable=RepeatableIterable(iterable)forthatiniterable:bar(that)forthatiniterable:baz(that)foo(something)If you develop something where you have no control on what another dev might give you as input,
you have 2 possibilities:hope for the best ;),or harden your code to have less support work to do :).This applies if you dev something that is:closed source or open source,available to everyone on the Internet,
available only to customers or colleagues that you may personally know or not.Solution 2 above is a nice solution with a reasonable performance cost :).
Package: python-replicated
A Python interface to theReplicatedVendor API.The library currently only provides access to a very limited subset of
the Replicated Vendor API.The library is also currently untested.  This will be rectified soon.Example usageThere is not yet any real user documentation. Here is a brief example
of a limited subset of the library:from replicated.core import ReplicatedVendorAPI
api = ReplicatedVendorAPI('token')
apps = api.get_apps()
app = apps[0]
releases = list(app.releases)
print(releases[0].config)
releases[0].config = new_yaml_config
print(releases[0].edited_at)
Package: python-reporter
python-reporter：一个可以保存Python脚本任何中间结果的工具。在执行一个Python脚本时，如果需要的获取程序运行的一些中间结果，往往没有什么好的办法。例如，在xxx程序中以xxx计算中位数，
这个中位数只是一个中间变量。如果在其他地方需要这个中位数，一种常见的做法是把这个中位数打印出来。但是这种方法不适用于大量中间数据
的情况，python-reporter致力于解决这个问题。安装pip install python-reporter使用读取报告importreporterreport_id='xxx'report=reporter.Report(report_id)report.foo# 第一种方法report.get('foo')# 第二种方法report.pop('foo')# 第三种方法保存报告importreporterreport=reporter.Report()report<<('foo','bar')# 第一种方法report+('hello','world')# 第二种方法report.add('foobar','foobar')# 第三种方法report_id=report.save()第一种、第二种方法，传入的必须是长度为2的元组或列表，第一个元素是变量名称、第二个元素是变量的值。
由于变量需要保存，所以变量必须是可序列化的。保存方式reporter支持两种种保存方式：DatabaseBackend，即变量保存到数据库（默认）FileBackend，即变量以json形式保存到文件中DatabaseBackend注意：需要先初始化数据库。例如：backend=reporter.DatabaseBackend('sqlite:////path/to/reporter.db')backend.create_table()在程序内部指定数据库连接report = reporter.Report(
    backend=reporter.DatabaseBackend('sqlite:////path/to/reporter.db')
)通过环境变量指定数据库连接exportREPORTER_DB_URL='sqlite:////path/to/reporter.db'report=reporter.Report()使用默认数据库连接（即保存SQLite文件到当前目录）report=reporter.Report()FileBackend在程序内部指定保存地址report=reporter.Report(backend=reporter.FileBackend('/path/to/reporter'))那么报告以文件保存到/path/to/reporter/文件夹下，文件名为reporter-report-xxx.json。通过环境变量指定保存地址exportREPORTER_DIR=/path/to/reporterreport=reporter.Report(backend=reporter.FileBackend())那么报告以文件保存到/path/to/reporter/文件夹下，文件名为reporter-report-xxx.json。使用默认目录（即当前目录）report=reporter.Report(backend=reporter.FileBackend())那么报告以文件保存到当前目录下，文件名为reporter-report-xxx.json。如何自定义保存方式reporter默认支持FileBackend，如果需要以其他方式保存，可以自定义Backend，继承自reporter.Backend，且
实现load(report_id)、save(report_id, data)两个方法即可。classMyBackend(reporter.Backend):defload(self,report_id):passdefsave(self,report_id,data):passreport=reporter.Report(backend=MyBackend())
Package: python-repo-structure
python-repo-structureThis repository shows how to structure small Python project using CI (Codecov) and Poetry to upload to PyPi.BadgesFindother badgesyou want to see in your repository.Usagefrompackage_name.some_fileimportModernWarfareprint(ModernWarfare().call_of_duty())# "Press F to pay respects"Testing on replit.comInstallpip install python-repo-structuregit clone https://github.com/dimitryzub/python-repo-structure.gitUpload to PypiWhen runningpoetry publishyou will be prompted to add your PyPi username and password.
You won't the password while typing, it's intentional.1. $ poetry build --format wheel
2. $ poetry publishBuilding package:$ poetry build --format wheel
Building python-repo-structure (0.1.0)
  - Building wheel
  - Built python_repo_structure-0.1.0-py3-none-any.whlOnce start uploading process, you'll see something like this in the terminal:$ poetry publish

Username: dimitryzub
Password:
Publishing python-repo-structure (0.1.0) to PyPI
 - Uploading python_repo_structure-0.1.0-py3-none-any.whl 0%
 - Uploading python_repo_structure-0.1.0-py3-none-any.whl 100%
 - Uploading python_repo_structure-0.1.0-py3-none-any.whl 100%
Package: python-request-fanout
It allows multiple requests to be made asynchronously.This can be done.pip3installpython-request-fanout###Example:importrequestsfrompython_request_fanout.requesterimportHTTPMethod,Requesterrequest_array=[requests.Request(HTTPMethod.GET.name,url="https://www.google.com"),requests.Request(HTTPMethod.GET.name,url="https://www.udemy.com"),requests.Request(HTTPMethod.GET.name,url="https://www.youtube.com"),requests.Request(HTTPMethod.POST.name,url="https://www.github.com"),]response_array=Requester.do_requests(request_array)assertlen(response_array)==4Sample diagram
Package: python-requests-anonymous-session
Python Requests – Anonymous SessionRandomizes the user agent, and applies the default headers and cipher suite found in that browser.Installationpipinstallpython-requests-anonymous-sessionUsageNote:AnonymousSessioninherits fromrequests.Session.Simplefrompython_requests_anonymous_sessionimportAnonymousSessionsession=AnonymousSession()AdvancedChoose wether you want to use mobile/desktop broswer profilessession=AnonymousSession(browser={'desktop':False,# default True,'mobile':True,# default True,})Slightly More AdvancedChoose whichuser-agentyou want. If theuser-agentis in found in our database the correct default headers
and cipher suite will be applied.session=AnonymousSession(browser={'custom':'Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148',})CreditsVeNoMouS/cloudscraperfor thebrowsers.jsonfile and the originalUserAgentandCipherSuiteAdapterimplementations.
Package: python-requests-bitcoinrpc
This project further improvespython-bitcoinrpcby making use of therequestsmodule.requestsreplaces plainhttp.clientandhttplib, respectively.It's basically a mixture of the projectspython-bitcoinrpcandpython-monerorpc.The first version to contain the above change is tagv0.4.0.AuthServiceProxy is an improved version of python-jsonrpc.It includes the following generic improvements:HTTP connections persist for the life of the AuthServiceProxy objectsends protocol 'version', per JSON-RPC 1.1sends proper, incrementing 'id'uses standard Python json libcan optionally log all RPC calls and resultsJSON-2.0 batch supportIt also includes the following bitcoin-specific details:sends Basic HTTP authentication headersparses all JSON numbers that look like floats as Decimal,
and serializes Decimal values to JSON-RPC connections.Installation:change the first line of setup.py to point to the directory of your installation of python 2.*run setup.pyNote: This will only install bitcoinrpc. If you also want to install jsonrpc to preserve
backwards compatibility, you have to replace 'bitcoinrpc' with 'jsonrpc' in setup.py and run it again.Example usage:from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException

# rpc_user and rpc_password are set in the bitcoin.conf file
rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password))
best_block_hash = rpc_connection.getbestblockhash()
print(rpc_connection.getblock(best_block_hash))

# batch support : print timestamps of blocks 0 to 99 in 2 RPC round-trips:
commands = [ [ "getblockhash", height] for height in range(100) ]
block_hashes = rpc_connection.batch_(commands)
blocks = rpc_connection.batch_([ [ "getblock", h ] for h in block_hashes ])
block_times = [ block["time"] for block in blocks ]
print(block_times)Logging all RPC calls to stderr:from bitcoinrpc.authproxy import AuthServiceProxy, JSONRPCException
import logging

logging.basicConfig()
logging.getLogger("BitcoinRPC").setLevel(logging.DEBUG)

rpc_connection = AuthServiceProxy("http://%s:%s@127.0.0.1:8332"%(rpc_user, rpc_password))
print(rpc_connection.getinfo())Produces output on stderr like:DEBUG:BitcoinRPC:-1-> getinfo []
DEBUG:BitcoinRPC:<-1- {"connections": 8, ...etc }
Package: python-requirements
Package installerThis package helps you to install all modules you need in your directory.Installation$pipinstallpython-module-requirementsSample Usagefromrequirements.installimportModuleInstallerinstall=ModuleInstaller({})install.install_modules(path_to_folder="absolute path to folder")Instruction1. Create file "install.py" in needed directory2. Copy and paste code belowfromintaller.installimportModuleInstallerinstall=ModuleInstaller({})install.install_modules(path_to_folder="absolute path to folder")and press CTRL + S (Save file)3. Get needed path to folder.Click right mouse button and click "Copy path"4. Past path into line 4 in install.py (install.install_modules(path_to_folder="absolute path to folder")).4.1 Delete "\install.py" in path because it requires path to folder, not to fileNow save the file and run script! Script will install all requested frameworks.For ContributorsPrepare development environmentInstall docker on your development machineStart server for testing by following commands from the project's root folder or change path toconfdir in second command to correct:dockerpullbytemark/requirements
dockerrun-d--namerequirements-eAUTH_TYPE=Basic-eUSERNAME=alice-ePASSWORD=secret1234-vconf:/usr/local/apache2/conf-p8585:80bytemark/requirementsCode conventionPlease check your code according PEP8 Style guides.Run testsCheck that installer container is started on your local machineExecute following command in the project's root folder:python-munittestdiscover-stestsPrepare a Pull RequestPlease use this check list before creating PR:You code should be formatted according PEP8All tests should successfully passYour changes shouldn't change previous default behaviour, exclude defectsAll changes are covered by tests
Package: python-requisites
Python RequisitesPython Requisites is a dynamic tool for the explicit declaration and analysis of dependencies in Python objects, streamlining the process of identifying and managing required elements in your code.IntroductionPython Requisites (orpython-requisites) provides an intuitive way to analyze and declare the dependencies in Python objects like functions, classes, and modules. This tool is particularly useful for developers looking to gain better insight into their code's structure and dependencies.FeaturesExplicit Dependency Declaration: Clearly outlines the dependencies within Python objects.Streamlined Analysis: Simplifies the process of identifying required arguments and dependencies in functions, classes, and modules.Easy Integration: Designed to seamlessly integrate with existing Python projects.InstallationYou can install Python Requisites using pip:pipinstallpython-requisitesUsageThis library provides a utility to collect function parameters dynamically, either as positional or keyword arguments. Below are examples demonstrating how to use this functionality:Collecting Positional or Keyword Argumentsfromrequisitesimportcollect_paramsdefsample_function(argument):returnargument# Example 1: Collecting positional argumentsargs,kwargs=collect_params(sample_function,"hello")# args will be ("hello",)# kwargs will be {}assertsample_function(*args,**kwargs)=="hello"# Example 2: Collecting keyword argumentsargs,kwargs=collect_params(sample_function,argument="hello")# args will be ()# kwargs will be {"argument": "hello"}assertsample_function(*args,**kwargs)=="hello"# Example 3: Combining positional and keyword argumentsargs,kwargs=collect_params(sample_function,"hello",argument="world")# args will be ()# kwargs will be {"argument": "world"}assertsample_function(*args,**kwargs)=="world"Collecting Parameters with Variable Argumentsfromrequisitesimportcollect_paramsdefcomplex_function(a,b,*args,c,d=1,**kwargs):return"OK"# Example 1: Handling required parametersargs,kwargs=collect_params(complex_function,"hello","world",c="see")# args will be ("hello", "world")# kwargs will be {"c": "see", "d": 1}assertcomplex_function(*args,**kwargs)=="OK"# Example 2: Handling extra positional and keyword argumentsargs,kwargs=collect_params(complex_function,"hello","world","!",c="see",e="extra",f="fun")# args will be ("hello", "world", "!")# kwargs will be {"c": "see", "d": 1, "e": "extra", "f": "fun"}assertcomplex_function(*args,**kwargs)=="OK"