Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

badut

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

badut

Python HTTP client designed to be simple and async context

  • 1.0.6
  • PyPI
  • Socket score

Maintainers
1
badut
Python HTTP client designed to be simple

A zero-dependency HTTP library designed to be simple and async context.

ContributingDocumentationReport Issues


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

See why badut exists..

id_ID/ba·dut/ — pelawak (dalam pertunjukan dan sebagainya);
You created an Python HTTP module, meanwhile requests and httpx is exist and those libs is more powerful

badut

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc