Pynosaur

Modern CLI tools with better UX

View the Project on GitHub pynosaur/pynosaur

← Back

purl

Pure Python URL transfer tool (alternative to curl).

Version: 0.1.1

Features

Usage

# Basic GET request
purl https://example.com

# Download to file
purl -o page.html https://example.com

# Show response headers
purl -i https://api.github.com

# Custom headers
purl -H "Accept: application/json" https://api.github.com

# POST request with data
purl -X POST -d "key=value" https://api.example.com

# Multiple headers
purl -H "Authorization: Bearer token" -H "Content-Type: application/json" https://api.example.com

# Verbose mode
purl --verbose https://example.com

Options

Examples

Fetch a webpage:

purl https://example.com

Download a file:

purl -o archive.tar.gz https://example.com/file.tar.gz

API request with JSON:

purl -H "Accept: application/json" https://api.github.com/users/pynosaur

POST request:

purl -X POST -d '{"key":"value"}' -H "Content-Type: application/json" https://api.example.com

Check headers:

purl -i https://example.com

Installation

Build from source

git clone https://github.com/pynosaur/purl.git
cd purl
bazel build //:purl_bin
cp bazel-bin/purl ~/.local/bin/

Development

# Run directly with Python
python app/main.py https://example.com

# Run tests
python test/test_main.py

Testing

python test/test_main.py
python -m unittest discover -s test -v