azy
English | 中文
把任意文本转成干净的 URL slug。
安装
pip install azy
用法
from azy import slugify
slugify("Hello, World!") # 'hello-world'
slugify("Café au Lait") # 'cafe-au-lait'
slugify(" --Already--Slugged-- ") # 'already-slugged'
slugify("A very long title here", 10) # 'a-very-lon'
slugify("one two", n_sep="_") # 'one_two'
说明
先做 NFKD 归一化再去掉非 ASCII 字符,所以 é 变 e、ü 变 u;非 a-z0-9 的连续片段压成一个分隔符,首尾分隔符剪掉。中文、emoji 这类没有 ASCII 对应字符的会被丢弃,需要保留时先自行转写。
许可证
MIT
English
Turn arbitrary text into a clean URL slug.
Install
pip install azy
Usage
from azy import slugify
slugify("Hello, World!") # 'hello-world'
slugify("Café au Lait") # 'cafe-au-lait'
slugify(" --Already--Slugged-- ") # 'already-slugged'
slugify("A very long title here", 10) # 'a-very-lon'
slugify("one two", n_sep="_") # 'one_two'
Notes
NFKD normalisation folds é to e and ü to u; runs of non a-z0-9 collapse to one separator, and leading/trailing separators are trimmed. Characters without an ASCII equivalent (CJK, emoji) are dropped.
License
MIT
Metadata
Release files for azy 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| azy-0.0.4.tar.gz | 3.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| azy-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / azy-0.0.4.tar.gz
| Download URL | azy-0.0.4.tar.gz |
|---|---|
| Size | 3.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07ef7e9d58c6da4c81e9a5d33839154e1035e796c062781a9a86d6d99cd1a8d6
|
|
BLAKE2b-256 checksum How to use checksums |
8736e5ff2cc738152ce022a9fbca21531dc2a16b8e29a546efc3a7def6c84b89
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / azy-0.0.4-py3-none-any.whl
| Download URL | azy-0.0.4-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1d61474e975d6a1870d94ab2577399bdcaabe86294e6ab2a31e06b2d43da1418
|
|
BLAKE2b-256 checksum How to use checksums |
c44d76bada7bf2872dcaf1dd3534af91c7af91c56078b60facfb1b8f67099b04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for azy 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.