Python stringprep Module
Example
Check if a character is in ASCII range:
import stringprep
char = 'A'
result = stringprep.in_table_a1(char)
print(f'Character "{char}" is unassigned: {result}')
Try it Yourself »
Definition and Usage
The stringprep module provides data tables and algorithms for preparing Unicode strings for internet protocols.
Use it to normalize and validate strings for use in domain names (IDNA), usernames, and other protocol identifiers.
Members
Member | Description |
---|---|
in_table_a1() | Check if character is in unassigned table. |
in_table_b1() | Check if character is in map to nothing table. |
in_table_c11() | Check if character is in ASCII space characters table. |
in_table_c12() | Check if character is in non-ASCII space characters table. |
in_table_c21() | Check if character is in ASCII control characters table. |
in_table_c22() | Check if character is in non-ASCII control characters table. |
in_table_d1() | Check if character has bidirectional property. |
in_table_d2() | Check if character has bidirectional property. |
map_table_b2() | Map characters to lowercase using case folding. |
map_table_b3() | Map characters with normalization. |