GithubHelp home page GithubHelp logo

o-sari / turkish-string Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 6 KB

Python module for solving Turkish character problems when using string methods upper(), lower(), capitalize() and title()

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

turkish-string's Introduction

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 - [email protected]

turkish-string's People

Contributors

o-sari avatar

Stargazers

 avatar Roman avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.