Skip to main content

A SQLite chemical database.

Project description

Author:

Lukas Turcani

Docs:

https://atomlite.readthedocs.io

AtomLite

AtomLite is a Python library for simple molecular database on top of SQLite.

For an alternative to AtomLite, which provides stronger integration with RDKit, and a greater focus on cheminformatics, see chemicalite.

Installation

pip install atomlite

Quickstart

You can see a lot more examples in our docs but here is a taste of using AtomLite:

import atomlite
import rdkit.Chem as rdkit
# Create a database.
db = atomlite.Database("molecules.db")
# Create database entries.
entry1 = atomlite.Entry.from_rdkit("first", rdkit.MolFromSmiles("C"), {"prop1": "hi", "prop2": 100})
entry2 = atomlite.Entry.from_rdkit("second", rdkit.MolFromSmiles("CN"), {"prop1": "thing", "prop2": 203})
# Add entries to database.
db.add_entries([entry1, entry2])
# Retrieve entries from database.
for entry in db.get_entries(["first", "second"]):
  molecule = atomlite.json_to_rdkit(entry.molecule)
  print(entry.properties)
{'prop1': 'hi', 'prop2': 100}
{'prop1': 'thing', 'prop2': 203}
db.get_property_df(["$.prop1", "$.prop2"])
shape: (2, 3)
┌────────┬─────────┬─────────┐
│ key    ┆ $.prop1 ┆ $.prop2 │
│ ---    ┆ ---     ┆ ---     │
│ str    ┆ str     ┆ i64     │
╞════════╪═════════╪═════════╡
│ first  ┆ hi      ┆ 100     │
│ second ┆ thing   ┆ 203     │
└────────┴─────────┴─────────┘

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

atomlite-4.4.5.tar.gz (37.9 kB view hashes)

Uploaded Source

Built Distribution

atomlite-4.4.5-py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 3

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