Skip to main content

MMap File-Backed Arrays for Python

Project description

(c) 2014 Farsight Security Inc. (c) 2010 Victor Ng

Released under the MIT license. See license.txt.

About

This library provides persistent, shared, disk-backed arrays with a similar structure to the built-in array module. You might want to use this if you have a dataset that is larger than available physical memory, or if you want to reduce startup time for your program by loading data on demand, or if you want yet another way to share memory between processes.

Compatible with Python 2.7 and Python 3.x. Supports locked pages on Linux >= 2.5.37 with the want_lock parameter to mmaparray.array() and mmaparray.MMap<type>Array.__init__().

Usage

import mmapfile

a = mmapfile.array('example.array', 'I', 100)
for i in range(0, len(a)):
    a[i] = i

for i, val in enumerate(a):
    print ('a[{}] = {}'.format(i, val))

a.flush()
a.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

mmaparray-0.2.1.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file mmaparray-0.2.1.tar.gz.

File metadata

  • Download URL: mmaparray-0.2.1.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mmaparray-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7f9113a793637e6da153a3e27c3e991613997cbeb11abe2e6866dfd809ba7c91
MD5 6995255b4a8ad3ce583cd218a52cd973
BLAKE2b-256 10493115d66b9644a7fc9c896d27f96a0af23808988293e28e54998bb735bc42

See more details on using hashes here.

Supported by

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