Skip to main content

mmap.ninja: Memory mapped data structures

Project description

mmap.ninja Python API

Extension to numpy.memmap, which currently includes a RaggedMemoryMap (where the elements are of different shape), and a StringsMmmap (which is about 9 times faster than just storing your documents as text files).

Currently under active development, API is not yet stable.

Examples:

from mmap_ninja.string import StringsMmmap
from pathlib import Path

tmp_path = Path('.')
memmap = StringsMmmap.open_existing(tmp_path / 'strings_memmap')
for i in range(len(memmap)):
    print(memmap[i])
memmap.close()
from mmap_ninja.ragged import RaggedMMap
from pathlib import Path

tmp_path = Path('.')
memmap = RaggedMMap.open_existing(tmp_path / 'ragged')
for i in range(len(memmap)):
    print(memmap[i])
memmap.close()

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

mmap_ninja-0.1.0.tar.gz (4.8 kB view hashes)

Uploaded Source

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