Skip to main content

logo

Codacy Badge

python3.6 python3.7 python3.8

Documentation Status PyPI version License: GPL v3

Extra-Collections

👋 extra-collections (or extra for short) is a python3 pacakge that provides a pythonic, intuitive, and easy implementation of the most common data structures used in software projects. Some of these data structures are simple such as stack or queue; and some are much complicated such as skip_list or red_black_tree.

🧐 The name of the pacakge was inspired by the collections python package which provides simple implementations for some of the basic data structures. "extra" provides an additional set of data structures, hence the name.. "extra-collections".

🤯 extra-collections, in its first release, provides 20 different data structures each performs different functionality in a very fast and optimized way. Its aim is to make working with these complicated data structres as simple as dealing with a simple linked list which makes things easier to use for everyone espcially if they're starting their journey into coding.

📒 extra-collections provides API documentations to quickly understand and use those data structures on any given task. At the same time, I did my best to make these python modules as consistent as they could be. So dealing with the most complicated data structrue will as easy as the easiest one.

Fun fact #1:

🤫 extra-collection was originally developed as a way to teach myself how to code and there were no intentions to release it at all. But after spending more than 18 months playing with different data structres, I've found out that I've implemented 16 different data-structures. Just then, I decided to push it to 20 data structures and release it. Why 20 you ask? Because it is a nice round number 😁.

Fun fact #2:

🤤 The first version of extra-collection was releases on 20/10/2020. I wanted to release it on 20/20/2020 but my brother told me there are only 12 months in a year. I didn't believe him, but he sweared.

👨🏻‍💻 Installation

To install the current release (Ubuntu, Windows, Mac):

pip install extra-collections

To update extra-collections to the latest version, add --upgrade flag to the above commands.

🦾 Available Data Structures

In this release, you can find 2️⃣0️⃣ data structures that can be categorized into two categories:

⚡️ Linear Data Structures:

🔥 Non-linear Data Structures:

🚀 Quick tour

First, you need to enable the python shell:

$ python

To immediately use a data strucutre, you can import it directly from the package and start using it right-away. The following code uses a bst:

>>> from extra import BST
>>> bst = BST([8, 5, 2, 7, 15, 10, 3])
>>> bst
      __8___
     /      \
  __5       _15
 /   \     /
2     7   10
 \
  3
>>> bst.insert(30)
>>> bst
      __8___
     /      \
  __5       _15
 /   \     /   \
2     7   10    30
 \
  3
>>> bst.remove(3)
>>> bst
      __8___
     /      \
  __5       _15
 /   \     /   \
2     7   10    30
>>> len(bst)
7

🤝 Contribution guidelines

If you want to contribute to extra-collections, be sure to review the contribution_guidelines. By participating, you are expected to uphold this code.

This project uses GitHub issues for tracking requests and bugs, questions and even discussion. Please, if you have any question, direct it to Stack Overflow under

🚧 Design Principles

Here, I will walk you through some of the design principles that I followed while creating this package:

  • Can't create nested modules.
  • Replace '\n' with '\\n' when seen as an input value.
  • None can't be used as an input value. (Could be changed in future releases).
  • Class constructors can be used for initialization as well as declaration.
  • Methods with no _ are for public use. The other are not; unless you know what you're doing.
  • All public methods must raise appropriate errors when needed. The Other methods must raise only AssertionError when needed.
  • Search/remove methods shouldn't raise any errors.
  • Insert/delete/get-index/delete-index/set-index methods must raise errors when needed.
  • All methods should return the data stored not the used objects.
  • Any module can be emptied except for the SuffixTrie.

📕 Resources

The following are the main resources that helped me while working on this awesome project:

Release files for extra-collections 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for extra-collections 1.0.1
File Size Uploaded
extra-collections-1.0.1.tar.gz 102.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for extra-collections 1.0.1
File Interpreter ABI Platform
extra_collections-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 232.6 kB

Release files / extra-collections-1.0.1.tar.gz

Download URL extra-collections-1.0.1.tar.gz
Size 102.2 kB
Tags Source
SHA-256 checksum
How to use checksums
98080f82dfeda65baca669d83b187476b8e3b5bd8e083e5ae6fec2f57eec9cf7
BLAKE2b-256 checksum
How to use checksums
3450a2118007a914ded41d24715447e105d339a81e8df05101649adff272bff1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release files / extra_collections-1.0.1-py3-none-any.whl

Download URL extra_collections-1.0.1-py3-none-any.whl
Size 130.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
560f22b01c00041e9cea19bf1342adfc5ffde7d5ad3c85a3d10483e89ad66aa1
BLAKE2b-256 checksum
How to use checksums
b21d5b3c5b50d7a6fb237ea2fb6e1ce9ec956ace1373589571462e6b4ee6cc18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page