Skip to main content

Synchronizers for lazy iterators.

Project description

syncup

PyPI Release CI Python Versions MyPy Checked uv Ruff

Synchronizers for lazy iterators.

pip install syncup

Example

Iterate though a complete FASTX file and a filtered FASTX file, synchronizing on records present in both:

with (
    FastxFile(in_source) as source,
    FastxFile(in_subseq) as subseq,
):
    for count, (fq, fq_subseq) in enumerate(
        sync(
            iter1=source,
            iter2=subseq,
            key1=lambda rec: rec.name,
            key2=lambda rec: rec.name,
            cmp_func=lambda x, y: (x == y) - 1,  # only advance iter1 when non-equal
        ),
        start=1,
    ):
        assert fq.name == fq_subseq.name, f"Names for record {count} should be equal!"

Development and Testing

See the contributing guide for more information.

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

syncup-0.1.0.tar.gz (31.2 kB view details)

Uploaded Source

Built Distribution

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

syncup-0.1.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: syncup-0.1.0.tar.gz
  • Upload date:
  • Size: 31.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for syncup-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b5157d161c7f02a7ee5395ba39dc4b0e0a270fee7dc50415ea5fe7acc8e88845
MD5 01b1214dc29730ca0e1e9f58ebffeaf8
BLAKE2b-256 ebe8e818609ee22a905b998079aec46864283fe0e5541c90f4e25c5d786ceb6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for syncup-0.1.0.tar.gz:

Publisher: publish_syncup.yml on clintval/syncup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: syncup-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for syncup-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3993e1ea4806b44d07b422a11b2b4711bf84fa48d5b31765d444f403678c57c3
MD5 67af90641a39080f87b27b1ae3c1910c
BLAKE2b-256 ca8420efcf1a456baa48e0396fcb598b8a6c90af1db1e7de528a564e4f6772cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for syncup-0.1.0-py3-none-any.whl:

Publisher: publish_syncup.yml on clintval/syncup

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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