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.3.tar.gz (1.8 kB view details)

Uploaded Source

File details

Details for the file linecache-light-0.1.3.tar.gz.

File metadata

File hashes

Hashes for linecache-light-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7ecb9708f7d67db442464ef0b3f37be2c9152dde2bb6474ac1660b3ae691c23f
MD5 615d1120f68d56832d956f867be20cda
BLAKE2b-256 385bec41f422fd558c7aa9962391f1f644fea2625798c39a79c8b4afafbc7a19

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page