titlize/untitlize
from namae import titlize, untitlize
assert titlize("foo") == "Foo"
assert untitlize("Foo") == "foo"
pascalcase/camelcase/snakecase/kebabcase
assert pascalcase("foo-bar") == "FooBar"
assert camelcase("foo-bar") == "fooBar"
assert snakecase("IpAddress") == "ip_address"
assert snakecase("IPAddress") == "ip_address"
assert kebabcase("IPAddress") == "ip-address"
assert lispcase("IPAddress") == "ip-address"
normalize
from namae import normalize
# hyphen
assert normalize("foo-bar") == "foo_bar"
# invalid prefix
assert normalize("foo123") == "foo123"
assert normalize("123foo") == "n123foo"
assert normalize("+1") == "x1"
assert normalize("-1") == "x_1"
# python's keyword
assert normalize("while") == "while_"
assert normalize("def") == "def_"
appendix
goname
from namae.go import goname
assert goname("foo-bar-boo") == 'FooBarBoo'
assert goname("foo_bar_boo") == 'FooBarBoo'
assert goname("api") == 'API'
assert goname("id") == 'ID'
assert goname("fooid") == 'Fooid'
assert goname("foo_id") == 'FooID'
assert goname("1times") == 'OneTimes'
assert goname("9times") == 'NineTimes'
assert goname("10times") == 'Num10Times'
Release files for namae 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| namae-0.1.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| namae-0.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 7.4 kB
Release files / namae-0.1.tar.gz
| Download URL | namae-0.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
32bf4fcdb9f14a23fdf80ffbde557f257da76e5546891fa8880e23a926d7a952
|
|
BLAKE2b-256 checksum How to use checksums |
9f52c10f8645b35663394e304da6f2e6f8ea174369930af325896adecdd32bb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / namae-0.1-py2.py3-none-any.whl
| Download URL | namae-0.1-py2.py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
929aa6b6208f2728a7c154def0938385b79ff441ed8fb608dc8f784fd71d5617
|
|
BLAKE2b-256 checksum How to use checksums |
e91b29f6f2ae0e3b6a1579cb44e5c0ddc5c48463e13e306ee9e04056d47149d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |