I am really impressed by how thoroughly this library thinks through all the applications and edge cases of text casing.
On a recent project I spent about an hour trying to do something similar (and far less sophisticated) before I realized it was a problem I had no desire in really solving, so I backed out all my changes and just went with string.capitalize(), even though it didn’t really do what I was looking for. Looking forward to using this instead!
Thank you for the kind words! I'm glad you appreciate the effort put into covering all those edge cases.
It sounds like you had quite the adventure with text casing on your project. I'm happy this library can save you some time and hassle. Looking forward to see what can be built with it!
I might be jaded, but I think having libraries for such simple use cases leads to the inevitable `left-pad` situation.
When I say simple use cases I mean that since you probably don't need all of these functions at once that it would be easier to copy the code you need if you don't feel comfortable writing it instead of adding yetanotherlibrary to your dependency tree.
I understand your perspective, and it's a valid concern. However, this library is designed to support not only simple use cases but also more advanced scenarios, providing a comprehensive solution for various needs. Additionally, it has zero dependencies, which helps keep your project lightweight. This way, you can benefit from the library's features without adding unnecessary complexity to your dependency tree. Thank you for sharing your thoughts!
You can always just take the code and put it in your app. Having libraries like these don't force you to add them as a dependency. Assuming the right OSS license.
That's a great observation! Instead of seeing it as a limitation, it can be treated as a feature. Users can handle Unicode normalization using Python's built-in unicodedata module to ensure proper case conversion. Thanks for pointing that out!
Thank you for the clarification! I appreciate your input. I've updated the wording to "feature-rich" to better convey the intended meaning. Your feedback is valuable!
It does not support non-English title casing. From the documentation:
> It also works non-ascii characters. However, no inferences on the language itself is made. For instance, the digraph ij in Dutch will not be capitalized, because it is represented as two distinct Unicode characters. However, æ would be capitalized
In the case of a conversion target that has delimiters (snake, kebab) it might be nice to have an alternative option to preserve such features but normalise them to the target delimiter
Thank you for your suggestion! Adding a preserve option to maintain leading, trailing, and duplicate delimiters while normalizing them to the target delimiter is a great idea. I’ll consider implementing this feature. Thanks again!
Definitely something to be championed, although I suspect this is a matter of perspective. I find Python packages to have refreshingly few dependencies compared to packages in the JS ecosystem, although compared to the Swift ecosystem which I’m somewhat familiar with, they do tend to have a few more.
twalkz|11 months ago
On a recent project I spent about an hour trying to do something similar (and far less sophisticated) before I realized it was a problem I had no desire in really solving, so I backed out all my changes and just went with string.capitalize(), even though it didn’t really do what I was looking for. Looking forward to using this instead!
zobweyt|11 months ago
It sounds like you had quite the adventure with text casing on your project. I'm happy this library can save you some time and hassle. Looking forward to see what can be built with it!
lnenad|11 months ago
When I say simple use cases I mean that since you probably don't need all of these functions at once that it would be easier to copy the code you need if you don't feel comfortable writing it instead of adding yetanotherlibrary to your dependency tree.
zobweyt|11 months ago
7bit|11 months ago
fake-name|11 months ago
Considering it supports unicode input, I somehow doubt that. Given that there's no mention of unicode normalization it'll likely break some strings.
zobweyt|11 months ago
re|11 months ago
I suspect you mean "featureful", "full-featured" or similar[1]—"feature complete" means that you're not going to add any more features.
[1] https://english.stackexchange.com/questions/393517/what-do-y...
zobweyt|11 months ago
frizlab|11 months ago
Does it support non-English title casing?
For instance in French, title casing for “les maisons bleues” is “Les Maisons bleues” while for “des maisons bleues” it’s “Des maisons bleues”.
zobweyt|11 months ago
It does not support non-English title casing. From the documentation:
> It also works non-ascii characters. However, no inferences on the language itself is made. For instance, the digraph ij in Dutch will not be capitalized, because it is represented as two distinct Unicode characters. However, æ would be capitalized
anentropic|11 months ago
My only suggestion is here:
> It also ignores any leading, trailing, or duplicate delimiters:
In the case of a conversion target that has delimiters (snake, kebab) it might be nice to have an alternative option to preserve such features but normalise them to the target delimiteri.e.
zobweyt|11 months ago
kianN|11 months ago
Python packages seem to often rope in a surprising number of dependencies for relatively limited libraries.
I can easily imagine pulling this package into my work: thank you for keeping the requirements to a minimum!
danpalmer|11 months ago
zobweyt|11 months ago
This library actually has zero dependencies! I'm glad you appreciate the no-dependency design.
It's great to hear that it fits well with your work!
cadamsdotcom|11 months ago
If only this comment supported case conversion..
In any case congrats on shipping!
zobweyt|11 months ago
Actually, this library supports conversion of even such strings!
```python
>>> import textcase
>>> textcase.convert("HAppY ApRiL FoOLs!", textcase.case.SNAKE, (textcase.boundary.SPACE,))
'happy_april_fools!'
```
Thanks for the congratulations!
wodenokoto|11 months ago
It also looks to be nice in exploratory data analysis:
zobweyt|11 months ago
marban|11 months ago
kseistrup|11 months ago
zobweyt|11 months ago
ilmasalsabil|11 months ago
[deleted]