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:
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.
Metadata
Release files for SeqTools 1.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| seqtools-1.4.1.tar.gz | 596.0 kB | Details |
Built distributions (wheels)
Total release size: 1.2 MB
Release files / seqtools-1.4.1.tar.gz
| Download URL | seqtools-1.4.1.tar.gz |
|---|---|
| Size | 596.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
615c4e23411c9fbc7351c91454607056add493b5825e821a3e7d72fbae6705e0
|
|
BLAKE2b-256 checksum How to use checksums |
70896b77db4509349dc0f36cf17fc02f0fba904983ac2ca7146d15508a498f22
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp312-cp312-win_amd64.whl
| Download URL | SeqTools-1.4.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 37.4 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2e345374a64f69ba6b485f382e2655a5023863d2910440fb0693789edfd51c08
|
|
BLAKE2b-256 checksum How to use checksums |
9dee34c6ee79832307b9adc29cce58e591233788abfba05ad9ccd0c83282d328
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | SeqTools-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 45.6 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
a92d7c834cc023b8fa6f1ea94681cf6e8eb701d7cbb194c294a1d7725b882e3e
|
|
BLAKE2b-256 checksum How to use checksums |
81ba30d5edddd38a156e63aace9736ba94edb751c85ea735db41fb1122a83974
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | SeqTools-1.4.1-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 34.7 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1e3f0d349bc3e4fac5a5e2517da642c8b2870dd6b033e6d5968f4c347ed90dc0
|
|
BLAKE2b-256 checksum How to use checksums |
dea035ac7b74841c7a7d2c52da14731933306e736f0f5cdd2c2fe1567f4752ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp312-cp312-macosx_10_9_x86_64.whl
| Download URL | SeqTools-1.4.1-cp312-cp312-macosx_10_9_x86_64.whl |
|---|---|
| Size | 34.3 kB |
| Tags | CPython 3.12 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
a7af717e314c923a8c2d8035c80f09b451bbab02aebd2f8d78c215a054a12f08
|
|
BLAKE2b-256 checksum How to use checksums |
596c59c3cca10ad3b813edfef4384b9f018cdfa9127379ea04c9871cdd8108a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp311-cp311-win_amd64.whl
| Download URL | SeqTools-1.4.1-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 37.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
2fa10c7676d5af5995a2c040905425594ba896ceb94d579d7ebd4ba59ecec6a6
|
|
BLAKE2b-256 checksum How to use checksums |
bc1f26b908eaa84fcc967f176c825a30c05ac7d57b2437717857deb1501eae19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | SeqTools-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 44.7 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
1f02ed5d0733d9626a253d54db90211baaec607be5dcfe97ee36bd85ba2d9a21
|
|
BLAKE2b-256 checksum How to use checksums |
5c1e827215d333c4c9751909fd34fc001b0a6e91093cc4a849fd2afae59d5355
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | SeqTools-1.4.1-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 34.7 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
eb885ed072b8f8a5b09d2e5bb409dbede4b8ba1ca90cb9f39806fa3d2f56859c
|
|
BLAKE2b-256 checksum How to use checksums |
f42cc07a4fdaef703f809fe43f8909ef21b443f5b915ee21a7569cc47688ef77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl
| Download URL | SeqTools-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl |
|---|---|
| Size | 34.3 kB |
| Tags | CPython 3.11 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
0747ec4c92759af24ee4295fa0160a132b4d668b29d10eea154ca4a034c4937e
|
|
BLAKE2b-256 checksum How to use checksums |
8d06b3e48b1990b3b0c26209a9dd10ea2dbb25ed6100311fec8df57ec6aadb97
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp310-cp310-win_amd64.whl
| Download URL | SeqTools-1.4.1-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 37.3 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
94a589f13e9a69c71448ff700c6808f52703b2e39c0466eb587a37bcf6312dd9
|
|
BLAKE2b-256 checksum How to use checksums |
047ab21ac49463d2f543c4b4703702824d5712ebb38c7f2e154e70b2e0a792f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | SeqTools-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 44.6 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
7c83cadda3d4b4ec278b661895b096f54aa8b183deea1999f7b2c6124456d5cc
|
|
BLAKE2b-256 checksum How to use checksums |
f820dcadcb4915ad072b086e6d60d3efeda233b0e31c048052de67217bb9181e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | SeqTools-1.4.1-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 34.7 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
357ed0b1bb0537dafa65be3970ad49d4fcbef160d45188fe22626dbccd42b55c
|
|
BLAKE2b-256 checksum How to use checksums |
e06faae9c87203579beaa0175801d6a7c5e12dcfc4667fde7881409e2f915c47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl
| Download URL | SeqTools-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl |
|---|---|
| Size | 34.3 kB |
| Tags | CPython 3.10 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
b4449b210b7858f1fe16702afebfcd5ba7b465c6c4bc8ca69745728cb21d0f2a
|
|
BLAKE2b-256 checksum How to use checksums |
89f7a12c1a6d65d1654e7ed3beed042397307c383bac6c67e51f1c0ea2ec359b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp39-cp39-win_amd64.whl
| Download URL | SeqTools-1.4.1-cp39-cp39-win_amd64.whl |
|---|---|
| Size | 37.3 kB |
| Tags | CPython 3.9 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8e10f13caf9ae482fd1ae52819d89b6722536e7da0e15560eb54191c2c57cd9e
|
|
BLAKE2b-256 checksum How to use checksums |
482fedc35e25bc723edee5cf0fbca5997efa4fbc392bb1d27e77422aed14d5c8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | SeqTools-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 44.5 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 Linux glibc 2.5+ x86-64 |
|
SHA-256 checksum How to use checksums |
f8ba54294fb9271b4f0e3027d33623416681f3a5db2e4b20aa8578e0b8929c1f
|
|
BLAKE2b-256 checksum How to use checksums |
12c94fe854d9deef333a7fe2904cf2625773bb51db2006830e1ebe0a9188ccc6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp39-cp39-macosx_11_0_arm64.whl
| Download URL | SeqTools-1.4.1-cp39-cp39-macosx_11_0_arm64.whl |
|---|---|
| Size | 34.6 kB |
| Tags | CPython 3.9 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1a304f1fb86dbb0f7fb233d01a2387165087009636f3c46a57339e70edc4565b
|
|
BLAKE2b-256 checksum How to use checksums |
eff8684288214767608fe3e27c96e2c703f8e2b82e537f86373200f68917d863
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|
Release files / SeqTools-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl
| Download URL | SeqTools-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl |
|---|---|
| Size | 34.2 kB |
| Tags | CPython 3.9 macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
0f7f947d592f7d1692b51d1670f35ce4f5b1631217a1afd2473214400bfd3ba9
|
|
BLAKE2b-256 checksum How to use checksums |
be079c2344eef34cf3dc5c514c36db899490e52a4d4b6f298dad7c4b9e104132
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.3
|