case-switcher


Namecase-switcher JSON
Version 1.3.13 PyPI version JSON
download
home_pagehttps://gitlab.com/mburkard/case-switcher
SummaryLibrary to change the casing of strings.
upload_time2023-06-13 22:33:20
maintainer
docs_urlNone
authorMatthew Burkard
requires_python>=3.9,<4.0
licenseMIT
keywords string string manipulation case convention camel case dot case kebab case pascal case snake case title case
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align=center>
<!-- Title: -->
  <h1>Case Switcher</h1>
  <h3>Change the casing of a string.</h3>
<!-- Labels: -->
  <!-- First row: -->
  <img src="https://img.shields.io/badge/license-MIT-green"
   height="20"
   alt="License: MIT">
  <img src="https://img.shields.io/badge/code%20style-black-000000.svg"
   height="20"
   alt="Code style: black">
  <img src="https://img.shields.io/pypi/v/case-switcher.svg"
   height="20"
   alt="PyPI version">
  <img src="https://img.shields.io/badge/coverage-100%25-success"
   height="20"
   alt="Code Coverage">
</div>

This library provides functions to change the casing convention of a string.

Supported cases:

- camelCase
- dot.case
- kebab-case
- PascalCase
- path/case
- snake_case
- Title Case
- UPPER.DOT.CASE
- UPPER-KEBAB-CASE
- UPPER_SNAKE_CASE

### Install

```shell
poetry add case-switcher
```

```shell
pip install case-switcher
```

### Demo

```python
import caseswitcher

sample = "avocado bagel-coffeeDONUTEclair_food.gravy"

caseswitcher.to_camel(sample)  # -> "avocadoBagelCoffeeDONUTEclairFoodGravy"
caseswitcher.to_dot(sample)  # -> "avocado.bagel.coffee.donut.eclair.food.gravy"
caseswitcher.to_kebab(sample)  # -> "avocado-bagel-coffee-donut-eclair-food-gravy"
caseswitcher.to_pascal(sample)  # -> "AvocadoBagelCoffeeDONUTEclairFoodGravy"
caseswitcher.to_path(sample)  # -> "avocado/bagel/coffee/donut/eclair/food/gravy"
caseswitcher.to_snake(sample)  # -> "avocado_bagel_coffee_donut_eclair_food_gravy"
caseswitcher.to_title(sample)  # -> "Avocado Bagel Coffee DONUT Eclair Food Gravy"
# Deprecated, use `to_dot(sample).upper()` instead.
caseswitcher.to_upper_dot(sample)  # -> "AVOCADO.BAGEL.COFFEE.DONUT.ECLAIR.FOOD.GRAVY"
# Deprecated, use `to_kebab(sample).upper()` instead.
caseswitcher.to_upper_kebab(sample)  # -> "AVOCADO-BAGEL-COFFEE-DONUT-ECLAIR-FOOD-GRAVY"
# Deprecated, use `to_snake(sample).upper()` instead.
caseswitcher.to_upper_snake(sample)  # -> "AVOCADO_BAGEL_COFFEE_DONUT_ECLAIR_FOOD_GRAVY"
```

## Support The Developer

<a href="https://www.buymeacoffee.com/mburkard" target="_blank">
  <img src="https://cdn.buymeacoffee.com/buttons/v2/default-blue.png"
       width="217"
       height="60"
       alt="Buy Me A Coffee">
</a>

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/mburkard/case-switcher",
    "name": "case-switcher",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "string,string manipulation,case convention,camel case,dot case,kebab case,pascal case,snake case,title case",
    "author": "Matthew Burkard",
    "author_email": "matthewjburkard@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/98/eb/e14630681b062aa9a50f3f2f7b8d454cddbae22c7e97110368ecc96aa835/case-switcher-1.3.13.tar.gz",
    "platform": null,
    "description": "<div align=center>\n<!-- Title: -->\n  <h1>Case Switcher</h1>\n  <h3>Change the casing of a string.</h3>\n<!-- Labels: -->\n  <!-- First row: -->\n  <img src=\"https://img.shields.io/badge/license-MIT-green\"\n   height=\"20\"\n   alt=\"License: MIT\">\n  <img src=\"https://img.shields.io/badge/code%20style-black-000000.svg\"\n   height=\"20\"\n   alt=\"Code style: black\">\n  <img src=\"https://img.shields.io/pypi/v/case-switcher.svg\"\n   height=\"20\"\n   alt=\"PyPI version\">\n  <img src=\"https://img.shields.io/badge/coverage-100%25-success\"\n   height=\"20\"\n   alt=\"Code Coverage\">\n</div>\n\nThis library provides functions to change the casing convention of a string.\n\nSupported cases:\n\n- camelCase\n- dot.case\n- kebab-case\n- PascalCase\n- path/case\n- snake_case\n- Title Case\n- UPPER.DOT.CASE\n- UPPER-KEBAB-CASE\n- UPPER_SNAKE_CASE\n\n### Install\n\n```shell\npoetry add case-switcher\n```\n\n```shell\npip install case-switcher\n```\n\n### Demo\n\n```python\nimport caseswitcher\n\nsample = \"avocado bagel-coffeeDONUTEclair_food.gravy\"\n\ncaseswitcher.to_camel(sample)  # -> \"avocadoBagelCoffeeDONUTEclairFoodGravy\"\ncaseswitcher.to_dot(sample)  # -> \"avocado.bagel.coffee.donut.eclair.food.gravy\"\ncaseswitcher.to_kebab(sample)  # -> \"avocado-bagel-coffee-donut-eclair-food-gravy\"\ncaseswitcher.to_pascal(sample)  # -> \"AvocadoBagelCoffeeDONUTEclairFoodGravy\"\ncaseswitcher.to_path(sample)  # -> \"avocado/bagel/coffee/donut/eclair/food/gravy\"\ncaseswitcher.to_snake(sample)  # -> \"avocado_bagel_coffee_donut_eclair_food_gravy\"\ncaseswitcher.to_title(sample)  # -> \"Avocado Bagel Coffee DONUT Eclair Food Gravy\"\n# Deprecated, use `to_dot(sample).upper()` instead.\ncaseswitcher.to_upper_dot(sample)  # -> \"AVOCADO.BAGEL.COFFEE.DONUT.ECLAIR.FOOD.GRAVY\"\n# Deprecated, use `to_kebab(sample).upper()` instead.\ncaseswitcher.to_upper_kebab(sample)  # -> \"AVOCADO-BAGEL-COFFEE-DONUT-ECLAIR-FOOD-GRAVY\"\n# Deprecated, use `to_snake(sample).upper()` instead.\ncaseswitcher.to_upper_snake(sample)  # -> \"AVOCADO_BAGEL_COFFEE_DONUT_ECLAIR_FOOD_GRAVY\"\n```\n\n## Support The Developer\n\n<a href=\"https://www.buymeacoffee.com/mburkard\" target=\"_blank\">\n  <img src=\"https://cdn.buymeacoffee.com/buttons/v2/default-blue.png\"\n       width=\"217\"\n       height=\"60\"\n       alt=\"Buy Me A Coffee\">\n</a>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Library to change the casing of strings.",
    "version": "1.3.13",
    "project_urls": {
        "Homepage": "https://gitlab.com/mburkard/case-switcher",
        "Repository": "https://gitlab.com/mburkard/case-switcher"
    },
    "split_keywords": [
        "string",
        "string manipulation",
        "case convention",
        "camel case",
        "dot case",
        "kebab case",
        "pascal case",
        "snake case",
        "title case"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e7a5b52b6fef17c619734aea142ef8890bc9befee621edec2387d482eeaa27a1",
                "md5": "ec235b9995df14e714c3c513aa076f63",
                "sha256": "564e5dba2062e38862d1766187446362bbdaf9fe80eac9675757310d190712ca"
            },
            "downloads": -1,
            "filename": "case_switcher-1.3.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ec235b9995df14e714c3c513aa076f63",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 4037,
            "upload_time": "2023-06-13T22:33:22",
            "upload_time_iso_8601": "2023-06-13T22:33:22.360177Z",
            "url": "https://files.pythonhosted.org/packages/e7/a5/b52b6fef17c619734aea142ef8890bc9befee621edec2387d482eeaa27a1/case_switcher-1.3.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98ebe14630681b062aa9a50f3f2f7b8d454cddbae22c7e97110368ecc96aa835",
                "md5": "bdff4760bf4b0aad2546bbead4082792",
                "sha256": "e8c9df5437ac58aa396617bde347093a025812b77fd73fa48439c3d4ae8294c8"
            },
            "downloads": -1,
            "filename": "case-switcher-1.3.13.tar.gz",
            "has_sig": false,
            "md5_digest": "bdff4760bf4b0aad2546bbead4082792",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 4056,
            "upload_time": "2023-06-13T22:33:20",
            "upload_time_iso_8601": "2023-06-13T22:33:20.217663Z",
            "url": "https://files.pythonhosted.org/packages/98/eb/e14630681b062aa9a50f3f2f7b8d454cddbae22c7e97110368ecc96aa835/case-switcher-1.3.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-13 22:33:20",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "mburkard",
    "gitlab_project": "case-switcher",
    "lcname": "case-switcher"
}
        
Elapsed time: 1.69781s