
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
CleverTitle is a Python function designed to transform strings into flexible title case format while excluding specified words from capitalization. This simple yet powerful tool supports various input styles and offers unmatched flexibility for users with diverse formatting needs.
from clevertitle import CleverTitle
formatter = CleverTitle("the")
result = formatter.to_clever_title_case("the quick brown fox jumps over the lazy dog")
print(result) # Output: "The Quick Brown Fox Jumps Over The Lazy Dog"
formatter = CleverTitle("the", "over", "jumps")
result = formatter.to_clever_title_case("the quick brown fox jumps over the lazy dog")
print(result) # Output: "The Quick Brown Fox Jumps over the Lazy Dog"
formatter = CleverTitle(["the", "over", "quick"])
result = formatter.to_clever_title_case("the quick brown fox jumps over the lazy dog")
print(result) # Output: "The quick Brown Fox Jumps over the Lazy Dog"
formatter = CleverTitle(["the", "over"], "jumps")
result = formatter.to_clever_title_case("the quick brown fox jumps over the lazy dog")
print(result) # Output: "The Quick Brown Fox jumps over the Lazy Dog"
formatter = CleverTitle()
result = formatter.to_clever_title_case("the quick brown fox jumps over the lazy dog")
print(result) # Output: "The Quick Brown Fox Jumps Over The Lazy Dog"
formatter = CleverTitle("brown over quick")
result = formatter.to_clever_title_case("the quick brown fox jumps over the lazy dog")
print(result) # Output: "The quick brown Fox Jumps over The Lazy Dog"
formatter = CleverTitle("ThE", "OVer", "QUICK")
result = formatter.to_clever_title_case("the quick brown fox jumps over the lazy dog")
print(result) # Output: "The quick Brown Fox Jumps over the Lazy Dog"
formatter = CleverTitle("the", "and")
result = formatter.to_clever_title_case("and then there was light")
print(result) # Output: "And Then There Was Light"
formatter = CleverTitle("the")
result = formatter.to_clever_title_case("fox")
print(result) # Output: "Fox"
formatter = CleverTitle("the")
result = formatter.to_clever_title_case("")
print(result) # Output: ""
exclusions = ["the", "over", "and", "a", "of", "in", "to", "on"]
formatter = CleverTitle(*exclusions)
text = "the history of art in the renaissance and its impact on society"
result = formatter.to_clever_title_case(text)
print(result) # Output: "The History of Art in the Renaissance and Its Impact on Society"
CleverTitle(*exclusions)
str
, list
, or multiple strings): Words to exclude from capitalization.to_clever_title_case(text)
str
): The input string to format.This project is licensed under the MIT License.
FAQs
A simple function for flexible smart title case formatting
We found that clevertitle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.