Skip to main content

A python package that can fast random access any lines in a large file without high memory cost.

Project description

LineCache caches the line position of a file in the memory. Everytime it access a line, it will seek to the related postion and readline().

Noticing that it may cost some time when you first cache lines of a file.

Usage:

from linecache_light import LineCache

linecache = LineCache(‘a.txt’, cache_suffix=’.cache’)

num_lines = len(linecache)

line_0 = linecache[0]

line_100 = linecache[100]

line_indexing= linecache[[2,3,4,5]]

line_indexing = linecache[-1]

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

linecache-light-0.1.4.linux-x86_64.tar.gz (3.3 kB view details)

Uploaded Source

File details

Details for the file linecache-light-0.1.4.linux-x86_64.tar.gz.

File metadata

  • Download URL: linecache-light-0.1.4.linux-x86_64.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.9

File hashes

Hashes for linecache-light-0.1.4.linux-x86_64.tar.gz
Algorithm Hash digest
SHA256 e63e54fe5d0f534fd8248dc16e8fe084f9c554cf940952af723fe5a7d6920c5b
MD5 5abfc7436225e13203a85833aefc7ec7
BLAKE2b-256 d7ec146bb07c8ca9b6e45d85413613800557ad383ac3b3333abbf750f986cdb1

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