A lexicographic indexing system for Kanban boards
Project description
kanban-indexer
kanban-indexer
is a simple Python library that implements a lexicographic indexing system for ordered collections, such as columns on a Kanban board. It uses a chracter-based system that should allow for an arbitrary number of insertions between any two existing indices without the need for reindexing.
Features
- Generates string indices composed of characters A-Z
- Uses lexicographic ordering to determine item placement
- Creates new indices at the midpoint between existing indices
- Allows insertions before the first item and after the last item
- Avoids floating-point precision issues by using string comparisons
- Produces human-readable indices
Installation
You can install kanban-indexer
using pip:
pip install kanban-indexer
Usage
Here's a quick example of how to use kanban-indexer
:
from kanban_indexer import compute_intermediate_index, compute_preceding_index, compute_succeeding_index
# Generate an index between "B" and "C"
middle_index = compute_intermediate_index("B", "C")
print(middle_index) # Output: BM
# Generate an index before "A"
before_b = compute_preceding_index("B")
print(before_b) # Output: AZ
# Generate an index after "Z"
after_z = compute_succeeding_index("Z")
print(after_z) # Output: ZB
API Reference
compute_intermediate_index(index_before: str, index_after: str) -> str
Computes the intermediate index between two given indices.
compute_preceding_index(index: str) -> str
Returns the preceding index value based on the given index.
compute_succeeding_index(index: str) -> str
Returns the succeeding index based on the given index.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Development
To set up the development environment:
- Clone the repository
- Create and activate a virtual environment:
python -m venv venv source venv/bin/activate
- Install the package with development dependencies:
pip install -e .[dev]
Running Tests
You can run tests using pytest:
pytest
Linting and Formatting
This project uses ruff
for linting and formatting. To run ruff:
ruff check .
To automatically fix issues and format code:
ruff check --fix .
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 kanban_indexer-1.0.1.tar.gz
.
File metadata
- Download URL: kanban_indexer-1.0.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b52fe17d2e65b04a348088099ecd95b14847fd29665001e454c9d8cd5c46a78 |
|
MD5 | 8ecb540903e179bef64f2485fbb120b1 |
|
BLAKE2b-256 | 7a00ae0feae9cf926fdbb0ed34df88e72d98ce654c5692d07773edbf97570155 |
File details
Details for the file kanban_indexer-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: kanban_indexer-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e12de525699ea09d9f55a58f6b42f59a3525397f956c90526cc6f75dd3fd7a2e |
|
MD5 | 7ab727e23b632c48103c27ac755a79d2 |
|
BLAKE2b-256 | 3cd93d0e1098c277beb1e5f04575f9bfcddbd086c34c6de8e06ed250c48ca83f |