A multi-purpose python package mainly for educational purposes
Ary's Box (abox)
Works In Progress. Done by Ang Ray Yan.
pip is the fastest way to go about getting
pip install abox
U2. Getting Started
An example of what you could do with
abox is as follows:
import abox tree = abox.AVLTree() for i in range(1, 16): tree.insert(i) print('Tree Height (1-based): ', tree.get_height()) print('Preorder Traversal: ', tree.pre_order()) print('Inorder Traversal: ', tree.in_order())
And the output is (hopefully) what you would expect :)
Tree Height (1-based): 4 Preorder Traversal: [8, 4, 2, 1, 3, 6, 5, 7, 12, 10, 9, 11, 14, 13, 15] Inorder Traversal: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
Do refer to the documentation for more details!
pip, as well as
python are used interchangeably here.
D1. Installing required dependencies
Firstly, install all required dependencies (within the root directory):
pip3 install -r requirements.txt
To run all tests, use the following command (in root directory too):
python3 -m pytest tests/ --cov=abox/
If necessary, you can generate a html report (to be stored in htmlcov/ directory)for coverage report instead as follows:
python3 -m pytest tests/ --cov=abox/ --cov-report html
D3. Generating Documentation
To rebuild documentation using Sphinx, you may run the following (in root directory):
sphinx-build -b html docs docs/_build
D4. Packaging/Releasing on PyPI
Run the following command to generate distribution packages:
python3 setup.py sdist bdist_wheel twine upload dist/*
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 abox-0.2-py3-none-any.whl (44.5 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size abox-0.2.tar.gz (12.0 kB)||File type Source||Python version None||Upload date||Hashes View hashes|