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 also implements (and uses internally) functions adapted from the utf8proc C library to handle characters of multiple codepoints. We also use bitwise functionality from our sister package, ispunct.

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.0.tar.gz (3.3 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.0-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file strip_marks-1.0.0.tar.gz.

File metadata

  • Download URL: strip_marks-1.0.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for strip_marks-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d8fbdbd4ef0eaf5dca340a5d7cba0aa6addf8ba95d7e3ba98baaded19645ad4d
MD5 417da531b82fc32d99ad6c2047525bf9
BLAKE2b-256 0135a05030f9c54837f416682d28c2a28dc6864f1992cdf2ff1ed10bea1341a2

See more details on using hashes here.

File details

Details for the file strip_marks-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: strip_marks-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for strip_marks-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 44f4e7e78d98c7bd012af9999d0bf2d602a7c4099da3e60f947b429b5b569741
MD5 0ea72beb5a405957eceb9790898be258
BLAKE2b-256 27bbfe021b068d6905dd361e893e419daf1745ecb0b9211fdf970c7bb3440871

See more details on using hashes here.

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