Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Convert strings to snakecase

Project description

PyPI CircleCI Codecov

Boa is a Python package for normalizing and converting strings to snakecase.

For example, it translates the user-defined event 'User Buys Item' to 'user_buys_item' which can then be used in a file path in S3, or as the name of a schema or table in Redshift.

It also handles the more complex cases such as stripping punctuation and converting words from camelCase or PascalCase to snake_case (see examples below).


Install in your virtual environment:

$ pip install boa-str


>>> import boa
>>> my_str = 'Hello Boa'
>>> boa.constrict(my_str)


>>> import boa
>>> boa.constrict('toInfinityAndBeyond')
>>> boa.constrict('Welcome-to-planet-Earth!')


We use nose2 and coverage for unit tests.

Install with test requirements:

$ pip install boa-str[test]

Then run:

$ invoke test


$ invoke lint


Clone the repo, then install with dev requirements which also includes test requirements:

$ git clone
$ cd boa
$ pip install .[dev]


Project details

Download files

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

Files for boa-str, version 1.1.0
Filename, size File type Python version Upload date Hashes
Filename, size boa_str-1.1.0-py2.py3-none-any.whl (4.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size boa-str-1.1.0.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page