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.7.tar.gz
(21.9 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.7.tar.gz.
File metadata
- Download URL: permalint-0.1.7.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f9f49f3f0a76fb2e86bc71c1ac8da33b8f78f1c604e2a0955c0ce5155eecba32
|
|
| MD5 |
16ca52526f5d8948153a2fc3b321f11c
|
|
| BLAKE2b-256 |
44aa549f767de8075b244e70b1d9fe68aa6eca4c5e10ae26d927eabf71a237a0
|
File details
Details for the file permalint-0.1.7-py3-none-any.whl.
File metadata
- Download URL: permalint-0.1.7-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b44a124a5cd92ac42e449de57370aba485cbea7812b9e5ab3e8855dadd046aa
|
|
| MD5 |
250efd096bad17f9c30c3a81c4372ab0
|
|
| BLAKE2b-256 |
10f4eb42dc1d20c2557c72574541e5eac68b8e6221e278dbe40aabf82937acb0
|