Skip to main content

Ultra-fast URL encoding/decoding in C with SIMD optimizations (30-35x faster than urllib.parse)

Project description

pyurlc

Ultra-fast URL encoding/decoding in C with SIMD optimizations (30-35x faster than urllib.parse)

Features

  • 30-35x faster than Python's urllib.parse
  • SIMD optimized (ARM NEON / x86 SSE)
  • Fully compatible with urllib.parse API
  • Memory efficient with proper allocation
  • Full Unicode support
  • Error handling with strict/replace/ignore modes

Installation

pip install pyurlc

Usage

import pyurlc

# Basic encoding/decoding
encoded = pyurlc.encode("Hello World!")
decoded = pyurlc.decode(encoded)

# Quote/Unquote (compatible with urllib.parse)
quoted = pyurlc.quote("test@example.com")
unquoted = pyurlc.unquote(quoted)

# Quote/Unquote with plus signs
quoted_plus = pyurlc.quote_plus("Hello World")
unquoted_plus = pyurlc.unquote_plus(quoted_plus)

# Check if string is encoded
is_encoded = pyurlc.is_encoded("Hello%20World")  # True

# Get performance info
info = pyurlc.performance_info()

Performance

String Size pyurlc urllib.parse Speedup 100 chars 0.003s 0.111s 33.7x 1,000 chars 0.028s 0.986s 34.6x 10,000 chars 0.354s 11.049s 31.2x 50,000 chars 1.973s 59.572s 30.2x

Average speedup: 32.4x

License

Apache License 2.0

Thank you for using my project!

Goobye!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyurlc-3.0.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file pyurlc-3.0.0.tar.gz.

File metadata

  • Download URL: pyurlc-3.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for pyurlc-3.0.0.tar.gz
Algorithm Hash digest
SHA256 0305f8fb911a8ccf56ddac9df89ce526e268632daefb44b0750d9ffa483bc215
MD5 c7434da000079a41c05f5440f04b4645
BLAKE2b-256 0553175533007f1f316ec832725b6caac50d421d6cee71cf07053d52b306c588

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page