semvec/pypi-packages huggingface dataset:
sam_tags 0.1.0
SAM tags
Requires Python: <4.0,>=3.11

# sam_tags

[![CI](https://github.com/msto/sam_tags/actions/workflows/python_package.yml/badge.svg?branch=main)](https://github.com/msto/sam_tags/actions/workflows/python_package.yml?query=branch%3Amain)
[![Python Versions](https://img.shields.io/badge/python-3.11_|_3.12-blue)](https://github.com/msto/sam_tags)
[![MyPy Checked](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://docs.astral.sh/ruff/)

SAM tags

## Quickstart

The `sam_tags` decorator permits the specification of custom enumerations that adhere to the conventions described in the SAM specification.

```py
from enum import StrEnum
from sam_tags import sam_tag


@sam_tag
class CustomTag(StrEnum):
    """Custom SAM tags."""

    XF = "XF"
    """Some filter."""

    vl = "vl"
    """Some value."""
```

The predefined standard tags are available as a built-in class.

```py
from sam_tags import StandardTag

# read: pysam.AlignedSegment
read.get_tag(StandardTag.RX)
```

Docstrings on each predefined tag permit simple reference within an IDE. 

![](assets/screenshot.png)

Built-in classes are also available for sets of tags used in popular bioinformatics software.

```py
from sam_tags.community import BwaTag
from sam_tags.community import CellrangerTag
```
buffer-matcher 0.1.1
More efficiently match bytes using memoryviews to prevent copying
Requires Python: >=3.12
Keywords: buffer, match, memory, view

Buffer matchers, as I refer to them, are wrappers around bytes that
allow easier, more memory-efficient reading and pattern matching

These are used in my programming language [Caustic](https://codeberg.org/Caustic)'s [Lexer](https://codeberg.org/Caustic/CausticLexer)

Beyond base classes, this package provides two buffer matcher classes:
- `DynamicBufferMatcher` / `dynamic.BufferMatcher`
- `StaticBufferMatcher` / `static.BufferMatcher`

The buffer classes shown above can be `.read()`, `.seek()`ed through,
and `.match()`ed against strings, callables, or regular expressions

The "dynamic" and "static" in the names refer to how they calculate
line and column numbers -- namely, the "dynamic" buffer matcher
calculates line and column numbers via properties, every time
they are accessed; whilst the "static" buffer matcher calculates
line and column numbers only when the position of the matcher is
changed. "Dynamic" buffer matchers are recommended if line and column
numbers are accessed less often than the position is changed, and vice-versa
for "static" buffers. 

# Changelog

## v0.1.1
- Fixed `SimpleBufferMatcher.copy_peek()` ignoring `size` parameter