Text Processing in Python

15 projects in Text & Documents. Most starred: rapidfuzz, ftfy and sqlparse.

Text from the outside world often arrives in an unknown or broken encoding. charset-normalizer and chardet detect the encoding of raw bytes (Requests uses charset-normalizer), and ftfy repairs mojibake and other Unicode damage after decoding. For comparing strings, RapidFuzz computes fuzzy similarity scores quickly with a C++ core, while the standard library's difflib computes diffs and similarity ratios without dependencies but more slowly.

For structured text, pyparsing and parsy build parsers from small combinable pieces in plain Python, sqlparse splits and formats SQL, phonenumbers parses and validates international phone numbers, and Pygments highlights source code in many languages. Babel formats dates, numbers and currencies by locale and manages translation catalogs. python-slugify and Unidecode turn Unicode text into ASCII for URLs and identifiers, and shortuuid creates short, URL-safe unique IDs.

Encoding and Unicode3

charset-normalizer

Universal character encoding detector, and a dependency of requests.

805updated 4d ago3.5.2

chardet

Python character encoding detector.

2.7kupdated today7.7.0

ftfy

Makes Unicode text less broken and more consistent automagically.

4.1kupdated 1y ago6.3.1

Fuzzy Matching1

rapidfuzz

Rapid fuzzy string matching using various string metrics, with a C++ core.

4.2kupdated 3d ago3.14.6-1

General2

difflibStandard library

Helpers for computing deltas.

pyfiglet

An implementation of figlet written in Python.

1.6kupdated 2mo ago1.0.4

Internationalization1

babel

An internationalization library for Python.

1.5kupdated 6d ago2.18.0

Parser5

pygments

A generic syntax highlighter.

2.2kupdated 27d ago2.21.0

pyparsing

A Python library for creating PEG parsers.

2.5kupdated 6d ago3.3.3

sqlparse

A non-validating SQL parser.

4kupdated 2mo ago

phonenumbers

Parsing, formatting, storing and validating international phone numbers.

3.8kupdated 16d ago

parsy

Easy, generic parser combinator library for creating parsers.

455updated 17d ago

Transliteration and Slugs2

python-slugify

A Python slugify library that translates unicode to ASCII.

1.6kupdated 8d ago9.1.3

unidecode

ASCII transliterations of Unicode text.

611updated 9mo ago

Unique identifiers1

shortuuid

A generator library for concise, unambiguous and URL-safe UUIDs.

2.2kupdated 13d ago1.0.0
Esc

Type to search every entry. ↑↓ to move, Enter to open.