Skip to main content

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.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for azy 0.0.3
File Size Uploaded Provenance
azy-0.0.3.tar.gz 3.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for azy 0.0.3
File Interpreter ABI Platform
azy-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 kB

Release files / azy-0.0.3.tar.gz

Download URL azy-0.0.3.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a870a1fc03733f1dd381453cb27c81401d53ddfd9b1d2e6e2b02642aa206728a
BLAKE2b-256 checksum
How to use checksums
fbd222d6b8d2e695ea76439020abb04213cecee5d5ee7a0f27d9de92f0de2e24
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.3-py3-none-any.whl

Download URL azy-0.0.3-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
950205b783bdb7c67c5e754e0a6cddbe6c0306ad3355c4d61b0f23e667e11435
BLAKE2b-256 checksum
How to use checksums
35054ecc68bb6912898af02e0f1d76910fe5164ddb9ba41642b7d29888a14049
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.3

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page