github deedy5/primp v1.0.0

latest releases: v1.2.3, v1.2.2, v1.2.1...
3 months ago

Release v1.0.0

🏗️ Custom Crates Stack

Built on custom forked crates providing full control over browser impersonation and TLS fingerprinting:

Crate Description Key Components
primp-reqwest HTTP client with impersonation support Client builder, request/response handling, multipart, proxy configuration
primp-h2 HTTP/2 protocol implementation Frame handling, HPACK encoding, stream management, flow control
primp-hyper HTTP client/server library HTTP/1.1 & HTTP/2 support, body handling, connection pooling
primp-hyper-util Hyper utilities Legacy client, pool management, Tokio runtime integration
primp-rustls TLS implementation with fingerprinting TLS 1.2/1.3, certificate verification, JA3/JA4 fingerprinting

🎭 Impersonate Profiles

Browser Profiles

Browser Profiles Default
🌐 Chrome chrome_144, chrome_145 chrome_144
🧭 Safari safari_18.5, safari_26 safari_26
🔷 Edge edge_144, edge_145 edge_144
🦊 Firefox firefox_140, firefox_146 firefox_146
Opera opera_126, opera_127 opera_126
🎲 Random random -

OS Impersonation

OS Value User-Agent Impact
🤖 Android android Mobile Android user-agent
🍎 iOS ios Mobile iOS user-agent
🐧 Linux linux Desktop Linux user-agent
🍏 macOS macos Desktop macOS user-agent
🪟 Windows windows Desktop Windows user-agent
🎲 Random random Randomly selected OS

Usage Example

import primp

# Browser impersonation
client = primp.Client(impersonate="chrome_145", impersonate_os="windows")

# Random browser/OS
client = primp.Client(impersonate="random", impersonate_os="random")

⚠️ Exception Hierarchy

Comprehensive exception hierarchy mirroring Python's requests library for familiar error handling:

RequestException (base class)
├── HTTPError                    # HTTP 4xx/5xx status codes
├── ConnectionError              # Connection-related failures
│   ├── ConnectTimeout          # Connection establishment timeout
│   ├── SSLError                # SSL/TLS certificate errors
│   └── ProxyError              # Proxy connection errors
├── Timeout                      # Timeout-related failures
│   └── ReadTimeout             # Data read timeout
├── RequestError                 # Request building/sending errors
│   ├── InvalidURL              # URL format errors
│   └── InvalidHeader           # Header format errors
├── BodyError                    # Body-related errors
│   ├── StreamConsumedError     # Stream already consumed
│   └── ChunkedEncodingError    # Chunked encoding errors
├── DecodeError                  # Decoding errors
│   └── ContentDecodingError    # Content decode errors (gzip, brotli, etc.)
├── JSONError                    # JSON-related errors
│   ├── InvalidJSONError        # Invalid JSON in request body
│   └── JSONDecodeError         # JSON decode failure in response
└── TooManyRedirects            # Redirect limit exceeded

🚀 Key Features

  • Async Support - Native AsyncClient with async/await, context managers, and concurrent requests
  • HTML Conversion - Convert responses to Markdown, plain text, or rich text
  • Response Streaming - Memory-efficient chunk streaming and line iteration
  • Cookie Management - Persistent cookie store with automatic handling
  • Proxy Support - HTTP, HTTPS, SOCKS5 proxies with authentication and system proxy detection
  • SSL/TLS Options - Custom CA certificates, verification controls, HTTPS-only mode

📦 Requirements

Python Support

Version Standard Free-threaded
Python 3.10 -
Python 3.11 -
Python 3.12 -
Python 3.13 -
Python 3.14

Platform Support

Linux (glibc/manylinux)

Architecture Runner Notes
x86_64 ubuntu-22.04 Primary platform
x86 ubuntu-22.04 32-bit support
aarch64 ubuntu-22.04-arm ARM64 servers
armv7 ubuntu-22.04 ARM embedded/IoT
s390x ubuntu-22.04 IBM mainframes
ppc64le ubuntu-22.04 PowerPC servers

Linux (musllinux)

Architecture Runner Notes
x86_64 ubuntu-22.04 Alpine compatible
x86 ubuntu-22.04 32-bit Alpine
aarch64 ubuntu-22.04 ARM64 Alpine
armv7 ubuntu-22.04 ARM Alpine

Windows

Architecture Runner Notes
x64 windows-latest Primary platform
x86 windows-latest 32-bit support
aarch64 windows-11-arm ARM64 Windows

macOS

Architecture Runner Notes
x86_64 macos-15-intel Intel Macs
aarch64 macos-latest Apple Silicon (M1/M2/M3)

📚 Documentation

Documentation Files

File Description
docs/README.md Documentation index
docs/client.md Sync Client usage guide
docs/async_client.md AsyncClient usage guide
docs/response.md Response object reference
docs/exceptions.md Exception handling guide

Example Scripts

Example Description
examples/basic_usage.py GET, POST, params, headers
examples/async_usage.py Async client, concurrent requests
examples/authentication.py Basic auth, bearer tokens
examples/proxy.py HTTP/SOCKS5 proxies
examples/cookies.py Cookie management
examples/streaming.py Response streaming
examples/post_requests.py POST/PUT/PATCH/DELETE
examples/error_handling.py Exception handling
examples/html_conversion.py HTML to text conversion

🔧 Installation

pip install -U primp

📄 License

MIT License

Don't miss a new primp release

NewReleases is sending notifications on new releases.