Skip to main content

Slender datastructures in Python for efficient work!

Project description

Slender

Slender provides chainable, type-safe, enhanced datastructures over the well-known built-ins.

Build Status Documentation Status PyPI PyPI - Python Version PyPI - License

  • 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

  1. Fork it!
  2. Make your changes!
  3. 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.

Source Distribution

slender-1.4.5.tar.gz (10.4 kB view details)

Uploaded Source

File details

Details for the file slender-1.4.5.tar.gz.

File metadata

  • Download URL: slender-1.4.5.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

File hashes

Hashes for slender-1.4.5.tar.gz
Algorithm Hash digest
SHA256 b1435226dc3f4372457bb4df30acd80f5c80a78f974290341079c05f1fe85f89
MD5 766c8e9f984109251d992c9f854a584a
BLAKE2b-256 cd69afb8b8a9d2dafaad68fb8d23e9bb71b97cdd0c35f7f5e472da0a19b17d17

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