A Python port of the Apache Lucene ASCII Folding Filter, this library converts alphabetic, numeric, and symbolic Unicode characters outside the Basic Latin block into their ASCII equivalents if they exist. It's currently at version 1.0.2.post1 and is a stable, low-cadence utility library focused on character folding rather than full transliteration.
pip install fold-to-asciiVerified import paths — ran on the pinned version, not inferred.
Demonstrates the core functionality of `fold` for characters with and without direct ASCII equivalents, showing how non-folding characters are replaced with question marks.
Be aware of this substitution behavior. If preserving or explicitly handling non-folding characters is required, pre-process the string (e.g., remove them) or use a different library for broader transliteration needs.
Understand the distinction between ASCII folding and transliteration. For more comprehensive transliteration (e.g., '你好' to 'Ni Hao'), consider libraries like `unidecode` which offer broader character set mappings.
Add `from fold_to_ascii import fold` at the top of your script or module.
Ensure you pass a string to the function, e.g., `fold('your text here')`.Use `from fold_to_ascii import fold` and then call `fold('text')`, or if you prefer `import fold_to_ascii`, call it as `fold_to_ascii.fold('text')`.No dependency data recorded yet.