Skip to main content

Test TestPip DeepSource

The Tarproc Utilities

Tarfiles are commonly used for storing large amounts of data in an efficient, sequential access, compressed file format, in particualr for deep learning applications. For processing and data transformation, people usually unpack them, operate over the files, and tar up the result again.

This library and set of utilities permits operating directly on tar files. This is faster than operating on files on file systems, and it is usually easier too.

  • tarcats -- concatenate tar files sequentially
  • tarsplit -- split a tar file by number of records or size
  • tarpcat -- concatenate tar files in parallel
  • tarproc -- map command line programs over tar files
  • tarshow -- show contents of tar files
  • tarsort -- sort tar files based on some key

The following are less commonly used utilities that are specifically useful for deep learning:

  • tarfirst -- extract the first file matching some criteria
  • targrep -- grep through files inside tar files (this will replace tarfirst)
  • tar2db, tar2lmdb, tar2tsv -- convert tar files to database files
  • tarmix -- mix tar files based on statistical sampling
  • tsv2tar -- build tar files based on a .tsv file plan

The utilities allow operating on stdin/stdout when necessary, allowing command line pipes to be constructed. For example:

    $ gsutil cat gs://bucket/file.tar | tarsort | tarsplit -o output

Python Interface

from tarproclib import reader, gopen
from itertools import islice

gopen.handlers["gs"] = "gsutil cat '{}'"

for sample in islice(reader.TarIterator("gs://lpr-imagenet/imagenet_train-0000.tgz"), 0, 10):
    print(sample.keys())
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])
dict_keys(['__key__', 'cls', 'jpg', 'json', '__source__'])

Metadata

Release files for tarproc 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tarproc 0.0.6
File Size Uploaded
tarproc-0.0.6.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tarproc 0.0.6
File Interpreter ABI Platform
tarproc-0.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 44.6 kB

Release files / tarproc-0.0.6.tar.gz

Download URL tarproc-0.0.6.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
36b9f0c1a0c4fec6dfe390a59a2b829de115ddbd2691f1919527ea8f9a95cb16
BLAKE2b-256 checksum
How to use checksums
eff7975a3cdddce36492dd62f7b8793a816175678710258e396c038da7403acb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

Release files / tarproc-0.0.6-py3-none-any.whl

Download URL tarproc-0.0.6-py3-none-any.whl
Size 26.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f6999ec437cfcfb7d536c097b5b6efd42722dffa218bdf35d9b57a5115c4cbd4
BLAKE2b-256 checksum
How to use checksums
b1c746318882d5b845c3e0be513447d9b708782619fbee2c0910e0b4fab201d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page