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 py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page