No project description provided
Project description
path-reducer
path-reducer is a Python package that simplifies a list of directions by removing opposite directions that cancel each other out.
Installation
Package is published on PyPI, you can install it using pip:
pip install path-reducer
Usage
from path_reducer import PathReducer
# Create a PathReducer instance
path_reducer = PathReducer()
# Example usage
directions = ["NORTH", "SOUTH", "SOUTH", "EAST", "WEST", "NORTH", "WEST"]
optimized_directions = path_reducer.reduce_path(directions)
print(optimized_directions) # Output: ["WEST"]
Local development
Project is set up using Poetry, to run it locally follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/augustinasn/path-reducer.git
-
Navigate to the project directory:
cd path-reducer
-
Install Poetry (if you haven't already):
pip install poetry
-
Use Poetry to install the project's dependencies:
poetry install
-
Activate the Poetry virtual environment:
poetry shell
-
Tests are included in the tests directory. You can run the tests using the following command:
python test.py
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file path_reducer-1.0.0.tar.gz
.
File metadata
- Download URL: path_reducer-1.0.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 876e811679a5618bfb1b673f345dc5b5b9a2565097190fa0e823489283534014 |
|
MD5 | 02b94a1396ebbbb507dae829abfdc7d0 |
|
BLAKE2b-256 | 3341333502e4359138b127c051a12d50e89779ae3cac8483b9ce0c15f44506cb |
File details
Details for the file path_reducer-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: path_reducer-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9eca52f88ac7e822cb8b721e4f07dfd4e49130c96bc8b78a15c45ea7eb487ba |
|
MD5 | f379ec14e7dc55c7ebc00b765c8893af |
|
BLAKE2b-256 | d34f6dbc11ae4168080b4649ce2d0f5ab30f953124d7850e99dd0522e7b23036 |