Skip to main content

string utilities

Project description

Build downloads license version PEP8

A bunch of useful functions for string manipulation.

Install (automatic)

$ pip install silex

Install (manual)

$ git clone
$ cd silex
$ python setup.py install

Usage

In [1]: from silex import *

In [2]: print chop("whitespace", 5)
['white', 'space', '']

In [3]: print numberex('1.2euros')
1.2

In [4]: print surround('b', '<', '>')
<b>

In [5]: print strip_html('<p><i>hello</i></p>')
hello

In [6]: print unslugify('sex_appeal')
sex appeal

In [7]: print slugify(u'je suis\ épuisé')
je-suis-epuise

In [8]: print clean('hello\n    word\n')
hello word

In [9]: print kebabcase('hello  world')
hello-world

In [10]: print pascalcase('hello world')
HelloWorld

In [11]: print camelcase('hello world')
helloWorld

In [12]: print snakecase('hello world')
hello_world

License

MIT

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

silex-0.2.0.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file silex-0.2.0.tar.gz.

File metadata

  • Download URL: silex-0.2.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for silex-0.2.0.tar.gz
Algorithm Hash digest
SHA256 46367970c86641af4f8a19064a39196e060dd73ec1a3c4d2eadeb86d5d1cddec
MD5 78960c06eec4d74a8e9fe733af3b3f44
BLAKE2b-256 4372c7bf23ef4f178e8d05066ecca7b3dc3b7313b6e86964cc9c743d77e652e2

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