Metadata-Version: 2.4
Name: serp-url
Version: 0.1.0
Summary: Serpentine URL toolkit: url_parse, quote/unquote, quote_plus/unquote_plus, urlencode, parse_query (pure Serpentine, dual-runs under CPython)
Author: Serpentine contributors
License: MIT
Project-URL: Homepage, https://github.com/avijitbhuin21/Serpentine
Keywords: serpentine,url,urlencode,percent-encoding
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: serpentine-shim

# serp-url

URL parsing and encoding for Serpentine. Pure Serpentine ([P]) — the same
source dual-runs under CPython.

```python
from serp_url import url_parse, quote, urlencode, parse_query

u = url_parse("https://example.com:8443/a/b?x=1&y=two#frag")
print(u.scheme, u.host, u.port, u.path, u.query, u.fragment)
print(quote("a b/c?"))                 # a%20b/c%3F
print(parse_query("x=1&name=J%C3%BCrgen"))
```

## API

- `Url` — dataclass: `scheme, host, port (-1 when absent), path, query, fragment`
- `url_parse(url) -> Url` — handles IPv6 bracket hosts; no userinfo support
- `default_port(scheme) -> int`, `effective_port(u) -> int`
- `quote(s)` / `unquote(s)` — RFC 3986 percent-encoding of UTF-8 ('/' kept safe in quote)
- `quote_plus(s)` / `unquote_plus(s)` — form encoding (space ↔ '+')
- `urlencode(params: dict[str, str]) -> str`
- `parse_query(q) -> dict[str, str]` — last value wins for duplicate keys
