Lint URLs
Project description
permalint
Lint URLs (mostly for teaxyz/chai, but hopefully other uses too)
Features
- Ignores protocol (http, https, etc.)
- Normalizes GitHub URLs to owner/repo
- Removes query strings and fragments
- Lowercases domains and removes www
Usage
from permalint import normalize_url
url = "https://github.com/user/repo?utm_source=foo#readme"
print(normalize_url(url)) # Output: github.com/user/repo
Development
- Install dependencies:
pkgx rye sync - Run tests:
pkgx rye run pytest - Lint:
pkgx ruff check src/ - Type check:
pkgx ty src/
Contributing / Wishlist
guess-canonical-urlto guess the correct URL based on a passed list of URLs- actual source of Homepages for
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
permalint-0.1.11.tar.gz
(22.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file permalint-0.1.11.tar.gz.
File metadata
- Download URL: permalint-0.1.11.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a7efdb666e439c0c61f37537e7e6b9daf1b39818dd2f8d45608832f82b32174
|
|
| MD5 |
ad8d50d7e776af58f4a6db3132d15453
|
|
| BLAKE2b-256 |
ca0408264bd4cbbffb1d6095f711f50f2e7e7149353cd3e55f51080145e1b544
|
File details
Details for the file permalint-0.1.11-py3-none-any.whl.
File metadata
- Download URL: permalint-0.1.11-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f90b2fd10e877f729754c0d61874c4124849cc6ae87e2999b1925b9604c1953a
|
|
| MD5 |
70579433f0dd95ae801101d47eafbe60
|
|
| BLAKE2b-256 |
6218e7749205e49c62f8e6fc7f4539f14bfb9aa7ea99fa98c979db0efce8d7ac
|