A Python Package for Classic data structures
Slink is a Python package library for classic data structures. These data structures are essential components in computer science, used to store, manage, and manipulate data efficiently. Slink provides a clean, reusable, and object-oriented interface for these data structures, making it easy to integrate them into your Python programs. We hope that Slink serves as a valuable resource for your Python programming needs!
We welcome contributions from the open source community. If you find a bug or have a feature request, please open an issue on the GitHub repository. If you'd like to contribute code, please fork the repository and submit a pull request with your changes. Slink follows the Python Software Foundation's code of conduct and encourages contributions from all members of the community. Before contributing, please review the contribution guidelines and code of conduct to ensure that your contributions are in line with our standards and values.
The following must be installed on the host machine:
- Python 3.9 or above
It is highly recommended to use pyenv to manage Python versions. This project is built in Ubuntu
22.04, but should also work on MacOS, as well as other Linux distros.
To get started with this project for development purposes, clone the repository to your local machine and install the required dependencies.
git clone https://github.com/jgfranco17/slink.git
cd slink
pip install -r requirements.txtTo use Slink in your Python programs, simply import the desired data structure and create an instance of it:
from slink.lists import LinkedList
# Create a new singly linked list
my_list = LinkedList()
# Add elements to the list
my_list.add(1)
my_list.add(2)
my_list.add(3)
# Print out the linked list
my_list.display()The Slink repository also includes detailed documentation and examples for each data structure. Please check the documentation directory for further references.
In order to run diagnostics and unittests, first install the testing dependencies. This will allow you to utilize the full capacity of the test modules we have built.
pip install -r requirements-test.txtTo run the full test suite, run the Makefile command as follows:
cd slink
make testYou can run these tests using the PyTest CLI tool. To run all
tests in the directory containing the test files, navigate to the directory and enter pytest in
the command line; for added verbosity, add the -vv flag after. To run a specific test file,
enter pytest <filename>.
# Run all tests in the testing module with verbose detail
cd slink
pytest -vv
# Or, run a specific test file
cd slink/tests
pytest -v <filename>.pyThis will run the specified test module and generates a detailed result report in the terminal.
Running these unittests is necessary to ensure that the code is functioning as expected and meeting the requirements of the design specification. The unittests are designed to test each function and method of the code and to identify any errors or unexpected behavior. By testing the code using these PyTest unittests, we can ensure that the code meets the specified requirements and that any changes made to the code do not introduce new bugs or errors.
In addition, these tests can be automated to run on every code change, allowing us to quickly identify any issues that may arise and enabling us to maintain a high level of code quality.
In essence, running these PyTest unittests is a critical part of the software QA process and helps to ensure that our code is robust, reliable, and meets the needs of our end-users before the product hits deployment.