Skip to main content

Lightweight library written in idiomatic Python (no regular expressions), that aims to translate string into various typography conventions.

Project description

Typocase


Lightweight library written in idiomatic Python (no regular expressions), that aims to translate string into various typography conventions.

How it works

  • Accept any string as input.
  • Detect substrings based on special chars or uppercase letters as separators.
  • Join substrings based on the typography convention selected:
    • snake case
    • pascal case
    • camel case
    • kebab case
    • dot case
    • path case
    • ...

Install

Usage

>>> from typocase import TypoCase

>>> TypoCase("abc def ghi").snake_case()
'abc_def_ghi'

>>> TypoCase("abc def ghi").camel_case()
'abcDefGhi'

>>> TypoCase("abc def ghi").kebab_case()
'abc-def-ghi'

License

This software is released under the MIT LICENSE.

Author

Martin Tovmassian

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

typocase-0.1.tar.gz (371.9 kB view hashes)

Uploaded Source

Built Distribution

typocase-0.1-py2.py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 2 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