Skip to content

A simple Python application for demonstrating breadth-first search and depth-first search for pathfinding.

License

Notifications You must be signed in to change notification settings

LoveDuckie/search-pathfinding

Repository files navigation

Python Tool Template

This repository is a template for creating Python tools with a consistent structure and standard features like linting, testing, and packaging.

Features

  • Python Package Structure: Includes a basic Python package setup (search-pathfinding).
  • Testing Setup: Example test files (search-pathfinding_tests) for unit testing.
  • Development Tools: Shell scripts to automate formatting, linting, testing (run_format.sh, run_lint.sh, run_tests.sh), and renaming (rename.sh).
  • Project Configuration: Uses pyproject.toml for dependency management with Poetry.

Getting Started

Prerequisites

  • Python 3.8+
  • Poetry for dependency and project management

Dependencies

The project uses several dependencies defined in pyproject.toml. Below is a summary of the main dependencies and their purposes:

  • Poetry: Used for dependency management and packaging.
  • Linting and Formatting: Includes tools like pylint and black to ensure code quality and consistency.
  • Testing: Uses pytest for unit testing to ensure the functionality of the code.

To install the dependencies, use:

poetry install

Project Dependencies

This project relies on the following dependencies to ensure functionality, development efficiency, and maintainability:

  • rich: For rendering rich text, tables, and progress bars in the terminal, enhancing the user experience of the CLI.
  • rich-click: Combines Rich and Click to add rich-text formatting and improve the usability of the command-line interface.
  • click: A framework for building flexible and easy-to-use command-line interfaces (CLI).

Development & Testing Dependencies

  • black: Automatically formats code to ensure consistent style across the project.
  • pylint: Provides static code analysis to enforce coding standards and detect potential bugs.
  • coverage: Measures the coverage of unit tests, helping to ensure all code paths are tested.

Documentation Dependencies

  • sphinx: Generates project documentation in formats such as HTML and PDF.
  • sphinx-rtd-theme: Provides a clean, responsive theme for documentation, styled like Read the Docs.

These dependencies help streamline development, testing, and documentation while ensuring a user-friendly command-line interface.

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/search-pathfinding.git
    cd search-pathfinding
  2. Install the dependencies:

    poetry install

Running the Tool

To run the main script:

poetry run python -m search-pathfinding

Development

Formatting

To format the codebase:

./run_format.sh

Linting

To lint the codebase:

./run_lint.sh

Testing

To run the tests:

./run_tests.sh

Renaming the Project

To rename the project (e.g., change the package name from search-pathfinding to something else):

./rename.sh new_project_name

Project Structure

  • search-pathfinding/: The main package containing the tool's source code.
  • search-pathfinding_tests/: Contains unit tests for the package.
  • .gitignore: Specifies files and folders to be ignored by Git.
  • pyproject.toml: Project configuration and dependency management file.
  • LICENSE: The license for this project.

License

This project is licensed under the terms of the MIT license. See the LICENSE file for details.

Contributing

Feel free to open issues or submit pull requests for new features, bug fixes, or improvements.

Acknowledgements

This template is inspired by best practices for Python tool development, making it easy to start a new project with a consistent and productive setup.

About

A simple Python application for demonstrating breadth-first search and depth-first search for pathfinding.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published