Python HTTP client designed to be simple
A zero-dependency HTTP library designed to be simple and async context.
You enjoy using requests or httpx for HTTP client, wanna try badut ?
Features
Badut is a very lightweight library, yet it handle the most of HTTP client needs.
- Zero Dependencies
- Connection Timeouts
- JSON Parsing
- Follow Redirects
- And more coming soon..
Prerequisites
| NOTE: Python 3.7 or above |
Installation
pip install badut / pipenv install badut
Or manual clone this repository
Quick example
- GET request
import asyncio
from badut import Badut
client = Badut(json=True, timeout=5)
async def main():
res = await client.get("https://api.github.com/users/sinkaroid")
print(res)
asyncio.run(main())
- POST request
async def posting():
res = await client.post("https://httpbin.org/anything",
data={"Title": "Hello Badut", "Name": "adalah sy"})
print(res)
asyncio.run(posting())
Example with authentication
Some API requires additional authentication
import asyncio
from badut import Badut
client = Badut(json=True, timeout=5,
headers={
"User-Agent": "Badut/1.0.1",
"authorization": "Bot YouRNicET0k3nFr0mDisc0rd.XuIwOw.IXcORO2fO5XXSmugSombong",
},
)
async def fetch_discord():
res = await client.get("https://discord.com/api/v9/users/456298243618504707")
print(res)
asyncio.run(fetch_discord())
Documentation
The documentation can be found https://sinkaroid.github.io/badut
Pronunciation
Metadata
Release files for badut 1.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| badut-1.0.6.tar.gz | 4.0 kB | Without provenance | Details for badut-1.0.6.tar.gz |
Release files / badut-1.0.6.tar.gz
| Download URL | badut-1.0.6.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a0e6178241e1f93d997a80bfb41698c74b42ebd4fa393975f7894e07b21f6e6
|
|
BLAKE2b-256 checksum How to use checksums |
42dd3a1e623d69f33640e562a3af68c040d31a8224b844951b16757c31aa257f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.27.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.7
|
Security for badut 1.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.