Skip to main content

LMDB-based storage for ASE.

Project description

asebytes

Efficient serialization and storage for ASE Atoms objects using LMDB.

API

  • encode(atoms) - Encode an ASE Atoms object to a dict of bytes
  • decode(data) - Decode bytes back into an ASE Atoms object
  • BytesIO(file, prefix) - LMDB-backed list-like storage for bytes dictionaries
  • ASEIO(file, prefix) - LMDB-backed list-like storage for ASE Atoms objects

Examples

from asebytes import ASEIO, BytesIO, encode, decode
import molify

# Generate conformers from SMILES
ethanol = molify.smiles2conformers("CCO", numConfs=100)

# Serialize/deserialize single molecule
data = encode(ethanol[0])
atoms_restored = decode(data)

# High-level: Store Atoms objects directly
db = ASEIO("conformers.lmdb")
db.extend(ethanol)  # Add all conformers
mol = db[0]         # Returns ase.Atoms

# Low-level: BytesIO stores serialized data
bytes_db = BytesIO("conformers.lmdb")
bytes_db.append(encode(ethanol[0]))      # Manual serialization
data = bytes_db[0]                       # Returns dict[bytes, bytes]
mol = decode(data)                       # Manual deserialization

# ASEIO = BytesIO + automatic encode/decode

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

asebytes-0.1.3.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

asebytes-0.1.3-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file asebytes-0.1.3.tar.gz.

File metadata

  • Download URL: asebytes-0.1.3.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for asebytes-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a69f16514e66f1231bb2ad95fc74bc812151bca53f7f8d6cda407e653ec215bb
MD5 5a4ec7af99b5cd9c7d8cf552e97ee717
BLAKE2b-256 e80a002941d36de59bee5f914208317ef180cc39a7511c68f8fcb2fac21bb520

See more details on using hashes here.

File details

Details for the file asebytes-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: asebytes-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for asebytes-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fb0cc25d9ca12344071fa4eec6fab66f08cde34a16e0ae73deff906d096a6211
MD5 3a2e63fc4be5f126ab8049a2c8ea7d21
BLAKE2b-256 01cb72a75b6c2f343c92d2612eef5f18a4c09f3b8a26caf12e80cd81696c22d2

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