Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strip_marks-1.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strip_marks-1.0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

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

Hashes for strip_marks-1.0.1.tar.gz
Algorithm Hash digest
SHA256 340e84e23018bb8b4ded22b602537128e3bb0d5ea26fef5241204b62751aa095
MD5 e3f3c542826ae0d6137e7637ae787146
BLAKE2b-256 41d27b9593e39bb9c147884f3256bc3fff1837d2dbd7abd2ff6481aeb49dfd33

See more details on using hashes here.

Provenance

The following attestation bundles were made for strip_marks-1.0.1.tar.gz:

Publisher: ci.yml on jakewilliami/strip-marks-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for strip_marks-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ada97efe5aa90ebbdff826bbf3fdc2831ebc29831dfa2056a1a90f55145173e
MD5 00bf93a3d58e46904b3d33b1dc37f9d6
BLAKE2b-256 625ba0872e83dc3e8133ca1e60b1608ddb734ec309a6ae410d4e03544b42db85

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page