Metadata-Version: 2.1
Name: atomlite
Version: 4.4.4
Summary: A SQLite chemical database.
Maintainer-email: Lukas Turcani <lukasturcani93@gmail.com>
Project-URL: github, https://github.com/lukasturcani/atomlite
Project-URL: documentation, https://atomlite.readthedocs.io
Requires-Python: >=3.11
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: polars
Requires-Dist: rdkit
Provides-Extra: dev
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: numpy; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: sphinx; extra == "dev"
Requires-Dist: sphinx-copybutton; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: furo; extra == "dev"

: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_.

.. _SQLite: https://docs.python.org/3/library/sqlite3.html
.. _chemicalite: https://github.com/rvianello/chemicalite


Installation
============

.. code-block:: bash

  pip install atomlite

Quickstart
==========

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

.. code-block:: python

  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}

.. code-block:: python

  db.get_property_df(["$.prop1", "$.prop2"])

::

  shape: (2, 3)
  ┌────────┬─────────┬─────────┐
  │ key    ┆ $.prop1 ┆ $.prop2 │
  │ ---    ┆ ---     ┆ ---     │
  │ str    ┆ str     ┆ i64     │
  ╞════════╪═════════╪═════════╡
  │ first  ┆ hi      ┆ 100     │
  │ second ┆ thing   ┆ 203     │
  └────────┴─────────┴─────────┘

.. _docs: https://atomlite.readthedocs.io
