---
name: autostorage
description: >
  Use when writing Python code that uses the autostorage package.
license: MIT
compatibility: Requires Python >= 3.13.
---

# autostorage

## Installation

```bash
pip install autostorage
```

## API overview

### Classes

Core classes

- `Database`: Database connection manager
- `AutostorageSession`: `sqlmodel.Session` with autostorage's validation and identity listeners
- `IdentityAlgorithm`: A registered identity algorithm
- `IdentityAlgorithmRegistry`: Central registry of all known identity algorithms
- `CalculationGeometryLink`: Association table linking geometries to a calculation
- `CalculationRow`: Quantum chemistry calculation and its associated data
- `CalculationTrajectoryLink`: Association table linking trajectories to a calculation
- `GeometryRow`: Molecular geometry definition and metadata
- `GeometryTrajectoryLink`: Association table linking geometries to a trajectory
- `IdentityAlgorithmRow`: A chemical identifier algorithm, mirroring an `IdentityAlgorithm`
- `IdentityRow`: A chemical identifier associated with one or more stationary points
- `IdentityStationaryLink`: Association table linking chemical identities to stationary points
- `ModelRow`: Calculation model specification
- `PropertyKindRow`: A kind of property (e.g. ``energy``, ``gradient``, ``hessian``)
- `PropertyValueRow`: Property value for a specific geometry and calculation
- `StageRow`: A chemical state (reactant, product, or transition state) in a reaction
- `StageStationaryLink`: Association table linking stationary points to reaction stages
- `StationaryPointRow`: A stationary point on a potential energy surface
- `StepRow`: An elementary reaction step connecting a reactant, TS, and product
- `StepValidationLink`: Association table linking validations to a step
- `TrajectoryAxisRow`: Physical coordinate that one dimension of a trajectory runs along
- `TrajectoryRow`: Ordered sequence of geometries from a calculation trajectory
- `ValidationRow`: Validation result for a specific step and calculation
- `PropertyKind`: A registered kind of property
- `PropertyKindRegistry`: Central registry of all known property kinds
- `types.CompressedArrayTypeDecorator`
- `types.CompressedJSONTypeDecorator`

### Protocols

Structural typing protocols

- `IdentityProtocol`: Protocol for identity functions
- `PropertyValidationProtocol`: Protocol for property value validation functions

### Enumerations

Enum types

- `AxisKind`: Physical coordinate that a trajectory dimension runs along
- `IdentityKind`: Category of molecular identity, from coarsest to finest
- `Role`: Relationship between calculations and geometries/trajectories

### Exceptions

Exception classes

- `IdentityGenerationWarning`: An identity algorithm could not generate an identity for a geometry
- `StationaryOrderWarning`: A stationary point's Hessian does not have the point's `order`

### Functions

Public functions

- `geometry_hash`: SHA-256 digest of a Geometry's symbols, coordinates, charge, and spin
- `events.create_identity_algorithms`
- `events.create_property_kinds`
- `events.set_geometry_hash`
- `events.sort_step_stage_ids`
- `events.verify_step_barrierless_consistency`
- `events.verify_property_values_before_flush`
- `events.verify_valid_stationary_has_hessian`
- `events.validate_stationary_order_before_flush`
- `events.verify_trajectory_geometry_ndim`
- `events.fill_trajectory_axis_values`
- `events.add_registry_identities_before_flush`
- `query.stationary_point_by_identity`
- `identity.rdkit_inchi_conn_identity_fn`
- `identity.rdkit_inchi_identity_fn`
- `identity.rdkit_smiles_identity_fn`
- `identity.hill_formula_identity_fn`

### Constants

Module-level constants and data

- `hill_formula`: A registered identity algorithm
- `rdkit_inchi`: A registered identity algorithm
- `rdkit_inchi_conn`: A registered identity algorithm
- `rdkit_smiles`: A registered identity algorithm
- `energy_property_kind`: A registered kind of property
- `gradient_property_kind`: A registered kind of property
- `hessian_property_kind`: A registered kind of property
- `types.MAX_DECOMPRESSED_BYTES`

### Type Aliases

Type alias definitions

- `identity.OtherGeometries`

## Resources

- [Full documentation](https://avcopan.github.io/autostorage/)
- [llms.txt](llms.txt) — Indexed API reference for LLMs
- [llms-full.txt](llms-full.txt) — Comprehensive documentation for LLMs
- [Source code](https://github.com/avcopan/autostorage)
