Skip to main content

Provides alternative string methods to Python's built-in upper(), lower(), capitalize() and title() that work for turkish characters.

Project description

turkish-string

Provides alternative string methods to Python's built-in upper(), lower(), capitalize() and title() that work for turkish characters.

Description

While working with Turkish strings some of the Python's built-in string methods does not work as expected. Especially Turkish characters İ, I, i and ı won't correctly be translated to lower and upper case versions.

turkish-string package provides alternative methods that solve this problem.

Requirements

This package is tested with Python>=3.8 versions.

Installation

pip install turkish-string

Usage

To upper case

from turkish_string import upper_tr

string = 'istanbul Kadıköy'

upper_case = upper_tr(string)

print(upper_case)

İSTANBUL KADIKÖY

To lower case

from turkish_string import lower_tr

string = 'İSTANBUL KADIKÖY'

lower_case = lower_tr(string)

print(lower_case)

istanbul kadıköy

Title

from turkish_string import title_tr

string = 'istanbul kadıköy'

titled = title_tr(string)

print(titled)

İstanbul Kadıköy

Capitalize

from turkish_string import capitalize_tr

string = 'istanbul kadıköy'

capitalized = capitalize_tr(string)

print(capitalized)

İstanbul kadıköy

License

Distributed under the BSD License. See LICENSE for more information.

Contact

Omer Faruk Sari - info@aqilan.com

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

turkish_string-1.0.0.tar.gz (5.0 kB view hashes)

Uploaded Source

Built Distribution

turkish_string-1.0.0-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page