ynput / ayon-python-api

Apache License 2.0
9 stars 3 forks source link

General: Slugify string helper #5

Closed iLLiCiTiT closed 1 year ago

iLLiCiTiT commented 1 year ago

Description

Names of entities in database are strict and limited to spefic characters. Added new function slugify_string which converts unicode strings to ascii and replace special characters with unified separator.

Detailed description

Added new dependency unidecode which is used to convert unicode string to ascii (Documentation). The dependency handles non-ascii characters (e.g. ř -> r). The slugify_string function then replace secial characters like ;"'|,./ etc. with separator (can be defined in arguments of function).