跳转到主要内容

从英文文本生成Python标识符

项目描述

从英文文本生成Python标识符。适用于代码生成。

类名

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

函数名

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

保留关键字

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

内部方法

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

私有方法

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

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解有关安装包的更多信息。

源代码分发

pydentifier-0.1.3.tar.gz (3.6 kB 查看哈希值)

上传时间: 源代码

由以下支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面