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
Close
Hashes for linecache-light-0.1.4.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e63e54fe5d0f534fd8248dc16e8fe084f9c554cf940952af723fe5a7d6920c5b |
|
MD5 | 5abfc7436225e13203a85833aefc7ec7 |
|
BLAKE2b-256 | d7ec146bb07c8ca9b6e45d85413613800557ad383ac3b3333abbf750f986cdb1 |