Skip to main content

stringcase

Convert string cases between camel case, pascal case, snake case etc…

pypi_version_badge

About this fork

This is a manually created fork of the original stringcase by Taka Okunishi (@okunishinishi), intended to:

  • Fix failing tests

  • Modernize and simplify the packaging setup

  • Distribute a wheel on PyPI

Commits and merges from the original repository that were made after the last release have been moved onto a separate branch, and will be cherry-picked in as appropriate - where they actually fix bugs or move the project in the direction I intend.

Version numbers continue where the original left off, so that maintainers only need to change stringcase to stringcase-new in their pyproject.toml, requirements.txt etc. files.

The code continues to be available under an MIT license.

No meaningful new functionality is introduced, and the bugfixes are straightforward, so I assert no additional copyright.

This fork was prompted by recent ecosystem breakage resulting from the breaking change in Setuptools 78, which affected many users of this previously source-only project. Providing a wheel also greatly speeds up installation.

– Your humble maintainer, Karl Knechtel (@zahlman).

Usage

import stringcase
stringcase.camelcase('foo_bar_baz') # => "fooBarBaz"
stringcase.camelcase('FooBarBaz') # => "fooBarBaz"
stringcase.capitalcase('foo_bar_baz') # => "Foo_bar_baz"
stringcase.capitalcase('FooBarBaz') # => "FooBarBaz"
stringcase.constcase('foo_bar_baz') # => "FOO_BAR_BAZ"
stringcase.constcase('FooBarBaz') # => "_FOO_BAR_BAZ"
stringcase.lowercase('foo_bar_baz') # => "foo_bar_baz"
stringcase.lowercase('FooBarBaz') # => "foobarbaz"
stringcase.pascalcase('foo_bar_baz') # => "FooBarBaz"
stringcase.pascalcase('FooBarBaz') # => "FooBarBaz"
stringcase.pathcase('foo_bar_baz') # => "foo/bar/baz"
stringcase.pathcase('FooBarBaz') # => "/foo/bar/baz"
stringcase.sentencecase('foo_bar_baz') # => "Foo bar baz"
stringcase.sentencecase('FooBarBaz') # => "Foo bar baz"
stringcase.snakecase('foo_bar_baz') # => "foo_bar_baz"
stringcase.snakecase('FooBarBaz') # => "foo_bar_baz"
stringcase.spinalcase('foo_bar_baz') # => "foo-bar-baz"
stringcase.spinalcase('FooBarBaz') # => "-foo-bar-baz"
stringcase.titlecase('foo_bar_baz') # => "Foo Bar Baz"
stringcase.titlecase('FooBarBaz') # => " Foo Bar Baz"
stringcase.trimcase('foo_bar_baz') # => "foo_bar_baz"
stringcase.trimcase('FooBarBaz') # => "FooBarBaz"
stringcase.uppercase('foo_bar_baz') # => "FOO_BAR_BAZ"
stringcase.uppercase('FooBarBaz') # => "FOOBARBAZ"
stringcase.alphanumcase('_Foo., Bar') # =>'FooBar'
stringcase.alphanumcase('Foo_123 Bar!') # =>'Foo123Bar'

Install

Because I do not own the original PyPI project, a new PyPI name is required:

$ pip install stringcase-new

License

This software is released under the MIT License.

Metadata

Release files for stringcase-new 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stringcase-new 1.2.2
File Size Uploaded Provenance Actions
stringcase_new-1.2.2.tar.gz 3.7 kB Without provenance Details for stringcase_new-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stringcase-new 1.2.2
File Interpreter ABI Platform Actions
stringcase_new-1.2.2-py2.py3-none-any.whl Python 3, Python 2 none any Details for stringcase_new-1.2.2-py2.py3-none-any.whl

Total release size: 7.8 kB

Release files / stringcase_new-1.2.2.tar.gz

Download URL stringcase_new-1.2.2.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ea2df5aedd49b707a4d6dae416f27ec434a0b9d2bc76ee832d4795264bbfee3c
BLAKE2b-256 checksum
How to use checksums
90d822eef37383cc71fba106c28d85a9eddcdba7fed238c09e34ce722fab4bc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / stringcase_new-1.2.2-py2.py3-none-any.whl

Download URL stringcase_new-1.2.2-py2.py3-none-any.whl
Size 4.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
be4a6137604355d527c80f310a8e638cf29d7016e8ff6d3ed0446e6483cf7c49
BLAKE2b-256 checksum
How to use checksums
1ab4c2f4b36159a6a19dad36666d03afda85f58e416efcd77455d3cbd910c600
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for stringcase-new 1.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page