Saravanan666/pypi-org huggingface dataset:
Package: requests-awsv2-auth
AWS v2 signing support for Python-Requests.Installation:pip install requests-awsv2-authUsage:importrequestsfromawsv2_authimportAwsV2Authauth=AwsV2Auth('my-key','my-secret')response=requests.get('https://sos.exo.io/my-bucket',auth=auth)This can be used to generate pre-signed URLs as well:auth=AwsV2Auth('my-key','my-secret')url=auth.pre_sign('https://sos.exo.io/my-bucket/path/to/file.txt',method='GET',expires=int(time.time())+3600,headers=None)
Package: requests-bce
Versionv0.0.4BCE authentication for the awesome requests!support auth version: v1[x] BCMHow to InstallJustpipinstallrequests-bceHow to UseJust pass the auth object to requests>>>importrequests>>>frombceauthimportAuthV1>>>req=requests.post(..."http://example.com/path/to/file",...auth=AuthV1("access-key","secret-key")...)<Response[200]>Or set the auth attribute to the session object>>>importrequests>>>frombceauthimportAuthV1>>>session=requests.session()>>>session.auth=AuthV1("access-key","secret-key")>>>req=session.get("http://example.com/path/to/file")<Response[200]>
Package: requests-cache-latest
requests-cacheRequests-cache is a transparent persistent cache forrequests(version >= 1.1.0) library.Usage exampleJust write:importrequestsimportrequests_cacherequests_cache.install_cache('demo_cache')And all responses with headers and cookies will be transparently cached todemo_cache.sqlitedatabase. For example, following code will take only
1-2 seconds instead of 10, and will run instantly on next launch:foriinrange(10):requests.get('http://httpbin.org/delay/1')It can be useful when you are creating some simple data scraper with constantly
changing parsing logic or data format, and don’t want to redownload pages or
write complex error handling and persistence.Noterequests-cacheignores all cache headers, it just caches the data for the
time you specify.If you need library which knows how to use HTTP headers and status codes,
take a look athttpcacheandCacheControl.LinksDocumentationatreadthedocs.orgSource code and issue trackingatGitHub.Working exampleatReal Python.History0.4.12 (2016-02-12)Increment version to satisfy PyPi0.4.11 (2016-02-12)Ability to force removal of expired entries0.4.10 (2015-04-28)Better transactional handling in sqlite #50, thanks to @rgantCompatibility with streaming in requests >= 2.6.x0.4.9 (2015-01-17)expire_afternow also acceptstimedelta, thanks to @femtotraderAdded Ability to include headers to cache key (include_get_headersoption)Added string representation forCachedSession0.4.8 (2014-12-13)Fix bug in reading cached streaming response0.4.7 (2014-12-06)Fix compatibility with Requests > 2.4.1 (json arg, response history)0.4.6 (2014-10-13)Monkey patch now uses class instead lambda (compatibility with rauth)Normalize (sort) parameters passed as builtin dict0.4.5 (2014-08-22)Requests==2.3.0 compatibility, thanks to @gwillem0.4.4 (2013-10-31)Check for backend availability in install_cache(), not at the first requestDefault storage fallbacks to memory ifsqliteis not available0.4.3 (2013-09-12)Fixresponse.from_cachenot set in hooks0.4.2 (2013-08-25)FixUnpickleableErrorfor gzip responses0.4.1 (2013-08-19)requests_cache.enabled()context managerCompatibility with Requests 1.2.3 cookies handling0.4.0 (2013-04-25)Redis backend. Thanks to @michaelbeaumontFix for changes in Requests 1.2.0 hooks dispatching0.3.0 (2013-02-24)Support forRequests1.x.xCachedSessionMany backward incompatible changes0.2.1 (2013-01-13)Fix broken PyPi package0.2.0 (2013-01-12)Last backward compatible version forRequests0.14.20.1.3 (2012-05-04)Thread safety for defaultsqlitebackendTake into account the POST parameters when cache is configured
with ‘POST’ inallowable_methods0.1.2 (2012-05-02)Reduce number ofsqlitedatabase write operationsfast_saveoption forsqlitebackend0.1.1 (2012-04-11)Fix: restore responses from response.historyInternal refactoring (MemoryCache->BaseCache,reduce_responseandrestore_responsemoved toBaseCache)connectionoption forMongoCache0.1.0 (2012-04-10)initial PyPI release
Package: requests-ccwienk
Requests: HTTP for Humans™If you're interested in financially supporting Kenneth Reitz open source, considervisiting this link. Your support helps tremendously with sustainability of motivation, as Open Source is no longer part of my day job.Requests is the onlyNon-GMOHTTP library for Python, safe for human
consumption.Behold, the power of Requests:>>> r = requests.get('https://api.github.com/user', auth=('user', 'pass'))
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=utf8'
>>> r.encoding
'utf-8'
>>> r.text
u'{"type":"User"...'
>>> r.json()
{u'disk_usage': 368627, u'private_gists': 484, ...}Seethe similar code, sans Requests.Requests allows you to sendorganic, grass-fedHTTP/1.1 requests,
without the need for manual labor. There's no need to manually add query
strings to your URLs, or to form-encode your POST data. Keep-alive and
HTTP connection pooling are 100% automatic, thanks tourllib3.Besides, all the cool kids are doing it. Requests is one of the most
downloaded Python packages of all time, pulling in over 11,000,000
downloads every month. You don't want to be left out!Feature SupportRequests is ready for today's web.International Domains and URLsKeep-Alive & Connection PoolingSessions with Cookie PersistenceBrowser-style SSL VerificationBasic/Digest AuthenticationElegant Key/Value CookiesAutomatic DecompressionAutomatic Content DecodingUnicode Response BodiesMultipart File UploadsHTTP(S) Proxy SupportConnection TimeoutsStreaming Downloads.netrcSupportChunked RequestsRequests officially supports Python 2.7 & 3.4–3.7, and runs great on
PyPy.InstallationTo install Requests, simply usepipenv(or pip, of
course):$ pipenv install requests
✨🍰✨Satisfaction guaranteed.DocumentationFantastic documentation is available athttp://docs.python-requests.org/, for a limited time only.How to ContributeCheck for open issues or open a fresh issue to start a discussion
around a feature idea or a bug. There is aContributor
Friendlytag for issues that should be ideal for people who are not very
familiar with the codebase yet.Forkthe repositoryon
GitHub to start making your changes to themasterbranch (or
branch off of it).Write a test which shows that the bug was fixed or that the feature
works as expected.Send a pull request and bug the maintainer until it gets merged and
published. :) Make sure to add yourself toAUTHORS.
Package: requests-chef
Chef authsupport forPython-Requestsimportrequestsimportrequests_chefauth=requests_chef.ChefAuth('chef-user','~/chef-user.pem')response=requests.get('https://api.chef.io/users/chef-user',headers={'X-Chef-Version':'12.0.2'},auth=auth)response.json()...{'display_name':'chef-user','email':'chef-user@example.com','first_name':'Chef','last_name':'User','middle_name':'','public_key':'-----BEGIN PUBLIC KEY-----\nMIIBIj...IDAQAB\n-----END PUBLIC KEY-----\n','username':'chef-user'}Seesamstav/okcheffirst, since
thats generally more useful.okchefusesrequests-chefto sign
and authenticate requests.InstallThis project currently requiresa
forkofpyca/cryptographydue to
the following related issues:#1648: decouple hashing process from signature generation /
verification#1579: Support asymmetric signing with pre-computed
digestInstructionsFirst, install this fork of cryptography directly from github.$ pip install git+https://github.com/samstav/cryptography.git@rsa-bypass-hash-on-signerIf you don’t do this first, you’d have to use the (deprecated, scheduled
for removal)--process-dependency-linksoption through pip, since
pip no longer respectsdependency
linksby default (as of pip 1.5).$ pip install --process-dependency-links requests-chef
Package: requests-cloud-auth
Requests-Cloud-Auth is a collection of Authentication extensions for
the Requests library. The primary purpose of this collection is to
provide an easy interface to authenticate to cloud providers with
minimal dependencies.SupportedKeystone v2Rackspace IdentityKeystone v3HP Cloud -FutureDigital Ocean -FutureAWS -FutureProject LinksDocumentation:ReadTheDocsGitHub:jmvrbanac/requests-cloud-auth
Package: requestscore
Experimental lower-level async HTTP client for Requests 3.0Goals: take urllib3 codebase, add async support (with multiple backends),
default to trio execution of async functions for blocking calls.UsageAsync usage:import requests_core

url = "http://httpbin.org/uuid"

async def main():
    r = await requests_core.request('GET', url)
    print(r.headers)
    print(await r.read())>>> import trio
>>> trio.run(main)
    HTTPHeaderDict({'connection': 'keep-alive', 'server': 'meinheld/0.6.1', 'date': 'Fri, 16 Mar 2018 11:59:57 GMT', 'content-type': 'application/json', 'access-control-allow-origin': '*', 'access-control-allow-credentials': 'true', 'x-powered-by': 'Flask', 'x-processed-time': '0', 'content-length': '53', 'via': '1.1 vegur'})
    b'{\n  "uuid": "693947c9-9f49-4b4a-be94-73a152ce1acb"\n}\n'Sync usage:>>> r = requests_core.blocking_request('GET', URL)
>>> print()
<requests_core.http_manager._async.response.HTTPResponse object at 0x103f63c88>InstallationThis is a work in progress. Don’t install it.
Package: requests-core
Experimental lower-level async HTTP client for Requests 3.0Goals: take urllib3 codebase, add async support (with multiple backends),
default to trio execution of async functions for blocking calls.UsageAsync usage:import requests_core

url = "http://httpbin.org/uuid"

async def main():
    r = await requests_core.request('GET', url)
    print(r.headers)
    print(await r.read())>>> import trio
>>> trio.run(main)
    HTTPHeaderDict({'connection': 'keep-alive', 'server': 'meinheld/0.6.1', 'date': 'Fri, 16 Mar 2018 11:59:57 GMT', 'content-type': 'application/json', 'access-control-allow-origin': '*', 'access-control-allow-credentials': 'true', 'x-powered-by': 'Flask', 'x-processed-time': '0', 'content-length': '53', 'via': '1.1 vegur'})
    b'{\n  "uuid": "693947c9-9f49-4b4a-be94-73a152ce1acb"\n}\n'Sync usage:>>> r = requests_core.blocking_request('GET', URL)
>>> print()
<requests_core.http_manager._async.response.HTTPResponse object at 0x103f63c88>InstallationThis is a work in progress. Don’t install it.
Package: requests-counter
requests-counterA tool to monitor the number of HTTP requests.It uses a key as extra parameter in the HTTP header, and optionally can filter the HTTP request persource(like origin).Use casesScenario: A Company that sell a Service that is limited by a max amount of requests and/or filtered by source HTTP request parameter.As a Company, I want to set a request limit for an _apiKey_and/or by source.As a Company, I want to update/destroy/inspect the status of subscription via api.InstallationRequirementInstallredisor run a docker container as below$>dockerrun--nametest-redis-p6379:6379-tiredisredis-server--appendonlyyesPackage Installation$>pipinstallrequests-counterUsageAs request counter for fastapifromfastapiimportDepends,FastAPI,HTTPException,Header# 1. Import the libraryfromrequests_counter.reqcounterimportReqCounterimportasyncioapp=FastAPI()# 2. Create an ReqCounter object with the url to redis instance as parametercl=ReqCounter("redis://localhost")# 3. populate the Object with a list of tuple (key, max_value)asyncio.create_task(cl.setup_api_key([("my-api-key-test",100)]))asyncio.create_task(cl.setup_source(["source1","source2"]))# 4. Declare a function to be injected into Depends module.# It will decrease the max_value for each request. It will raise a 429 HTTPException when max_value is 0.# It will raise a 403 HTTPException when source is not in the list.asyncdefcheck_key(apiKey:str=Header(None),source:str=Header(None)):res=awaitcl.decrease(apiKey)ifresisFalse:raiseHTTPException(400,"User Requests Limit Exceeded")ifawaitcl.check_source(source)isFalse:raiseHTTPException(403,"Forbidden")returnapiKey# 5. Inject the check_key function to endpoint@app.get("/consume")asyncdefconsume_key(apiKey=Depends(check_key)):return{"job":"done","apiKey":apiKey}To run this example$>uvicornrequests_counter.example:app--reload--port8080As endpointCommand below run the server to interact with your redis instance forDestroy a keyUpdate the value (i.e. renewal)Get the status of all keys$>uvicornrequests_counter.api:app--reload--port8080Runhttp://locahost:8080/docsfor documentation.
Package: requests-cpp
fast_requests介绍这可能是最快的http请求库，暂支持get方法要求windows平台和python3.7.2使用下载fast_requetst_cpp.pyd、fast_requests.py、libcurl.dll、zlibd1.dll四个文件，在项目中导入fast_requests.pyapi#timeOut 单位为毫秒get(urls,headers={},nThread=5,isDebug=False,timeOut=3000,verifySsl=True)sessionGet(urls,headers={},nThread=5,isDebug=False,timeOut=3000,verifySsl=True)#sessionGet和get的区别：sessionGet为每个线程持有一个session对象相当于requests的session，建议使用sessionGet速度更快urls请求的网址列表headers请求头nThread线程数（看自己设备配置，一般设20就差不多了）isDebug开启后会打印每个线程每个请求信息timeOut超时verifySslssl验证返回Response对象列表Response对象Response.text正文text文本Response.status_code状态码Response.headerResponse.content()二进制数据Response.UrlurlResponse.elapsedResponse.cookiesResponse.error暂且用不了示例代码：importfast_requestsurls=[]headers={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36"}foriinrange(1,200):urls.append("https://baidu.com")foriinfast_requests.get(urls,headers,20):print(i.text)foriinfast_requests.sessionGet(urls,headers,20):print(i.text)原理c++ : cprpython : pybind11
Package: requests-crawler
requests-crawlerA web crawler based onrequests-html, mainly targets for url validation test.Featuresbased onrequests-html,full JavaScript support!support requests frequency limitation, e.g. rps/rpmsupport crawl with headers and cookiesinclude & exclude mechanismgroup visited urls by HTTP status codedisplay url's referers and hyper linksInstallation/Upgrade$pipinstallrequests-crawlerOnlyPython 3.6is supported.To ensure the installation or upgrade is successful, you can execute commandrequests_crawler -Vto see if you can get the correct version number.$requests_crawler-V0.5.3Usage$ requests_crawler -h
usage: requests_crawler [-h] [-V] [--log-level LOG_LEVEL]
                        [--seed SEED]
                        [--headers [HEADERS [HEADERS ...]]]
                        [--cookies [COOKIES [COOKIES ...]]]
                        [--requests-limit REQUESTS_LIMIT]
                        [--interval-limit INTERVAL_LIMIT]
                        [--include [INCLUDE [INCLUDE ...]]]
                        [--exclude [EXCLUDE [EXCLUDE ...]]]
                        [--workers WORKERS]

A web crawler based on requests-html, mainly targets for url validation test.

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show version
  --log-level LOG_LEVEL
                        Specify logging level, default is INFO.
  --seed SEED           Specify crawl seed url
  --headers [HEADERS [HEADERS ...]]
                        Specify headers, e.g. 'User-Agent:iOS/10.3'
  --cookies [COOKIES [COOKIES ...]]
                        Specify cookies, e.g. 'lang=en country:us'
  --requests-limit REQUESTS_LIMIT
                        Specify requests limit for crawler, default rps.
  --interval-limit INTERVAL_LIMIT
                        Specify limit interval, default 1 second.
  --include [INCLUDE [INCLUDE ...]]
                        Urls include the snippets will be crawled recursively.
  --exclude [EXCLUDE [EXCLUDE ...]]
                        Urls include the snippets will be skipped.
  --workers WORKERS     Specify concurrent workers number.ExamplesBasic usage.$requests_crawler--seedhttp://debugtalk.comCrawl with headers and cookies.$ requests_crawler --seed http://debugtalk.com --headers User-Agent:iOS/10.3 --cookies lang:en country:usCrawl with 30 rps limitation.$ requests_crawler --seed http://debugtalk.com --requests-limit 30Crawl with 500 rpm limitation.$ requests_crawler --seed http://debugtalk.com --requests-limit 500 --interval-limit 60Crawl with extra hosts, e.g.httprunner.orgwill also be crawled recursively.$ requests_crawler --seed http://debugtalk.com --include httprunner.orgSkip excluded url snippets, e.g. urls includehttprunnerwill be skipped.$ requests_crawler --seed http://debugtalk.com --exclude httprunner
Package: requests-crtauth
requests-crtauthA plugin to support [crtauth authentication](https://github.com/spotify/crtauth) in [Python Requests](http://www.python-requests.org/).Usagerequests-crtauth works as an authentication plugin for Python Requests. See the [authentication documentation](http://www.python-requests.org/en/latest/user/authentication/) for more details. The following arguments may be provided to a new instance ofHttpCrtAuth:` username: User to authenticate as. Defaults to $USER. private_key: A PEM encoded private key string. Overrides signer. signer: A crtauth SigningPlug instance. Defaults to using the SSH agent (AgentSigner). version: Integer version of the crtauth protocol. Defaults to version 1. `Here’s an example.`python In [1]: import requests, requests_crtauth, json, logging In [2]: logging.basicConfig(level=logging.DEBUG) In [3]: session = requests.Session() # HttpCrtAuth() will default to authenticating with your $USER env variable and a key from your SSH agent. # To specify an explicit key:requests_crtauth.HttpCrtAuth(username='negz',private_key='keydata as a string') In [4]: session.auth = requests_crtauth.HttpCrtAuth() In [5]: data =json.dumps({'comment':'I\'macomment!'})In [6]: headers ={'content-type':'application/json;charset=utf-8'}In [7]: response =session.put('https://db.spotify.net/v1/things/yomaris',data=data, headers=headers) INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): db.spotify.netDEBUG:requests.packages.urllib3.connectionpool:"PUT/v1/things/yomaris HTTP/1.1" 401 12 DEBUG:root:Sending challenge requestDEBUG:requests.packages.urllib3.connectionpool:"HEAD/_auth HTTP/1.1" 200 0 DEBUG:root:Sending response to challenge REDACTEDDEBUG:requests.packages.urllib3.connectionpool:"HEAD/_auth HTTP/1.1" 200 0 DEBUG:root:Stored CHAP token REDACTED DEBUG:root:Using newly stored CHAP token.DEBUG:requests.packages.urllib3.connectionpool:"PUT/v1/things/yomaris HTTP/1.1" 200 None In [8]: response.ok Out[8]: True `
Package: requests-curl-antitls
requests which pass through tls安装pip install requests-curl-antitls执行以下脚本# 如果有多个虚拟环境，刚才哪个python安装的curl，就用哪个python执行这个importsysimportosbase=os.path.join(sys.prefix,"lib","libcurl-impersonate-chrome.so")withopen(base,"rb")asinp,open("/usr/lib/libcurl-impersonate-chrome.so.4","wb")asout:data=inp.read()out.write(data)
Package: requests-custom
Package to work with custom requests capabilities.Current capabilities available:Custom timeout for all requests.Raise exception with certain HTTP status code responses.Retry on failure.Installationpip install requests_customPypi link:https://pypi.org/project/requests-custom/How to usefrom requests_custom import requests_custom
requests = requests_custom.RequestsCustom(debug_full=True).get_requests()
requests.get('https://duckduckgo.com')Documentationhttps://requests-custom.readthedocs.io/en/latest/At the previous link you can see the references of this project.
Package: requests-default
requests-defaultInfoThis set defaultrequests <https://docs.python-requests.org/en/latest/>_'surl,headersetc...fromrequests_baseimportDefaultSessionsession=DefaultSession(base_url='https://example.com/resource/',headers={'api-key':'aabbcc'})r=session.get('sub-resource/',params={'foo':'bar'})print(r.request.url)LicenseDistributed under the terms of the MIT license, pytest is free and open source software.
Package: requestsdefaulter
Requests DefaulterSmall library to set default headers in requestsCurrently there's no easy way to set default headers in requests. This
patches the requests library to enable default headers to be set across
the board.Using this libraryYou can install this library from pypi.To do this usingpipenvrun:pipenv install requestsdefaulterYou can then set default headers in requests by runningimportrequestsdefaulterdefdefault_header_provider():return{"X-Your-Header":"Contents Of Header"}requestsdefaulter.default_headers(default_header_provider)And make your request as normalimportrequestsrequests.get("https://example.com")And your request will contain the headerDevelopingThese instructions will get you a copy of the project up and running.PrerequisitesThis project usespipenv.It expects Python 3.6InstallingTo install the dependencies of this library run$pipenvinstall--devmaster✱➜◼
InstallingdependenciesfromPipfile.lock(f97fb9)…🐍▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉11/11—00:00:01
Toactivatethisproject'svirtualenv,runthefollowing:$pipenvshellRunning the testsTo run all the tests simply runmaketestBehavioural TestsWe use behave to test the library to run the tests runpipenvrunbehaveSecurity CheckThis will check against PEP 508 and for security vulnerabilities in dependenciespipenvcheckCoding Style ChecksCompare the code to pep8pipenv run flake8LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: requests-doh
requests-dohDNS over HTTPS resolver for pythonrequestsusingdnspythonmoduleKey featuresResolve hosts usingpublic DNS serversor custom DNS servers over HTTPSDNS caching, making faster to resolve hostsEasy to useInstallationYou must have Python 3.8.x or up with Pip installed.PyPI (stable version)# For Linux / Mac OSpython3-mpipinstallrequests-doh# For Windowspy-3-mpipinstallrequests-dohGit (Development version)gitclonehttps://github.com/mansuf/requests-doh.gitcdrequests-doh
pythonsetup.pyinstallFor more information about installation, seeInstallationUsage# for conveniencefromrequests_dohimportDNSOverHTTPSSession# By default, DoH provider will set to `cloudflare`session=DNSOverHTTPSSession(provider='google')r=session.get('https://google.com')print(r.content)For more information about usage, seeAPI usageLinksPyPIDocsLicenseSeeLICENSE
Package: requests_download
A convenient function to download to a file using requests.Basic usage:url="https://github.com/takluyver/requests_download/archive/master.zip"download(url,"requests_download.zip")An optionalheaders=parameter is passed through to requests.Trackersare a lightweight way to monitor the data being downloaded.
Two trackers are included:ProgressTracker- displays a progress bar, using theprogressbar2package.HashTracker- wraps a hashlib object to calculate a hash (e.g. sha256 or
md5) of the file as you download it.Here’s an example of using both of them:importhashlib# progressbar is provided by progressbar2 on PYPI.fromprogressbarimportDataTransferBarfromrequests_downloadimportdownload,HashTracker,ProgressTrackerhasher=HashTracker(hashlib.sha256())progress=ProgressTracker(DataTransferBar())download('https://github.com/takluyver/requests_download/archive/master.zip','requests_download.zip',trackers=(hasher,progress))asserthasher.hashobj.hexdigest()=='...'To make your own tracker, subclass TrackerBase and define any of these methods:fromrequests_downloadimportTrackerBaseclassMyTracker(TrackerBase):defon_start(self,response):"""Called with requests.Response object, which has response headers"""passdefon_chunk(self,chunk):"""Called multiple times, with bytestrings of data received"""passdefon_finish(self):"""Called when the download has completed"""pass