Skip to main content

Generate Python identifiers from English text

Project description

Generates Python identifiers from English text. Useful for code generation.

Class name:

>>> pydentifier.upper_camel("I'm a class", prefix='')
'IAmAClass'

Function name:

>>> pydentifier.lower_underscore('This is a function', prefix='')
'this_is_a_function'

Reserved keyword:

>>> pydentifier.lower_underscore('class', prefix='')
'class_'

Internal method:

>>> pydentifier.lower_underscore("Shouldn't touch this", prefix='_')
'_should_not_touch_this'

Private method:

>>> pydentifier.lower_underscore("Can't touch this", prefix='__')
'__cannot_touch_this'

Project details


Download files

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

Source Distribution

pydentifier-0.1.3.tar.gz (3.6 kB view hashes)

Uploaded Source

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