Skip to main content

Lightweight utility functions for working with strings, lists, and tuples.

Project description

sequencekit

A lightweight, deterministic utility library for working with strings, lists, and tuples.

sequencekit provides clean and efficient helpers for common sequence operations such as frequency analysis, duplicate detection, and order-preserving transformations. It eliminates repetitive boilerplate while maintaining predictable and explicit behavior.


What is this project?

sequencekit is a focused utility toolkit built to simplify everyday sequence manipulation tasks in Python.

While Python offers powerful built-ins, operations like:

  • Extracting elements that appear only once
  • Finding duplicates
  • Removing duplicates while preserving order
  • Determining the most or least frequent element

often require verbose or repetitive patterns.

This library provides:

  • Deterministic results
  • O(n) implementations
  • Explicit error handling
  • Configurable output formats
  • Clean, test-driven design

Features

  • Frequency counting (frequency)
  • Duplicate detection (contains_duplicates)
  • Extract elements appearing exactly once (uniqueonly)
  • Extract elements appearing more than once (duplicates)
  • Remove duplicates while preserving order (remove_duplicates)
  • Find most frequent element (most_frequent)
  • Find least frequent element (least_frequent)
  • Deterministic tie-breaking
  • Configurable output format (list, tuple, str)
  • Comprehensive test coverage
  • No third-party dependencies

Installation

From PyPI

pip install sequencekit

PyPI page: https://pypi.org/project/sequencekit/


Development Installation

git clone https://github.com/YOUR_USERNAME/sequencekit.git
cd sequencekit
pip install -e .

Usage

from sequencekit import (
    frequency,
    contains_duplicates,
    uniqueonly,
    duplicates,
    most_frequent,
    least_frequent,
    remove_duplicates,
)

frequency("banana")
# {'b': 1, 'a': 3, 'n': 2}

contains_duplicates("banana")
# True

uniqueonly("banana")
# ['b']

duplicates("banana")
# ['a', 'n']

remove_duplicates("banana", out="str")
# 'ban'

most_frequent("banana")
# 'a'

least_frequent("banana")
# 'b'

Output Format Control

Functions returning sequences support:

  • "list" (default)
  • "tuple"
  • "str"

Example:

uniqueonly("banana", out="tuple")
# ('b',)

remove_duplicates("banana", out="str")
# 'ban'

Invalid output types raise ValueError.


Running Tests

pytest

All functionality and edge cases are covered by tests.


Project Structure

sequencekit/
├── sequencekit/
│   ├── __init__.py
│   ├── core.py
│   ├── _internals.py
├── tests/
│   └── test_core.py
├── pyproject.toml
└── README.md

License

Copyright 2026 THARUN R

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Contributions

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Write tests for new functionality
  4. Ensure all tests pass
  5. Submit a pull request

Bug reports and suggestions are appreciated.


Version

Current version: 0.1.0


Author

Tharun R GitHub: https://github.com/IHac-er

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sequencekit-0.1.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sequencekit-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file sequencekit-0.1.0.tar.gz.

File metadata

  • Download URL: sequencekit-0.1.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for sequencekit-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bf185e7cf3a4679e3c9c16fe09dbc726a88f3d4fd298568b3c817fceddc141ba
MD5 c733ae53788ca4dcecf8097402f23b32
BLAKE2b-256 fd31a99fb38f0d865e6ea07b30d2de11fc9346ca3f850d98944b6892dcf04e85

See more details on using hashes here.

File details

Details for the file sequencekit-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sequencekit-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for sequencekit-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce55f9c562881a7676e85f3cceef1d52c394d175353417ea111696733b77c7c3
MD5 4443951e93f86729164102abf27af71d
BLAKE2b-256 710c616ddc3cc324cbc73b45056627f1be8fae552480e6b0cb683edc492d28cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page