All Projects → btwael → Superstring.py

btwael / Superstring.py

Licence: mit
A fast and memory-optimized string library for heavy-text manipulation in Python

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Superstring.py

Portable Utf8
🉑 Portable UTF-8 library - performance optimized (unicode) string functions for php.
Stars: ✭ 405 (+75.32%)
Mutual labels:  string, string-manipulation
Cracking The Coding Interview
Solutions for Cracking the Coding Interview - 6th Edition
Stars: ✭ 35 (-84.85%)
Mutual labels:  string, string-manipulation
Stringplus
Funny and minimal string library for C++ inspired by underscore.string
Stars: ✭ 7 (-96.97%)
Mutual labels:  string, string-manipulation
stringext
Extra string functions for OCaml
Stars: ✭ 20 (-91.34%)
Mutual labels:  string, string-manipulation
Strtk
C++ String Toolkit Library
Stars: ✭ 113 (-51.08%)
Mutual labels:  string, string-manipulation
safe-string-interpolation
A type driven approach to string interpolation, aiming at consistent, secure, and only-human-readable logs and console outputs !
Stars: ✭ 14 (-93.94%)
Mutual labels:  string, string-manipulation
Util
A collection of useful utility functions
Stars: ✭ 201 (-12.99%)
Mutual labels:  string, string-manipulation
vbml
Way to check, match and resist.
Stars: ✭ 27 (-88.31%)
Mutual labels:  string, string-manipulation
Strman Java
A Java 8 string manipulation library.
Stars: ✭ 1,362 (+489.61%)
Mutual labels:  string, string-manipulation
Tinystr
A small ASCII-only bounded length string representation.
Stars: ✭ 48 (-79.22%)
Mutual labels:  optimization, string
normalize-text
📝 Provides a simple API to normalize texts, whitespaces, paragraphs & diacritics.
Stars: ✭ 54 (-76.62%)
Mutual labels:  string, string-manipulation
Voca rs
Voca_rs is the ultimate Rust string library inspired by Voca.js, string.py and Inflector, implemented as independent functions and on Foreign Types (String and str).
Stars: ✭ 167 (-27.71%)
Mutual labels:  string, string-manipulation
split-on-first
Split a string on the first occurrence of a given separator
Stars: ✭ 68 (-70.56%)
Mutual labels:  string, string-manipulation
Tiny Utf8
Unicode (UTF-8) capable std::string
Stars: ✭ 322 (+39.39%)
Mutual labels:  string, string-manipulation
node-red-contrib-string
Provides a string manipulation node with a chainable UI based on the concise and lightweight stringjs.com.
Stars: ✭ 15 (-93.51%)
Mutual labels:  string, string-manipulation
Mightystring
Making Ruby Strings Powerful
Stars: ✭ 28 (-87.88%)
Mutual labels:  string, string-manipulation
Superstring
A fast and memory-optimized string library for C++
Stars: ✭ 252 (+9.09%)
Mutual labels:  optimization, string
Litestringbuilder
Alternative to the System.Text.StringBuilder C# class.
Stars: ✭ 48 (-79.22%)
Mutual labels:  string, string-manipulation
Androidlibrary
Android library to reveal or obfuscate strings and assets at runtime
Stars: ✭ 162 (-29.87%)
Mutual labels:  string, string-manipulation
Str
A fast, solid and strong typed string manipulation library with multibyte support
Stars: ✭ 199 (-13.85%)
Mutual labels:  string, string-manipulation

superstring.py

superstring.py is an efficient library for heavy-text manipulation in Python, that achieves a remarkable memory and CPU optimization.

superstring.py uses Rope (data structure) and optimization techniques.

Performance example

alt text

The two plots show the comparison in terms of memory consumption and execution time between superstring.py and python build-in string (the comparison program consists of appending to a list all possible substrings of a 50000 bytes text).

Features

  • Fast and Memory-optimized.
  • Rich API.
  • Similar functionalities to python built-in string
  • Easy to embed and use.
  • MIT Licence

Installing

pip install superstring

How to use

from superstring import SuperString

string1 = SuperString("  This is ")
string2 = SuperString("SuperString!  ")

# concatenation
string = string1 + string2 # "  This is SuperString!  "

# print
print(string)

# length
len(string)
string.length()

# character
string[10] # "S"
string.characterAt(10) # "S"

# substring
string[10:21] # "SuperString"
string.substring(10, 21) # "SuperString"

# strip
string.strip() # "This is SuperString!"

# lower
string.lower() # "  this is superstring!  "

# upper
string.upper() # "  THIS IS SUPERSTRING!  "

Roadmap

  • [ ] Optimize even more (I think it's possible 😎)
  • [x] Support for negative indexing
  • [ ] More benchmark and memory profiling

Contribute and support

You have any feature idea, a bug to correct or an improvement, feel free to open a issue or send your pull request. You can also support the author of superstring.py via Paypal.

LICENCE

MIT LICENCE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].