Smart String implementation
Project description
Smart String
Smart String is a Python 2.7 library to correctly parse code points (Unicode symbols with assigned
numeric value) in the Unicode basic multilingual plane (BMP) or in the supplementary multilingual
planes, and to form characters that consist of more than one code point.
Using the Smart String Library
The Smart String library exposes 3 main classes - CodePoint
, SmartChar
, and SmartStr
.
The CodePoint
class represents a single Unicode code point, either in the BMP or in the supplementary
planes.
The SmartChar
class represents a single graphical character. It can consist of 1 code point (letter
in the English Alphabet), or 2 code points (national flag symbol).
The SmartStr
class represents a string containing a sequence of smart characters.
Running the example code
Go to the location of the example file in a terminal and run the example script.
cd <smart-string package location>/smart_str/example
python smart_str_example.py
Running the tests
To run the tests make sure that the pytest package is installed on your system.
Go to the location of the tests directory in a terminal and run the tests. You can run all the tests in
the tests directory, all the tests in a single module, or a single test in a module.
cd <smart-string package location>/smart_str/tests
pytest .
- Run all the tests in the tests directory.
pytest test_code_point.py
- Run all the tests in a single module.
pytest test_code_point.py::test_code_point_utf_8_four_bytes
- Run single test in a module.
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
Built Distribution
Hashes for smart_string-0.0.8-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a43df5fbf19c2ab8e5bdf21f3cff37e706a66d1b6dd949e465b08aeb5d798d2 |
|
MD5 | 3d7ca10116a574c7ee0f6e171cb833fd |
|
BLAKE2b-256 | 4f64366d7166c5bf6a3538a1f4c662553d7a9d0a80365d73c1422a229234e483 |