Skip to main content

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:

  1. Clone the repository
  2. Create and activate a virtual environment:
    python -m venv venv
    source venv/bin/activate
    
  3. 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 .

Metadata

Release files for kanban-indexer 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kanban-indexer 1.0.2
File Size Uploaded Provenance Actions
kanban_indexer-1.0.2.tar.gz 7.6 kB Without provenance Details for kanban_indexer-1.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kanban-indexer 1.0.2
File Interpreter ABI Platform Actions
kanban_indexer-1.0.2-py3-none-any.whl Python 3 none any Details for kanban_indexer-1.0.2-py3-none-any.whl

Total release size: 14.1 kB

Release files / kanban_indexer-1.0.2.tar.gz

Download URL kanban_indexer-1.0.2.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e9423ca2f0db350461f9de9a7e5f490f09aad40a72972d488cdd740d6032f633
BLAKE2b-256 checksum
How to use checksums
1eacf12b10ba1cd9226161c795fef3e54948a4e4b586ed34aa836aa9bfa8cfff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.0

Release files / kanban_indexer-1.0.2-py3-none-any.whl

Download URL kanban_indexer-1.0.2-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5f752ca12cea9ef93c8a03a7169bbe918303703615a3648b0203ce099642c35
BLAKE2b-256 checksum
How to use checksums
18faa126a8ea0256a2c38edd18479a8fa490e65a0409c9a22ca395b3134c114a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.0

Security for kanban-indexer 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page