Skip to main content

A library for transparent transformation of indexable containers (lists, etc.)

Project description

PyPi package Documentation

SeqTools

SeqTools extends the functionalities of itertools to indexable (list-like) objects. Some of the provided functionalities include: element-wise function mapping, reordering, reindexing, concatenation, joining, slicing, minibatching, etc.

SeqTools functions implement on-demand evaluation under the hood: operations and transformations are only applied to individual items when they are actually accessed. A simple but powerful prefetch function is also provided to eagerly evaluate elements in background threads or processes.

SeqTools originally targets data science, more precisely the data preprocessing stages. Being aware of the experimental nature of this usage, on-demand execution is made as transparent as possible by providing fault-tolerant functions and insightful error message.

Example

>>> def count_lines(filename):
...     with open(filename) as f:
...         return len(f.readlines())
>>>
>>> def count_words(filename):
...     with open(filename) as f:
...         return len(f.read().split())
>>>
>>> filenames = ["a.txt", "b.txt", "c.txt", "d.txt"]
>>> lc = seqtools.smap(count_lines, filenames)
>>> wc = seqtools.smap(count_words, filenames)
>>> counts = seqtools.collate([lc, wc])
>>> # no computations so far!
>>> lc[2]  # only evaluates on index 2
3
>>> counts[1]  # same for index 1
(1, 2)

Batteries included!

The library comes with a set of functions to manipulate sequences:

concatenate

concatenate

batch

batch

gather

gather

prefetch

prefetch

interleave

interleave

uniter

uniter

and others (suggestions are also welcome).

Installation

pip install seqtools

Documentation

The documentation is hosted at https://seqtools-doc.readthedocs.io.

Contributing and Support

Use the issue tracker to request features, propose improvements or report issues. For questions regarding usage, please send an email.

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

seqtools-1.4.1.tar.gz (596.0 kB view details)

Uploaded Source

Built Distributions

SeqTools-1.4.1-cp312-cp312-win_amd64.whl (37.4 kB view details)

Uploaded CPython 3.12 Windows x86-64

SeqTools-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (45.6 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

SeqTools-1.4.1-cp312-cp312-macosx_11_0_arm64.whl (34.7 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

SeqTools-1.4.1-cp312-cp312-macosx_10_9_x86_64.whl (34.3 kB view details)

Uploaded CPython 3.12 macOS 10.9+ x86-64

SeqTools-1.4.1-cp311-cp311-win_amd64.whl (37.3 kB view details)

Uploaded CPython 3.11 Windows x86-64

SeqTools-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (44.7 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

SeqTools-1.4.1-cp311-cp311-macosx_11_0_arm64.whl (34.7 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

SeqTools-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl (34.3 kB view details)

Uploaded CPython 3.11 macOS 10.9+ x86-64

SeqTools-1.4.1-cp310-cp310-win_amd64.whl (37.3 kB view details)

Uploaded CPython 3.10 Windows x86-64

SeqTools-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (44.6 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

SeqTools-1.4.1-cp310-cp310-macosx_11_0_arm64.whl (34.7 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

SeqTools-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl (34.3 kB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

SeqTools-1.4.1-cp39-cp39-win_amd64.whl (37.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

SeqTools-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (44.5 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

SeqTools-1.4.1-cp39-cp39-macosx_11_0_arm64.whl (34.6 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

SeqTools-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl (34.2 kB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

File details

Details for the file seqtools-1.4.1.tar.gz.

File metadata

  • Download URL: seqtools-1.4.1.tar.gz
  • Upload date:
  • Size: 596.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for seqtools-1.4.1.tar.gz
Algorithm Hash digest
SHA256 615c4e23411c9fbc7351c91454607056add493b5825e821a3e7d72fbae6705e0
MD5 981cd5df5b3d5d0fc6cf1d2ab34dcf24
BLAKE2b-256 70896b77db4509349dc0f36cf17fc02f0fba904983ac2ca7146d15508a498f22

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: SeqTools-1.4.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for SeqTools-1.4.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 2e345374a64f69ba6b485f382e2655a5023863d2910440fb0693789edfd51c08
MD5 eec5b2ac1fc7fd0551c5bb22da6f5516
BLAKE2b-256 9dee34c6ee79832307b9adc29cce58e591233788abfba05ad9ccd0c83282d328

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a92d7c834cc023b8fa6f1ea94681cf6e8eb701d7cbb194c294a1d7725b882e3e
MD5 0d8eabc20402b0a4ade30ca6d1c9d5b5
BLAKE2b-256 81ba30d5edddd38a156e63aace9736ba94edb751c85ea735db41fb1122a83974

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e3f0d349bc3e4fac5a5e2517da642c8b2870dd6b033e6d5968f4c347ed90dc0
MD5 884b69430fcd958482713be48e972c1f
BLAKE2b-256 dea035ac7b74841c7a7d2c52da14731933306e736f0f5cdd2c2fe1567f4752ec

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp312-cp312-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a7af717e314c923a8c2d8035c80f09b451bbab02aebd2f8d78c215a054a12f08
MD5 0b67cc9091a2994f3c32be1ccedaf798
BLAKE2b-256 596c59c3cca10ad3b813edfef4384b9f018cdfa9127379ea04c9871cdd8108a8

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: SeqTools-1.4.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for SeqTools-1.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2fa10c7676d5af5995a2c040905425594ba896ceb94d579d7ebd4ba59ecec6a6
MD5 510570101a7d6603c12487385698f099
BLAKE2b-256 bc1f26b908eaa84fcc967f176c825a30c05ac7d57b2437717857deb1501eae19

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1f02ed5d0733d9626a253d54db90211baaec607be5dcfe97ee36bd85ba2d9a21
MD5 3cc07557e6c9526219454edb8bef8bbd
BLAKE2b-256 5c1e827215d333c4c9751909fd34fc001b0a6e91093cc4a849fd2afae59d5355

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb885ed072b8f8a5b09d2e5bb409dbede4b8ba1ca90cb9f39806fa3d2f56859c
MD5 7b9e7c76062919a5bb1cd2368fa15f98
BLAKE2b-256 f42cc07a4fdaef703f809fe43f8909ef21b443f5b915ee21a7569cc47688ef77

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0747ec4c92759af24ee4295fa0160a132b4d668b29d10eea154ca4a034c4937e
MD5 0967214654fb5642622b4c502bee43ce
BLAKE2b-256 8d06b3e48b1990b3b0c26209a9dd10ea2dbb25ed6100311fec8df57ec6aadb97

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: SeqTools-1.4.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for SeqTools-1.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 94a589f13e9a69c71448ff700c6808f52703b2e39c0466eb587a37bcf6312dd9
MD5 0dfde2ee6f5ff276d3a9ae684d40d4c0
BLAKE2b-256 047ab21ac49463d2f543c4b4703702824d5712ebb38c7f2e154e70b2e0a792f7

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7c83cadda3d4b4ec278b661895b096f54aa8b183deea1999f7b2c6124456d5cc
MD5 3f704ebfe1f11a22ab56a2ee5adf7464
BLAKE2b-256 f820dcadcb4915ad072b086e6d60d3efeda233b0e31c048052de67217bb9181e

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 357ed0b1bb0537dafa65be3970ad49d4fcbef160d45188fe22626dbccd42b55c
MD5 7b2d506d7005edbac23a8f2bbbc38c15
BLAKE2b-256 e06faae9c87203579beaa0175801d6a7c5e12dcfc4667fde7881409e2f915c47

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b4449b210b7858f1fe16702afebfcd5ba7b465c6c4bc8ca69745728cb21d0f2a
MD5 dc0d8425ebc0b5a372becd9ed5801fc3
BLAKE2b-256 89f7a12c1a6d65d1654e7ed3beed042397307c383bac6c67e51f1c0ea2ec359b

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: SeqTools-1.4.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for SeqTools-1.4.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 8e10f13caf9ae482fd1ae52819d89b6722536e7da0e15560eb54191c2c57cd9e
MD5 703fec970382930801c21645ff89347f
BLAKE2b-256 482fedc35e25bc723edee5cf0fbca5997efa4fbc392bb1d27e77422aed14d5c8

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f8ba54294fb9271b4f0e3027d33623416681f3a5db2e4b20aa8578e0b8929c1f
MD5 8b9e1f15b2ea8d35a4aaec7ae253c2e4
BLAKE2b-256 12c94fe854d9deef333a7fe2904cf2625773bb51db2006830e1ebe0a9188ccc6

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a304f1fb86dbb0f7fb233d01a2387165087009636f3c46a57339e70edc4565b
MD5 ccd9a7c133fbc6bfee5437e9b76173a2
BLAKE2b-256 eff8684288214767608fe3e27c96e2c703f8e2b82e537f86373200f68917d863

See more details on using hashes here.

File details

Details for the file SeqTools-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for SeqTools-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0f7f947d592f7d1692b51d1670f35ce4f5b1631217a1afd2473214400bfd3ba9
MD5 f299349142efbe2ff246e7f7ff5caf23
BLAKE2b-256 be079c2344eef34cf3dc5c514c36db899490e52a4d4b6f298dad7c4b9e104132

See more details on using hashes here.

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