A simple spin-syntax parser for Python
Project description
pyspinner is simple library for parsing text that uses spin-syntax.
Installation
To install pyspinner, simply:
$ pip install pyspinner
or download the source code and do:
$ python setup.py install
How to use it
>>> import spinning
>>> spinning.unique('The {quick|fast} {brown|gray|red} fox jumped over the lazy dog.')
'The quick gray fox jumped over the lazy dog.'
Running tests
$ python spinning-tests.py
....
----------------------------------------------------------------------
Ran 2 tests in 0.000s
OK
Features
Supports nested syntax.
Supports custom opening, closing and separator characters by using the override_params function.
TO-DO
Allow optional phrases: The quick{ red|} fox...
Allow special characters {,|,} inside text by escaping them.
Write more tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
pyspinner-0.1.0.zip
(4.8 kB
view details)
pyspinner-0.1.0.tar.gz
(3.4 kB
view details)
File details
Details for the file pyspinner-0.1.0.zip
.
File metadata
- Download URL: pyspinner-0.1.0.zip
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa8c3073faebf54ceecda0ce15cfa7b8b92f8e1df63a6fe92131cad8d97e39fa |
|
MD5 | 80bee67b4e92ae8e83d466f70b80ebfe |
|
BLAKE2b-256 | 128e21d30b3514b20944c165e674c1d194871254b42b92c2ce1b197d6c587e72 |
File details
Details for the file pyspinner-0.1.0.tar.gz
.
File metadata
- Download URL: pyspinner-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1c9cfb5a75fac78b7d3ba530247b4bbeb5c66d066adc5c864b016ee9d2a8d2 |
|
MD5 | 0cfa2dae28f09d0ec3dc6ce200d5d17d |
|
BLAKE2b-256 | 2eb2d2465523f3c9cc224d230b82fe48e1ad4b3bb7dc379ccc838e48f2de7e11 |