Saravanan666/pypi-org huggingface dataset:
Package: httpbinx
httpbinxHTTP Request & Response Service, written in Python + FastAPI.Reference projectAKenneth ReitzProject. Seehttps://github.com/postmanlabs/httpbinQuick StartInstallationPyPIhttpbinxis available on PyPI$pipinstallhttpbinxSource Code$gitclonehttps://github.com/imleowoo/httpbinx.git
$pythonsetup.pyinstall# or `pip install .`Run itRun directly$uvicornhttpbinx:app--host=0.0.0.0--port=80Run with Docker$dockerpullleowoo/httpbinx:latest
$dockerrun-p80:80--namehttpbinxleowoo/httpbinx:latestIt starts runningINFO:     Started server process [17044]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
...
Package: httpbl
Project HoneypotHttp:BLAPI PackageRequires aHttp:BLAPI key fromhttps://www.projecthoneypot.org/Response Formatdict with keys:days_since_last_activitynamethreat_scoretypes- a list of visitor types (intvalues)The list types are enumerated in the module:httpbl.COMMENT_SPAMMERhttpbl.HARVESTERhttpbl.SEARCH_ENGINEhttpbl.SUSPICIOUSText descriptions are available in thehttpbl.DESCRIPTIONSdict.Exampleimporthttpblip_address='127.5.20.3'bl=httpbl.HttpBL('my-key')response=bl.query(ip_address)print('IP Address:{}'.format(ip_address)print('Threat Score:{}'.format(response['threat_score'])print('Days since last activity:{}'.foramt(response['days_since_last_activity'])print('Visitor type:{}'.format(', '.join([httpbl.DESCRIPTIONS[t]fortinresponse['type']]))
Package: httpcache
HTTP, like all well designed standards, has multiple confusing mechanisms for
caching. httpcache is a HTTP cache that knows how to use HTTP headers and
status codes to correctly cache your HTTP traffic. It’s built for use with the
excellentRequestslibrary,
because if you’re not using Requests you’re probably prepared to roll your own
caching library too.It’s gloriously easy to use. If all you want is caching in Requests, all you
need to do is plug a transport adapter into your Requests session:>>>importrequests>>>fromhttpcacheimportCachingHTTPAdapter>>>s=requests.Session()>>>s.mount('http://',CachingHTTPAdapter())Away you go!If you want more control, you can use the cache data-store itself. Store your
cache entries like this:fromhttpcacheimportHTTPCachecache=HTTPCache(capacity=50)cache.store(response)And retrieve them like this:cached_response=cache.retrieve(request)Simple.FeaturesTight integration withRequestsdata structures.UnderstandsExpiresandCache-Controlheaders.Knows how to interpret304 Not Modifiedresponses.Can sendIf-Modified-Sinceheaders.Aware of HTTP verbs, e.g.POST.RFC 2616-compliant.InstallationTo install httpcache, you want to run:$pipinstallhttpcacheIf you can’t do that, and you really must have httpcache, and you can’t
installpip, then you can try:$easy_installhttpcacheI strongly recommend you don’t do that though.Versionshttpcache supports all the versions of Python that Requests does. This means
2.6, 2.7 and 3.3. It is possible that httpcache will work on other versions of
Python but we do not test on those versions and will not support them.ContributeContributions are always welcome! Please abide by the following rules when
contributing:Check that no-one has opened an issue already covering your bug. If you open
a duplicate issue, the maintainer will give you a stern look.Fork theGithub repositoryand start writing your tests. If you’re fixing
a bug, I recommend writing a failing test first and working until it passes.
If you’re adding a feature, you’re free to add tests after you write the
functionality, but please test the functionality thoroughly.Send a Pull Request. If I don’t respond within a couple of days, please
shout at me on Twitter or via email until I do something about it.History0.1.3 (2013-05-19)Support Python 2.6Support Python 3.30.1.2 (2013-05-18)Fix broken setup.py.0.1.1 (2013-05-18)Cache a broader set of response codes.Follow RFC 2616’s recommendations about caching resources with query strings.Don’t cache non-idempotent methods.Non-idempotent methods invalidate their cache resources.Documentation!Actually implement the capacity parameter.0.1.0 (2013-05-11)Provide a Requests Transport Adapter so that caching ‘Just Works’.0.0.2 (2013-05-07)Correctly cache using the ‘Expires’ header.Correctly handle some of the functionality exposed by the ‘Cache-Control’ header.0.0.1 (2013-05-05)ConceptionIf-Modified-Since and 304 handling.
Package: http-caching4
Caching for HTTPX.Note: Early development / alpha, use at your own risk.This package adds caching functionality toHTTPXAdapted from Eric Larson's fantasticCacheControlforrequests.Project goals:Sans-io caching protocolFully async compatibleSupport multiple http clients (currently only supports httpx)Limitations:Currently only has in-memory cache storage (async redis would be nice!)Test suite was taken wholesale from CacheControl, so still uses a test server and mocking rather than taking advantage of the sans-io implementation.Usage:importasynciofromhttpximportAsyncClientfromhttpx_cachingimportCachingClientclient=AsyncClient()client=CachingClient(client)asyncdefrun_example():awaitclient.get("http://example.com")loop=asyncio.get_event_loop()loop.run_until_complete(run_example())Documentation:TODOSeeCacheControl's documentationfor general documentation of the caching approach.
Package: httpcap
LicenseHttpcap (Former name pcap-parser)Capture, parse and display HTTP traffics. Python 2.7.* or Python 3.3+
required.This module parses pcap/pcapng files, or capture traffics from
device(with libpcap), then retrieves HTTP data, and display as text.
Pcap files can be obtained via tcpdump, wireshark or other similar
tools.Features:HTTP requests/responses grouped by TCP connections; the requests in
one keep-alive http connection will display together.Managed chunked and compressed HTTP requests/responses.Managed character encodingFormat JSON content in a beautiful way.InstallThis module can be installed via pip:pipinstallhttpcapTHen you should have tools parse-pcap and parse-live installed * For
parsing pcap file, use parse-pcap * For capturing and parsing traffic
from net work device, use parse-liveUsageBasic usage:# Use tcpdump to capture packets:tcpdump-wtest.pcaptcpport80# only output the requested URL and response statusparse-pcaptest.pcap# or use pipesudotcpdump-w-tcpport80|parse-pcap# parse-live need to be root. capture network device en1
# on linux/osx ifconfig to see all network devicessudoparse-liveen1# capture traffics on all devicessudoparse-liveFollowing take parse-pcap as example. parse-live works exactly same as
parse-pcap, just change file name to device name.Output levelParse-pcap/parse-live only show urls by default. Use -v to display more:
Then:# output http req/resp headersparse-pcap-vtest.pcap# output http req/resp headers and body which belong to text typeparse-pcap-vvtest.pcap# output http req/resp headers and bodyparse-pcap-vvvtest.pcap# display and attempt to do url decoding and formatting json outputparse-pcap-vvbtest.pcapGroupUse -g to group http request/responses:parse-pcap-gtest.pcapThe result looks like:********** [10.66.133.90:56240] -- -- --> [220.181.90.13:80] **********
GET http://s1.rr.itc.cn/w/u/0/20120611181946_24.jpg
HTTP/1.1 200 OK
GET http://s1.rr.itc.cn/p/images/imgloading.jpg
HTTP/1.1 200 OK
GET http://s1.rr.itc.cn/w/u/0/20130201103132_66.png
HTTP/1.1 200 OK
GET http://s1.rr.itc.cn/w/u/0/20120719174136_77.png
HTTP/1.1 200 OK
GET http://s1.rr.itc.cn/p/images/pic_prev_open.png
HTTP/1.1 200 OK

********** [10.66.133.90:47526] -- -- --> [220.181.90.13:80] **********
GET http://s1.rr.itc.cn/w/u/0/20130227132442_43.png
HTTP/1.1 200 OK
GET http://s1.rr.itc.cn/p/images/pic_next.png
HTTP/1.1 200 OK
GET http://s1.rr.itc.cn/p/images/pic_prev.png
HTTP/1.1 200 OK
GET http://s1.rr.itc.cn/p/images/pic_next_open.png
HTTP/1.1 200 OKFilterYou can use the -i/-p options to specify the ip/port of source and
destination andparse-pcapwill only display HTTP data that meets
the specified conditions:parse-pcap-p55419-vvtest.pcapparse-pcap-i192.168.109.91-vvtest.pcapUse -d to specify the HTTP domain; only displays HTTP req/resp with the
specified domain:parse-pcap-dwww.baidu.com-vvtest.pcapUse -u to specify the HTTP uri pattern; only displays HTTP req/resp in
which the url contains the specified url pattern:parse-pcap-u/api/update-vvtest.pcapEncodingUse -e to force the encoding used for the HTTP bodies:parse-pcap-i192.168.109.91-p80-vv-eutf-8test.pcap
Package: httpcarousel
CarouselServe images via HTML / JavaScript which rotate every N seconds.InstallationVia Pipx:pipx install httpcarouselSample systemd unit:sudotee-a/etc/systemd/system/httpcarousel.service>/dev/null<<EOF[Unit]Description=httpcarouselAfter=network.target[Service]Type=notifyUser=debianGroup=debianExecStart=/home/debian/.local/pipx/venvs/httpcarousel/bin/carouselExecReload=/bin/kill -s HUP $MAINPIDKillMode=mixedTimeoutStopSec=5PrivateTmp=true[Install]WantedBy=multi-user.targetEOFsudosystemctldaemon-reload
sudosystemctlstarthttpcarousel
sudosystemctlenablehttpcarouselEnvironment VariablesNameDescriptionDefaultCAROUSEL_PORTThe HTTP Port that Carousel should listen on6502CAROUSEL_INTERVALHow often the displayed image should change in seconds45CAROUSEL_IMAGE_DIRECTORYThe directory to find images/tmp/images
Package: httpcats
httpcatsGetting URLs to your favourite HTTP Cats made easy!InstallationInstallinghttpcatsis easy, just runpip install httpcats!UsageI've developedhttpcatsto make using HTTP Cats simple and fun.Currently, you can get your cats using one of two functions -cat_by_nameandcat_by_codecat_by_name(name: str)takes in a sole parameter -name, which is the status code name to get a cat for.
Upon finding a cat matching the name, it returns anHTTPCatobject. Here's an example -from httpcats import cat_by_name

my_cat = cat_by_name("Success")

print(f"My cat has a code of {my_cat.code} and means {my_cat.name}! The URL is {my_cat.url}")
# Prints - 
# My cat has a code of 200 and means Success! The URL is https://http.cat/200cat_by_code(code: int)is extremely similar tocat_by_name, just using a status code value.
Upon finding a cat matching the code, it returns anHTTPCatobject. Here's an example -from httpcats import cat_by_code

my_cat = cat_by_code(404)

print(f"My cat has a code of {my_cat.code} and means {my_cat.name} :( The URL is {my_cat.url}")
# Prints - 
# My cat has a code of 404 and means Not Found :( The URL is https://http.cat/404The HTTPCat object also has animageattributeYou can use this attribute to get the image bytes associated with the cat.
You can then save it or view it, like in the example below -from httpcats import cat_by_code
from PIL import Image
from io import BytesIO

my_cat = cat_by_code(302)

cat_image = Image.open(BytesIO(my_cat.image))
cat_image.show()

# Output below -ContributingThis package is opensource so anyone with adequate python experience can contribute to this project!Report IssuesIf you find any error/bug/mistake with the package or in the code feel free to create an issue and report ithere.Fix/Edit ContentIf you want to contribute to this package, fork the repository, make your changes and then simply create a Pull Request!ContactIf you want to contact me -Mail -wulf.developer@gmail.comDiscord -wulf#9716
Package: httpcats-and-httpdog
httpcats-and-httpdog这里有中文版本：readme-zhhttpcats-and-httpdogis a Python package for retrieving images corresponding to HTTP response status codes. It allows you to get images fromhttpcatsorhttpdogbased on the provided HTTP response status codes.InstallationYou can install thehttpcats-and-httpdogpackage viapip:pip install httpcats-and-httpdogUsagefromhttpcats_and_httpdogimportget_image# Get image data from httpcatsstatus_code="200"image_bytes=get_image("httpcats",status_code)# Get image data from httpdogstatus_code="200"image_bytes=get_image("httpdog",status_code)Theget_imagefunction takes three arguments: the service name (httpcatsorhttpdog), HTTP response status code, and image format (optional, default is.jpg). It returns the byte data of the corresponding image, which you can further process or save as needed.Error HandlingWhen calling theget_imagefunction, it raises aValueErrorif the input status code is not a three-digit number or if downloading the image fails. Please ensure to provide the correct status code and check that your network connection is working properly.
Package: httpchunked
httpchunkedDo you need support for chunked transfer encoding in your Python web server,
without adding a dependency on a complete framework? Thenhttpchunkedis
the module you need! It has no third-party dependencies and consists of only
two functions:decodeandencode.UsageDecoding$catmain.py
fromioimportBytesIO

fromhttpchunkedimportdecodeif__name__=="__main__":dst=BytesIO()src=BytesIO(b"3\r\nfoo\r\n0\r\n\r\n")decode(dst,src)raw=dst.getvalue()print(raw)$pythonmain.py
b'foo'Encoding$catmain.py
fromioimportBytesIO

fromhttpchunkedimportencodeif__name__=="__main__":dst=BytesIO()src=BytesIO(b"foo")encode(dst,src)raw=dst.getvalue()print(raw)$pythonmain.py
b'3\r\nfoo\r\n0\r\n\r\n'Installationpipinstallhttpchunked
Package: httpcli
Just another command line HTTP client (in the spirit of cURL).Example UsageHTTP verbs are specified as a positional argument, followed by the URL to be
acted on. The goal is to reflect the feel of a standard HTTP header. For
example:$ http get http://localhost/To provide a request body (e.g. for a POST or PUT), use the third positional
argument:$ http post http://localhost/documents '{"json": "document"}' --content-type="application/json"Note the arbitrary request header being specified at the end as a normal CLI
option. Any such trailing CLI options will be passed as request headers:$ http get http://localhost/ --x-forwarded-for=10.0.0.50This would be translated asX-Forwarded-For: 10.0.0.50in the subsequent HTTP
request. To illustrate this, we can enable verbose output:$ http get http://localhost/ --x-forwarded-for=10.0.0.50
GET http://localhost/
X-Forwarded-For: 10.0.0.50

200 OK
Status: 200
Content-Length: 396
Content-Location: http://localhost/
Date: Wed, 30 May 2012 19:26:03 GMT
Content-Type: application/json

{
  "documents": [
    {
      "id": "c1be0fde3c0f4d27be15e1e3812cfd65b58325c3",
      "value": "a"
    },
    {
      "id": "67dc85dceacd3734ae53f1a69f56785dfe4c4c71",
      "value": "b"
    }
  ]
}Built-In HelpExample help output:$ http --help
usage: http [-h] [-t] method url [body] ...

Python HTTP CLI Client

positional arguments:
  method       HTTP method to use (OPTIONS, GET, HEAD, POST, PUT, DELETE,
               TRACE, CONNECT)
  url          URL to work with
  body         Request body
  headers      Additional request headers (keyword=value)

optional arguments:
  -h, --help   show this help message and exit
  -t, --terse  Only show the response body
Package: httpclient
InstallationCommand line installation (Unix, Windows):$ pip install httpclient(pip installation instructions)QuickstartSend a GET request:from httpclient import HttpClient

http_client = HttpClient()
page = http_client.get("http://www.google.com")

print(page.content_as_string)Send a POST request:from httpclient import HttpClient

http_client = HttpClient()
page = http_client.post("http://www.some-site.org/login",
                    {"username": "xxx", "password": "yyy"})
print(page.content_as_string)DocumentationFull documentation within thegithub wiki.
Package: httpclient-logging
InstallationInstall via pip:>bin/pipinstallhttpclient_loggingOr add to your poetry-based project:>poetryaddhttpclient_loggingUsageThe only thing left to do for you is the create a.envin the root of your project.Registered sitecustomize-entrypointThehttpclient_logging.entrypoint-function is registered as asitecustomize-entrypoint in our pyproject.toml_:[tool.poetry.plugins][tool.poetry.plugins."sitecustomize"]httpclient_logging="httpclient_logging:entrypoint"Sitecustomize and all its registered entrypoints will be executed at the start ofeverypython-process.
For more information, please seesitecustomize-entrypointsCompatibilityhttpclient-loggingworks on Python 3.8+, including PyPy3. Tested until Python 3.11,Notable dependenciessitecustomize-entrypoints
Package: httpcode
_   _ _____ _____ ____   ____ ___  ____  _____
| | | |_   _|_   _|  _ \ / ___/ _ \|  _ \| ____|
| |_| | | |   | | | |_) | |  | | | | | | |  _|
|  _  | | |   | | |  __/| |__| |_| | |_| | |___
|_| |_| |_|   |_| |_|    \____\___/|____/|_____|httpcodeis a little utility that explains the meaning of an HTTP
status code on the command line.http://httpcode.readthedocs.orgInstallation$ [sudo] pip install httpcodeThere is also an official DEB package available athttp://packages.debian.org/sid/httpcodeUsageExplain 405 status code$ hc 405
Status code 405
Message: Method Not Allowed
Code explanation: Specified method is invalid for this resource.Or 418 status code :)$ hc 418
Status code 418
Message: I'm a teapot
Code explanation: The HTCPCP server is a teapotList all codes$ hc
Status code 100
Message: Continue
Code explanation: Request received, please continue

Status code 101
Message: Switching Protocols
Code explanation: Switching to new protocol; obey Upgrade header

Status code 200
Message: OK
Code explanation: Request fulfilled, document follows

...Search code(s) by description (case-insensitive)$ hc -s too
Status code 413
Message: Request Entity Too Large
Code explanation: Entity is too large.

Status code 414
Message: Request-URI Too Long
Code explanation: URI is too long.Filter codes with a regex$ hc 30[12]
Status code 301
Message: Moved Permanently
Code explanation: Object moved permanently -- see URI list

Status code 302
Message: Found
Code explanation: Object moved temporarily -- see URI listUse an ‘x’ for any digit$ hc 1xx
Status code 100
Message: Continue
Code explanation: Request received, please continue

Status code 101
Message: Switching Protocols
Code explanation: Switching to new protocol; obey Upgrade headerShow help$ hc -h
Usage: hc [code] [options]

code may contain regular expression or use 'x' to denote any digit
code examples: 418, 30[12], 3.*, 1xx

Without parameters lists all available
HTTP status codes and their description


Options:
  -h, --help            show this help message and exit
  -s SEARCH, --search=SEARCH
                        Search for a code by name or description. Search text
                        may contain regular expressions.RoadmapAdd more codesChange History0.6 (2017-04-03)Use argparse instead of optparseDeclare as Python 2.7+ and Python 3 compatible0.5 (2011-12-30)Colorize HTTP codes0.4 (2011-12-27)regex and ‘x’ can be used as part of an HTTP codehttps://github.com/rspivak/httpcode/pull/60.3 (2011-12-22)Add -s/–search option to search for code by descriptionhttps://github.com/rspivak/httpcode/pull/30.2 (2011-12-21)Add HTTP code 418 (I’m a teapot):https://github.com/rspivak/httpcode/pull/2Bugfix:https://github.com/rspivak/httpcode/issues/10.1 (2011-12-21)Initial release
Package: httpcodes
httpcodesHttp codes is a minimal package the literally maps the status-message to a status-code.
The only use-case of this package is to increase readability in your code.InstallingInstall and update usingpip:pip install -U httpcodesA Simple Exampleimport httpcodes

print(httpcodes.OK)
print(httpcodes.NOT_FOUND)
print(httpcodes.IM_A_TEAPOT)
Package: httpcompressionserver
This module adds support of HTTP compression (eg gzip) to the standard library
module http.server.Usage:python -m httpcompressionserver [-h] [--bind ADDRESS] [port]

positional arguments:
  port                  Specify alternate port [default: 8000]

optional arguments:
  -h, --help            show this help message and exit
  --bind ADDRESS, -b ADDRESS
                        Specify alternate bind address [default: all
                        interfaces]
Package: http-constants
Http ConstantsA set of constants for HTTP statuses and headers.InstallationYou can install Http Constants fromPyPI:pip install http-constantsThe library is supported on Python 3.7+.UsageHeadersfromhttp_constants.headersimportHttpHeaders>>>HttpHeaders.ACCEPT'Accept'>>>HttpHeaders.CONTENT_TYPE_VALUES.json'application/json'Statusesfromhttp_constants.statusimportHttpStatus>>>HttpStatus.SERVICE_UNAVAILABLE<HttpStatus.SERVICE_UNAVAILABLE:(503,'Service Unavailable')>>>>HttpStatus.SERVICE_UNAVAILABLE.value503>>>int(HttpStatus.SERVICE_UNAVAILABLE)503>>>HttpStatus.SERVICE_UNAVAILABLE.reason_phrase'Service Unavailable'>>>str(HttpStatus.SERVICE_UNAVAILABLE)'503 SERVICE_UNAVAILABLE'
Package: http-containerize
Function framework for PythonThis framework provides a mechanism to write Function-as-a-Service style code in
Python for handling HTTP events, including CloudEvents delivered via HTTP.This framework is primarily intended to work withKnative, but also works to provide a generic server for
handling CloudEvents over HTTP (e.g. from Kubernetes or on a local machine).The framework uses reflection to find a suitable function to wrap; it should not
be necessary to import any of the following modules in your own code unless you
want (e.g. for type definitions):frameork(this module; on PyPi ashttp-containerize)flaskcloudeventsInstead, simply ensure that you have a single non-_prefixed function which
uses some combination of the following:HTTP request arguments (namedreq,request,body,headersor of theflask.Requesttype)CloudEvent arguments (namedevent,payload,data,attributesor of thecloudevents.sdk.event.v1.Eventtype)Usage:importloggingfromtypingimportAnycounter=0defDoEvent(data:Any,attributes:dict,req:Any):globalcountercounter=counter+1logging.info(f"Got data:{data}")logging.info(f"From{req.origin}, my{counter}th request!")attributes["type"]="com.example.reply"attributes["datacontenttype"]="text/plain"returnattributes,"It's a demo"Building into a container:You can use the packeto buildpacks if you addhttp-containerize>=0.4.0to yourrequirements.txt:packbuildpytestapp--buildpackekanderson/pyfun:0.1.1--builderpaketobuildpacks/builder:baseYou can then invoke it via:dockerrun--rm-p8080:8080-e8080pytestapp