GlobalKit
Introduction
GlobalKit provides alphabets from different languages in different scripts.
Alphabets
GlobalKit contains lots of alphabets in supported languages:
- English
- Spanish
- French
- Dutch
- Portuguese
- Italian
- Finnish
- Swedish
- Norwegian
- Russian
- Ukrainian
- Polish
- Bulgarian
- digits
- brackets
All languages are instances of the Alphabet dataclass, so they all have these string representations:
full,full_lowercase,full_uppercasevowels,vowels_lowercase,vowels_uppercaseconsonants,consonants_lowercase,consonants_uppercasespecial,special_lowercase,special_uppercase
To verify the presence of special characters in a language, you can use:
has_special
If False, special, special_lowercase, special_uppercase will return None.
import GlobalKit as gk
print(gk.ENGLISH.full) # abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
print(gk.FRENCH.full_lowercase) # abcdefghijklmnopqrstuvwxyzàâçéèêëîïôùûüœ
print(gk.SPANISH.consonants_uppercase) # BCDFGHJKLMNÑPQRSTVWXYZ
print(gk.GERMAN.vowels) # aeiouäöüAEIOUÄÖÜ
print(gk.DIGITS) # 0123456789
print(gk.BRACKETS) # ()[]{}<>
print(gk.DUTCH.special) # None
print(gk.RUSSIAN.special_uppercase) # ЪЬ
print(gk.UKRAINIAN.has_special) # True
Creating Your Own Alphabet
You can also easily create your custom alphabet using the Alphabet dataclass.
If the language unique characters beyond traditional vowels or consonants, you can specify them separately at the end.
For example: "ьъ" in Russian.
from typing import Final
from GlobalKit import Alphabet
romanian: Final[Alphabet] = Alphabet('abcdefghijklmnopqrstuvwxyzăâîșț', 'aeiouyăâî', 'bcdfghjklmnpqrstvwxzșț')
print(romanian.full) # abcdefghijklmnopqrstuvwxyzăâîșțABCDEFGHIJKLMNOPQRSTUVWXYZĂÂÎȘȚ
String Manipulations
check(string, *alphabets) checks if string is present in any of the specified *alphabets.
The *alphabets must be of type Alphabet. The variables of this type can be also imported from GlobalKit.
is_contains_spaces(string) checks if string contains any spaces.
is_contains_numbers(string) checks if string contains any numbers.
is_contains_alphabetic(string) checks if string contains any alphabetic letters.
is_contains_lowercase(string) checks if string contains any lowercase letters.
is_contains_uppercase(string) checks if string contains any uppercase letters.
is_contains_special(string) checks if string contains any special characters.
from GlobalKit import check, ENGLISH, RUSSIAN, ITALIAN, UKRAINIAN
print(check('e', ENGLISH)) # True
print(check('1', ENGLISH, ITALIAN)) # False
print(check('h', RUSSIAN, UKRAINIAN)) # False
from GlobalKit import is_contains_spaces, is_contains_uppercase, is_contains_special
print(is_contains_spaces('Hello, world!')) # True
print(is_contains_uppercase('hello, world!')) # False
print(is_contains_special('Hello, world!')) # True
Contact
Metadata
Release files for GlobalKit 1.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| globalkit-1.8.tar.gz | 5.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| globalkit-1.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / globalkit-1.8.tar.gz
| Download URL | globalkit-1.8.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa2a270ea58da847e971599cafbfb81658af1e6bb255068d78e290c5d549b35d
|
|
BLAKE2b-256 checksum How to use checksums |
0e647c166703f6a9175e729f44cd716edc4bee2689556a81f6771dd0dbfb0b79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Release files / globalkit-1.8-py3-none-any.whl
| Download URL | globalkit-1.8-py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fd2dce35fb3451d707827416dd794ff8722acaeb6def15e28334fde040e4ff8a
|
|
BLAKE2b-256 checksum How to use checksums |
be1178fc9e40ff2284a9fcc310c44ce7a7bb0350170a74c0a0b81bb7f0b90428
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|