API Overview

This gives an overview of the ObjectBox Python API by showing most important parts to get started.

For beginners, we recommend our Python database docs at for more details; especially the Getting Started guide. This covers more than just the obligatory pip install --upgrade objectbox.

Defining the Data Model

The @Entity decorator is used to define a class as an ObjectBox entity.

Entity

Entity decorator for user classes using syntax @Entity([uid=])

Each entity class defines a set of properties. The following property types are most commonly used:

Id

Id Property

String

String Property

Int32

Integer 32-bit Property

Int64

Integer 64-bit Property

Float32

Floating-point 32-bit Property

Float64

Floating-point 64-bit Property

Date

Date Property

Float32Vector

Floating-point 32-bit Vector Property

Note: Float32Vector is used for on-device vector search.

Classes

Now, with the data model defined, you can start using the ObjectBox database. These are the main classes to interact with:

Store

ObjectBox Database

Box

Interface to Entities

Query

Query is a reusable object that allows you to find objects in the database.

What’s next