Skip to main content

naming

Project description

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'

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

namae-0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

namae-0.1-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file namae-0.1.tar.gz.

File metadata

  • Download URL: namae-0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for namae-0.1.tar.gz
Algorithm Hash digest
SHA256 32bf4fcdb9f14a23fdf80ffbde557f257da76e5546891fa8880e23a926d7a952
MD5 e4861a5b2464b82f1ad5d3709769941a
BLAKE2b-256 9f52c10f8645b35663394e304da6f2e6f8ea174369930af325896adecdd32bb5

See more details on using hashes here.

File details

Details for the file namae-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for namae-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 929aa6b6208f2728a7c154def0938385b79ff441ed8fb608dc8f784fd71d5617
MD5 ab68f6eb66b1336601cd28e037602026
BLAKE2b-256 e91b29f6f2ae0e3b6a1579cb44e5c0ddc5c48463e13e306ee9e04056d47149d1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page