# Installation

> UStore for Python

```sh
git submodule update --init --recursive
pip install .
python -c "import ustore; print(ustore.__version__, ustore.version(), ustore.engines_compiled())"
```

`__version__` names the package, pre-release included, while `ustore.version()` answers `ustore_version_name`, the version of the library the module runs against.

`pyproject.toml` builds through `scikit-build-core`, which drives the project's own CMake tree, so there is no `setup.py`.
The wheel compiles the RAM, RocksDB and LevelDB engines, and leaves NVMe out until its sources build again.
An engine is left out through the standard `CMAKE_ARGS` or through scikit-build config settings, never through variables of UStore's own:

```sh
CMAKE_ARGS="-DUSTORE_WITH_ROCKSDB=OFF -DUSTORE_WITH_LEVELDB=OFF" pip install .
pip install . --config-settings=cmake.define.USTORE_WITH_LEVELDB=OFF
```

`cibuildwheel` builds wheels for CPython 3.12, 3.13, 3.14 and 3.15, and for the free-threaded 3.14t and 3.15t, where importing `ustore` keeps the GIL disabled.
`engines_compiled()` names the engines a build carries, each opened through its own class method: `Database.open_ram()`, `open_rocksdb()`, `open_leveldb()` or `open_nvme()`, and `view_rocksdb()` for a read-only RocksDB database.
`open_ram(directory)` persists the database as one image in that directory, while `open_ram()` keeps it in memory alone.
`open_nvme(manifest)` names the database by its manifest, `<database>.ustore.json` in an existing directory or the raw address of its first slot, such as `/dev/nvme0n1@64GiB`, and a snapshot of it saves to a manifest path too.
`open_ram` and `open_nvme` take a `cpu_class=` keyword, a `CPUClass` that confines the database's waits, atomics and string kernels, and raise `UnsupportedError` where the CPU does not run it.

`import ustore`

## version

The version of the library this module runs against, like "1.0.0".

```python
def version() -> str
```

Calls `ustore_version_name`.

## engines_compiled

The engines this build carries: some of "ram", "rocksdb", "leveldb" and "nvme", in that order.

```python
def engines_compiled() -> tuple[str, ...]
```

