PyCurl is a lightweight, modern CLI tool written in Python that brings the power of curl with the ergonomics of Python's requests library. It provides a user-friendly command-line interface for making HTTP requests, managing authentication, and handling configurations.
PyCurl mimics the simplicity of curl but adds structured output and state management.
flowchart LR
User([π€ User])
CLI[("π» PyCurl CLI")]
Config["βοΈ Config/Auth"]
Network("π Internet")
subgraph Core ["π Core Logic"]
direction TB
Parser["π Typer Parser"]
Requester["π Requests Engine"]
Formatter["β¨ Rich Formatter"]
end
User ==>|Command| CLI
CLI --> Parser
Parser <--> Config
Parser --> Requester
Requester <==>|HTTP/HTTPS| Network
Requester --> Formatter
Formatter -->|Pretty Output| User
classDef plain fill:#1a1a1a,stroke:#fff,color:#fff;
classDef highlight fill:#22226e,stroke:#f2f0f0,stroke-width:2px,color:#fff;
class User plain;
class CLI,Config highlight;
- Intuitive HTTP Methods: robust support for
GET,POST,PUT,PATCH,DELETE. - Rich Output: Beautifully formatted JSON responses and error messages using
rich. - Token Management:
- Securely save and manage authentication tokens.
- Support for custom aliases for tokens.
- Insert tokens automatically into headers or cookies.
- In-built Documentation: Interactive documentation viewer directly in the CLI.
- Configuration System:
- Persist settings across sessions.
- Interactive configuration generation with
pycurl config generate.
- Cross-Platform: Works seamlessly on Windows, macOS, and Linux.
We use GitHub Actions for our CI/CD pipeline to ensure code quality and automated testing.
Our pipeline validates every commit:
- Testing: Runs unit and integration tests. (will be comming soon)
- Build: Verifies that the package builds correctly.
You can download the latest standalone executable for your platform from the Releases page.
- Go to the Releases section.
- Download the version for your OS (Windows, Linux, or macOS).
- (Optional) Add the executable to your system PATH to run it from anywhere.
Prerequisites: Python 3.10+
git clone https://github.com/YashashavGoyal/pycurl.git
cd pycurl
pip install .Initialize your environment:
pycurl initSimple GET Request
pycurl get https://jsonplaceholder.typicode.com/posts/1 --show-contentPOST Request with JSON Data
pycurl post https://api.example.com/users --json '{"name": "Alice"}'POST Request from File
pycurl post https://api.example.com/users --json @data.jsonSave a token with an alias:
pycurl token set --alias myapi --token "your-token-here"Use the saved token in a request:
pycurl get https://api.example.com/protected -U myapiView detailed documentation for any command:
pycurl docs get
pycurl docs postβββ app/
β βββ commands/ # CLI Command Implementations
β β βββ docs/ # In-built Markdown Docs
β β βββ auth/ # Auth Management Logic
β β βββ config/ # Configuration Logic
β β βββ token/ # Token Management Logic
β β βββ get.py # GET Command
β β βββ post.py # POST Command
β β βββ ...
β βββ utils/ # Helpers (UI, Parsers, Auth Utils)
β βββ main.py # Application Entry Point
βββ .github/ # CI/CD Workflows (Releases)
βββ pyproject.toml # Metadata & Dependencies
βββ README.mdAuthor: Yashashav Goyal
License: MIT