Slender datastructures in Python for efficient work!
Project description
Slender
Slender provides chainable, type-safe, enhanced datastructures over the well-known built-ins.
- List is an enhanced list having all the functionalities that the basic
list
buitl-in type does but extended with a lot of useful functions. - Set is a superset of the built-in one, works as the general
set
type but it does a lot more that. - Dictionary is a key-value pair container, like
dict
, which is built with heavy functionalities. - Tuple is a finate ordered list over the built-in
tuple
.
Install
pip install slender
Usage
from slender import List, Set print(List([1, 2, 3, 4, 5]) \ .delete_if(lambda x: x % 2 == 0) \ .map(lambda x: x * 2) \ .chain(['a', 'b']) \ .each_with_index() \ .to_list()) # => [[0, 2], [1, 6], [2, 10], [3, 'a'], [4, 'b]] print((Set({1, 2, 2, 3, 6, 7, 8}) \ .subtract(Set({3, 5, 10})) \ .select(lambda x: x % 2 == 0) \ << 4 \ << 5 \ ).map(lambda x: x * 2)) # => {4, 8, 10, 12, 16}
Documentation
For further information, read the documentation that can be found: https://slender.readthedocs.io
Contribution
- Fork it!
- Make your changes!
- Send a PR!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size slender-2.0.2.tar.gz (10.6 kB) | File type Source | Python version None | Upload date | Hashes View |