Small Python library to strip non-spacing marks (e.g., diacritics) from a string
Project description
strip_marks
A small Python library for stripping non-spacing marks (e.g., diacritics; accents) from a string.
Quick Start
from strip_marks import strip_marks
assert strip_marks("şéàşöñ") == "season"
assert strip_marks("kaderdenkesişenyollarinhikayesi.xyz") == "kaderdenkesisenyollarinhikayesi.xyz"
def identity(x): return x
assert strip_marks("hello world") == identity("hello world")
Using strip_marks as a Library
This package is published on PyPI. You can install it with PIP:
$ pip add strip-marks
Or, if using UV for dependency management:
$ uv add strip-marks
Notes on Internal Functionality
This library uses Python's unicodedata standard library for normalising strings to strip marks.
Early (incomplete) versions of the library implemented (and used internally) functions adapted from the utf8proc C library to handle characters of multiple codepoints. This implementation used bitwise functionality from our sister package, ispunct. I would like to continue to explore this lower-level problem space to see if I can implement something in Python that is more efficient than the current implementation.
Alternative Libraries
This was written mostly as a proof of concept. A more developed library with this functionality is unidecode. A curious reader may also be interested in unihandecode/pykakasi or text-unidecode.
Citation
If your research depends on strip_marks, please consider giving us a formal citation: citation.bib.
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
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 strip_marks-1.0.1.tar.gz.
File metadata
- Download URL: strip_marks-1.0.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
340e84e23018bb8b4ded22b602537128e3bb0d5ea26fef5241204b62751aa095
|
|
| MD5 |
e3f3c542826ae0d6137e7637ae787146
|
|
| BLAKE2b-256 |
41d27b9593e39bb9c147884f3256bc3fff1837d2dbd7abd2ff6481aeb49dfd33
|
Provenance
The following attestation bundles were made for strip_marks-1.0.1.tar.gz:
Publisher:
ci.yml on jakewilliami/strip-marks-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strip_marks-1.0.1.tar.gz -
Subject digest:
340e84e23018bb8b4ded22b602537128e3bb0d5ea26fef5241204b62751aa095 - Sigstore transparency entry: 799063993
- Sigstore integration time:
-
Permalink:
jakewilliami/strip-marks-py@dca194a4a31ebaf9668cc9ecb98604b9ad428ae7 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/jakewilliami
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@dca194a4a31ebaf9668cc9ecb98604b9ad428ae7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file strip_marks-1.0.1-py3-none-any.whl.
File metadata
- Download URL: strip_marks-1.0.1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ada97efe5aa90ebbdff826bbf3fdc2831ebc29831dfa2056a1a90f55145173e
|
|
| MD5 |
00bf93a3d58e46904b3d33b1dc37f9d6
|
|
| BLAKE2b-256 |
625ba0872e83dc3e8133ca1e60b1608ddb734ec309a6ae410d4e03544b42db85
|
Provenance
The following attestation bundles were made for strip_marks-1.0.1-py3-none-any.whl:
Publisher:
ci.yml on jakewilliami/strip-marks-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strip_marks-1.0.1-py3-none-any.whl -
Subject digest:
9ada97efe5aa90ebbdff826bbf3fdc2831ebc29831dfa2056a1a90f55145173e - Sigstore transparency entry: 799063994
- Sigstore integration time:
-
Permalink:
jakewilliami/strip-marks-py@dca194a4a31ebaf9668cc9ecb98604b9ad428ae7 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/jakewilliami
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@dca194a4a31ebaf9668cc9ecb98604b9ad428ae7 -
Trigger Event:
push
-
Statement type: