Skip to main content

A python package to help craft and manipulate sequences.

Project description

Seira Craft

A Python package to help craft and manipulate sequences.

Installation

pip install seira-craft

or

poetry add seira-craft

Usage

Basic Example

from datetime import datetime

from seira_craft.default import DefaultCrafter
from seira_craft.seira import Sequence
from dataclasses import dataclass


@dataclass
class Segment:
    start: datetime
    end: datetime
    val: str

    def copy(self):
        return Segment(self.start, self.end, self.val)


crafter = DefaultCrafter[Segment]()
seq = Sequence[Segment](crafter)

seq.insert(Segment(
    start=datetime(2023, 1, 1, 1), 
    end=datetime(2023, 1, 1, 2),
    val="First Interval"
))

seq.insert(Segment(
    start=datetime(2023, 1, 1, 1, 30), 
    end=datetime(2023, 1, 1, 2, 30),
    val="Second Interval"
))

print(seq.sequence())

License

MIT License. See LICENSE for more details.

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

seira_craft-0.0.5.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distribution

seira_craft-0.0.5-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

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