Saravanan666/pypi-org huggingface dataset:
Package: requestmodel
requestmodelFeaturesModel your http requests as a pydantic modelAnnotate your request parameters with fastapi paramsSupport voor sync & async requestsGoalsCreate a generator for an OpenAPI specSupport all kinds of http requestsInstallationYou can installrequestmodelviapipfromPyPI:$pipinstallrequestmodelUsagePlease see theimplementation detailfor further instructions.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,requestmodelis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz'sHypermodern Python Cookiecuttertemplate.
Package: requesto-py
requesto-pyLightweight python wrapper library for psycopg2 and sqlite3 databases without tons of useless code.current release: v1.1.0Ways of Installation (Linux/Windows)Before installation make sure to install all dependencies! No-dependencies branch*click*coming soon!Clone repogit clone https://github.com/SOLIDusr/requesto-py.gitpip install requesto-pyDocsYou can check docs*here*.SupportYou can create new issue if you have questions, or you found a bug*create*or just message me herereply.naromori@gmail.comusing requesto-py as an email topic.DependenciesThis library currently in testing stage and can be broken somewhere (Tested on python 3.10 and pip 23.3.1). If you found out that this works in versions below stated or doesn't work by any chance or reason - message meHere!Commit tagsTagDescribtionsecSecurity issuesdocsDocs update.updAdding new features. (Updates)fixFixing issues and bugs.perfPerfomance or time issue fixes.refactorChange of the code without adding any new features.revert/undo all the changes to the previous commitsstyleSome changes of code to improve readabilitytestAdding tests. (I promise i won't spam main branch with useless things)
Package: request-ray
Request Raya batch based request package with retry stratgy that enables you to send X requests concurrently at rate of Y requests/execution with max retries for each NSetuppipinstallrequest-rayHow to usefromrequest_rayimportrrayrequests=[{'method':'POST','url':'https://google.com','kwargs':{'data':json.dumps({'hello':'world'}),'headers':{'alpha':'beta'}}},{'method':'GET','url':'https://facebook.com','kwargs':{}}]batch_size=2# max no of requests to send at a timeretry_policy=3# how many times to retry failed requestsresponsesrray.send_requests(requests,batch_size,retry_policy)print(responses)# array of expected responses with structure in each element: {'index': 0, 'response': standard_response_object}How it worksAs shown below:6 requests are queuedfirst 3 are started1,3 get 200 ok and 2 get 500 so it's enqueued again2 is retried with next requests till it's statisfied or retry max reached
Package: requestRender
requestRenderA PyPI package that provides a simple headless Selenium web browser for scraping wrapper around reactive websites.How to install itpip install requestRenderYou also need the have Chrome installed to run this, because it uses Selenuim with Chrome as a headless Browser.How to use it?import requests
import requestRender

# Start a session
session = requests.Session()
# Start the browser
browser = requestRender.requestRender.RequestRender(session)
# Get the response from the website
response = session.get("https://www.midjourney.com")  
# Render the response to get the render the javascript content
html = browser.renderResponse(response)
# Save the html to a file
with open("index.html", "w", encoding="utf-8") as f:
    f.write(html)What needs to ImproveThe logging off the Browser needs be disabeld.A methode to determin if a website has loaded fully. At the moment the software just waits a 3 Seconds.
Package: requests
RequestsRequestsis a simple, yet elegant, HTTP library.>>>importrequests>>>r=requests.get('https://httpbin.org/basic-auth/user/pass',auth=('user','pass'))>>>r.status_code200>>>r.headers['content-type']'application/json; charset=utf8'>>>r.encoding'utf-8'>>>r.text'{"authenticated": true, ...'>>>r.json(){'authenticated':True,...}Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode yourPUT&POSTdata — but nowadays, just use thejsonmethod!Requests is one of the most downloaded Python packages today, pulling in around30M downloads / week— according to GitHub, Requests is currentlydepended uponby1,000,000+repositories. You may certainly put your trust in this code.Installing Requests and Supported VersionsRequests is available on PyPI:$python-mpipinstallrequestsRequests officially supports Python 3.7+.Supported Features & Best–PracticesRequests is ready for the demands of building robust and reliable HTTP–speaking applications, for the needs of today.Keep-Alive & Connection PoolingInternational Domains and URLsSessions with Cookie PersistenceBrowser-style TLS/SSL VerificationBasic & Digest AuthenticationFamiliardict–like CookiesAutomatic Content Decompression and DecodingMulti-part File UploadsSOCKS Proxy SupportConnection TimeoutsStreaming DownloadsAutomatic honoring of.netrcChunked HTTP RequestsAPI Reference and User Guide available onRead the DocsCloning the repositoryWhen cloning the Requests repository, you may need to add the-c fetch.fsck.badTimezone=ignoreflag to avoid an error about a bad commit (seethis issuefor more background):gitclone-cfetch.fsck.badTimezone=ignorehttps://github.com/psf/requests.gitYou can also apply this setting to your global Git config:gitconfig--globalfetch.fsck.badTimezoneignore
Package: requests2hdd
downloads files from a URL, creates the same folder structure on the HDD as the URL has, and saves the filepip install requests2hddTested against Windows 10 / Python 3.10 / AnacondaSimplified file downloading:This function simplifies the process of downloading a file from a URL and saving it to a local directory. You no longer need to write extensive code to handle these operations manually.Flexible status code handling:You can specify a collection of HTTP status codes that should be considered as successful downloads. By default, the function considers a status code of 200 as a successful download, but you can customize this based on your specific requirements. This allows you to define your own criteria for successful downloads.Preserves folder structure:The function automatically creates the same folder structure on the HDD as the URL has. It ensures that the downloaded file is saved in the appropriate folder according to its location in the URL. This feature helps maintain the organization and integrity of the downloaded files.Path correction on failure:If an exception occurs while saving the file, the function provides an option (correct_path_on_failure) to attempt to correct the file path. It utilizes the make_filepath_windows_comp function to replace illegal characters and resolve other path-related issues on Windows systems. This feature is especially useful when dealing with file paths that contain characters not supported by the operating system.Error handling:The function handles exceptions that occur during the file download and saving process. If correct_path_on_failure is set to False, the function raises the original exception, allowing you to handle errors according to your specific needs.Return value:Upon successful download and matching status code, the function returns the absolute path of the saved file. This provides you with the path information, which can be useful for further processing, verification, or referencing the downloaded file in your code.fromrequests2hddimportget_and_savelink=r'https://github.com/hansalemaos/screenshots/raw/main/neueswoerterbuch.txt'path='c:\\downloadtest'savepath=get_and_save(link,path,correct_path_on_failure=True)print(savepath)link='https://youtu.be/ZK9KzdqHVdE?t=12'# will substitute ? by _ on a Windows systempath='c:\\downloadtest'savepath=get_and_save(link,path,correct_path_on_failure=True)print(savepath)# outputc:\downloadtest\github.com\hansalemaos\screenshots\raw\main\neueswoerterbuch.txt[Errno22]Invalidargument:'c:\\downloadtest\\youtu.be\\ZK9KzdqHVdE?t=12'c:\downloadtest\youtu.be\ZK9KzdqHVdE_t=12
Package: requestsaa
Python 3.7.4 (default, Sep  7 2019, 18:27:02)>>>import requests>>> r = requests.get('https://api.github.com/repos/psf/requests')>>> r.json()["description"]'A simple, yet elegant HTTP library.'This software has been designed for you, with much joy,
byKenneth Reitz& is protected by ThePython Software Foundation.Requestsis an elegant and simple HTTP library for Python, built with ♥.>>>importrequests>>>r=requests.get('https://api.github.com/user',auth=('user','pass'))>>>r.status_code200>>>r.headers['content-type']'application/json; charset=utf8'>>>r.encoding'utf-8'>>>r.textu'{"type":"User"...'>>>r.json(){u'disk_usage': 368627, u'private_gists': 484, ...}Requests allows you to send HTTP/1.1 requests extremely easily. There’s no need to manually add query strings to your URLs, or to form-encode yourPUT&POSTdata — but nowadays, just use thejsonmethod!Requests isthe most downloaded Python package today, pulling in around14M downloads / week— according to GitHub, Requests is currentlydepended uponby367_296repositories. You may certainly put your trust in this code.Supported Features & Best–PracticesRequests is ready for the demands of building robust and reliable HTTP–speak applications, for the needs of today.+ International Domains and URLs       + Keep-Alive & Connection Pooling
         + Sessions with Cookie Persistence     + Browser-style SSL Verification
         + Basic & Digest Authentication        + Familiar `dict`–like Cookies
         + Automatic Decompression of Content   + Automatic Content Decoding
         + Automatic Connection Pooling         + Unicode Response Bodies*
         + Multi-part File Uploads              + SOCKS Proxy Support
         + Connection Timeouts                  + Streaming Downloads
         + Automatic honoring of `.netrc`       + Chunked HTTP Requests

                            &, of course, rock–solid stability!✨ 🍰 ✨Requests Module InstallationThe recommended way to intall therequestsmodule is to simply usepipenv(orpip, of
course):$pipenvinstallrequestsAdding requests to Pipfile's [packages]…✔ Installation Succeeded…Requests officially supports Python 2.7 & 3.5+.P.S. — Documentation is Available at//requests.readthedocs.io.
Package: requests-adapter-injector
requests-adapter-injectorThis package provides a global mechanism for injection ofRequeststransport adapters. Injection is done with the help ofimporthooklibrary and a.pthfile as describedhere.
You may probably want to use this package in a separate venv, where you would install
Python tools using Requests which you want to inject transport adapters into, along with
a package implementing desired adapters to inject. You may want to trypipxtool
to manage venvs for Python-based tools.
With that you would probably dopipx install <target-tool> && pipx inject <target-tool> <adapter-package>.This package itself can be tested using the built-in test transport adapter, which can also serve as an example
for authors of adapter packages.$ python -mvenv venv
$ venv/bin/pip install requests-adapter-injector
$ venv/bin/python -c "import requests; r = requests.get('injector-test://some/url'); print(r.json())"
{'method': 'GET', 'url': 'injector-test://some/url', 'headers': {'User-Agent': 'python-requests/2.23.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'}, 'body': None}Adapter packages have to declare one or morerequests_adapter_injector.adapterentry_points, and are expected
to require this package, to have it installed automatically.Note: this package will not work when installed as editable install becausesrc/requests_adapter_injector.pthis not installed then.Existing transport adapter packagesNone so far and some in planning.
Package: requests-aeaweb
Requests-AEAweb is a customRequestsclass to log ontoAEAweb.org, the website of the American Economic Association.InstallationCurently can only be downloaded from source; available on pip very soon.$pipinstallrequests_aeawebDocumentationDetailed documentation available atwww.erinhengel.com/software/requests-aeaweb.QuickstartTheAEAwebclass logs ontoAEAweb.organd establishes a connection with the host.
Thesessionattribute returns aRequest Session objectwith all the methods of the mainRequests API.>>>fromrequests_aeawebimportAEAweb# Establish AEAweb connection object.>>>deets={'username':'someuser','password':'XXXX'}>>>conn=AEAweb(login=deets)# Use session attribute to access Requests methods.>>>url='{}/articles.php'.format(conn.url)>>>payload={'doi':'10.1257/aer.20130626'}>>>request=conn.session.get(url,params=payload)>>>request.status_code200# Do stuff with your request object.>>>frombs4importBeautifulSoup>>>soup=BeautifulSoup(request.text,'html.parser')>>>soup.title'AEAweb: AER (106,3) p. 525 - University Differences in the Graduation of Minorities in STEM Fields: Evidence from California'TheAERsubclass contains thehtml,pdfandrefmethods to download the webpage HTML, PDF and bibliographic
information of articles published in theAmerican Economic Review.>>>fromrequests_aeawebimportAER# Establish AEAweb connection object via AER.>>>conn=AER(login=deets)# Download the HTML of the article with document id 10.1257/aer.20140289.>>>doc_id='10.1257/aer.20140289'>>>html=conn.html(id=doc_id)# Download the document PDF.>>>pdf=conn.pdf(id=doc_id,file='article.pdf')# Download the bibliographic information.>>>biblio=conn.ref(id=doc_id)>>>biblio['Authors'][{'Affiliation':'Johns Hopkins U','Name':'Korinek, Anton'},{'Affiliation':'MIT','Name':'Simsek, Alp'}]
Package: requests-aliyun
Versionv0.3.1Aliyun authentication for the awesome requests![x] OSS (api-version: 2014-08-28)[x] ECS (api-version: 2014-05-26)[x] RDS (api-version: 2014-08-15)[x] SLB (api-version: 2014-05-15)[x] CMS (api-version: 2015-04-20)How to InstallJustpipinstallrequests-aliyunHow to UseJust pass the auth object to requests>>>importrequests>>>fromaliyunauthimportOssAuth>>>req=requests.get(..."http://example.com/path/to/file",...auth=OssAuth("bucket-name","access-key","secret-key")...)<Response[200]>Or set the auth attribute to the session object>>>importrequests>>>fromaliyunauthimportOssAuth>>>session=requests.session()>>>session.auth=OssAuth("bucket-name","access-key","secret-key")>>>req=session.get("http://example.com/path/to/file")<Response[200]>Play with OSSFull api document avaiable at:OSS API>>>importrequests>>>fromaliyunauthimportOssAuth>>>req=requests.get(..."http://bucket-name.oss-url.com/path/to/file",...auth=OssAuth("bucket-name","access-key","secret-key")...)<Response[200]>Play with ECSFull api document avaiable at:ECS API>>>importrequests>>>fromaliyunauthimportEcsAuth>>>req=requests.get(..."https://ecs.aliyuncs.com",...params=dict(Action="DescribeInstanceTypes"),...auth=EcsAuth("access-key","secret-key")...)<Response[200]>Play with RDSFull api document avaiable at:RDS API>>>importrequests>>>fromaliyunauthimportRdsAuth>>>req=requests.get(..."https://rds.aliyuncs.com",...params=dict(Action="DescribeDBInstances",RegionId="cn-hangzhou"),...auth=RdsAuth("access-key","secret-key")...)<Response[200]>Play with SLBFull api document avaiable at:SLB APIPlay with CMSFull api document avaiable at:CMS API>>>importrequests>>>fromaliyunauthimportCmsAuth>>>req=requests.get(..."metrics.aliyuncs.com",...params=dict(Action="DescribeMetricDatum"),...auth=CmsAuth("access-key","secret-key")...)<Response[200]>
Package: requests-asserts
Requests-AssertsThe decorator and context manager to mock and verify HTTP requests made byrequestslibrary forunittest.How to installpip install requests-assertsHow to useMake a list ofRequestMockelements that contain all information about the expected request and response.
UseRequestMock.assert_requests(request_mocks)with the list as a decorator or context manager.ExampleimportrequestsfromunittestsimportTestCasedefget_likes_on_post(username,password,post_id):access_token=requests.post('http://my.site/login',json={'username':username,'password':password}).json()['access_token']likes=requests.get(f'http://my.site/posts/{post_id}',headers={'Accept':'application/json','Authorization':f'Bearer{access_token}'}).json()['likes']returnlikesclassTestGetLikesOnPost(TestCase):@RequestMock.assert_requests([RequestMock(request_url='http://my.site/login',request_json={'username':'the name','password':'the password'},request_method=RequestMock.Method.POST,response_json={"access_token":'the-token'}),RequestMock(request_url='http://my.site/posts/3',request_headers_contains={'Authorization':'Bearer the-token'},response_json={'name':'The cool story','likes':42})])deftest_get_likes_on_post(self):self.assertEqual(42,get_likes_on_post('the name','the password',3))
Package: requests-async
This work has been overtaken by thehttp3project:https://www.encode.io/http3/We now recommend usinghttp3.AsyncClient()for async/await support with a requests-compatible API.Note: Useipythonto try this from the console, since it supportsawait.>>>importhttp3>>>client=http3.AsyncClient()>>>r=awaitclient.get('https://www.example.org/')>>>r.status_code200>>>r.text'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'requests-asyncBrings support forasync/awaitsyntax to Python's fabulousrequestslibrary.RequirementsPython 3.6+Installation$pipinstallrequests-asyncUsageJust usethe standard requests API, but useawaitfor making requests.Note: Useipythonto try this from the console, since it supportsawait.importrequests_asyncasrequestsresponse=awaitrequests.get('https://example.org')print(response.status_code)print(response.text)Or use explicit sessions, with an async context manager.importrequests_asyncasrequestsasyncwithrequests.Session()assession:response=awaitsession.get('https://example.org')print(response.status_code)print(response.text)Therequests_asyncpackage subclassesrequests, so you're getting all the
standard behavior and API you'd expect.Streaming responses & requestsTheiter_content()anditer_lines()methods are async iterators.response=awaitrequests.get('https://example.org',stream=True)asyncforchunkinresponse.iter_content():...The method signatures remain the same as the standardrequestsAPI:iter_content(chunk_size=1, decode_unicode=False)iter_lines(chunk_size=512, decode_unicode=False, delimiter=None)The methods will yield text ifdecode_unicodeis set and the response includes
an encoding. Otherwise the methods will yield bytes.You can also stream request bodies. To do this you should use an asynchronous
generator that yields bytes.asyncdefstream_body():...response=awaitrequests.post('https://example.org',data=stream_body())Mock RequestsIn some situations, such as when you're testing a web application, you may
not want to make actual outgoing network requests, but would prefer instead
to mock out the endpoints.You can do this using theASGISession, which allows you to plug into
any ASGI application, instead of making actual network requests.importrequests_async# Create a mock service, with Starlette, Responder, Quart, FastAPI, Bocadillo,# or any other ASGI web framework.mock_app=...ifTESTING:# Issue requests to the mocked application.requests=requests_async.ASGISession(mock_app)else:# Make live network requests.requests=requests_async.Session()Test ClientYou can also useASGISessionas a test client for any ASGI application.You'll probably want to installpytestandpytest-asyncio, or something
equivalent, to allow you to writeasynctest cases.fromrequests_asyncimportASGISessionfrommyprojectimportappimportpytest@pytest.mark.asyncioasyncdeftest_homepage():client=ASGISession(app)response=awaitclient.get("/")assertresponse.status_code==200AlternativesThehttp3packageboth sync and async HTTP clients, with a requests-compatible API.Theaiohttppackageprovides an alternative client for making async HTTP requests.
Package: requests-auth-mashery
Simple class for making authenticated requests to Mashery APIs using therequestslibrary.Exampleimportrequestsfromrequests_auth_masheryimportMasheryAuthdefmain():api_key='EXAMPLE'api_secret='EXAMPLE'mashery_auth=MasheryAuth(api_key,api_secret)payload={'entitytype':'artist','query':'weezer','format':'json',}url='http://api.rovicorp.com/search/v2.1/music/search'r=requests.get(url,auth=mashery_auth,params=payload)printr.contentif__name__=='__main__':main()
Package: requests-aws
#S3 using python-requestsAWS authentication for Amazon S3 for the wonderful [pyhon requests library](http://python-requests.org)[![Build Status](https://travis-ci.org/tax/python-requests-aws.svg?branch=master)](https://travis-ci.org/tax/python-requests-aws)- Tested with python 2.7 and python 3- At the moment only S3 is supported## Usage```pythonimport requestsfrom awsauth import S3AuthACCESS_KEY = 'ACCESSKEYXXXXXXXXXXXX'SECRET_KEY = 'AWSSECRETKEYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'url = 'http://mybuck.s3.amazonaws.com/file.txt's = 'Lola is sweet'# Creating a filer = requests.put(url, data=s, auth=S3Auth(ACCESS_KEY, SECRET_KEY))# Downloading a filer = requests.get(url, auth=S3Auth(ACCESS_KEY, SECRET_KEY))if r.text == 'Lola is sweet':print "It works"# Removing a filer = requests.delete(url, auth=S3Auth(ACCESS_KEY, SECRET_KEY))```## InstallationInstalling requests-aws is simple with pip:```$ pip install requests-aws```
Package: requests-aws-iam-auth
Requests AWS IAM AuthAn AWS IAM authentication package for Requests. Supported services: API Gateway v1. This is intended for use in production environments at the 1.0 release.ExampleAPI Gateway v1importrequestsimportrequests_aws_iam_auth# Provide AWS creds and config per Boto3 specs: https://tknk.io/ri3vauth=requests_aws_iam_auth.ApiGateway()requests.get("https://p7xw90rcx4.execute-api.us-east-1.amazonaws.com/s/",auth=auth)Developer InformationDependenciesBotocoreHeadersauthorization, and x-amz-content-sha256 are directly modified in the signing protocal and will be set.Expect for authorization, connection, expect, user-agent, x-amz-content-sha256, x-amz-security-token and x-amzn-trace-id all user set headers are signed.If the user does not specify host it is derived and signed.If the method is not GET, HEAD, or OPTIONS, has a payload, and the user does not provide a content-length header it is derived and signed.If there's a Date header, we set the date header. Otherwise, we set the X-Amz-Date header.The underlying http.client will derive an unsigned accept-encoding header if not user specified.If using STS x-amz-security-token will be set by this library.PayloadThe payload is always signed using SHA 256.ProtocolsHTTP and HTTPS 1.1 are supported.PythonLatest three minor versions of python will be supported.Contributor NotesThis library uses botocore for signing.Requests uses urllib3 which uses http.client.Botocore relies on http.client deriving the host when absent. Botocore replacates this deravation and signs with it but does not append the header to the sent request. This has the potential for a mismatch error. There is a TODO in botocore to set the host header in the request.MaintainersCoreMateus Amin and Benton DrewAPI Gateway v1Mateus Amin and Benton DrewSome Other Service????Referenceshttps://docs.python.org/3/library/http.client.html#module-http.clienthttps://hg.python.org/cpython/file/3.2/Lib/http/client.pyhttps://github.com/urllib3/urllib3/blob/063d888bc247eb6bd7aedcd32412bbb53c3c6ffb/src/urllib3/connection.py#L195https://github.com/psf/requests/blob/7b565d886c852609a849e79e4ad8f3f8fa8d8c23/requests/adapters.py#L166TODOAdd testing of three most recent python versions. Use docker not tox. No reason to bloat the stack.Add fuzzing?Add CI build. Keep it portable and deterministic.Support AWS API Gateway v2 if it adds IAM Auth as a feature. Same for HTTP2.Add Requests v3 support.connection header. The connection header is set to blank between post auth and the server signing (inclusive). Could be a AWS, Requests, urllib3, botocore, or http.client. Have ruled out botocore. Can rule out the urllib3 and http.client by reading the sent request on the wire. As a temporary workaround we do not sign it.