Skip to main content

ObjectBox is a superfast lightweight database for objects

Project description

ObjectBox Python

ObjectBox Python is a lightweight yet powerful on-device database & vector database. Store Python objects and vectors directly with an easy-to-use CRUD API while enjoying exceptional speed and efficiency. And because it's an embedded database, there's no setup required.

Its advanced vector search empowers AI applications including RAG, generative AI, and similarity searches.

Designed for high performance, the ObjectBox database runs locally on-device. As an offline-first solution, ObjectBox makes sure your app reliably works offline as well as online (via Sync).

Table of Contents

Feature Highlights

🏁 On-device vector database - for AI apps that work any place.
🏁 High performance - superfast response rates enabling real-time applications.
🪂 ACID compliant - Atomic, Consistent, Isolated, Durable.
🌱 Scalable - grows with your app, handling millions of objects with ease.
💚 Sustainable - frugal on CPU, Memory and battery / power use, reducing CO2 emissions.
💐 Queries - filter data as needed, even across relations.
💻 Multiplatform - Get native speed on your favorite platforms.\

  • Linux x86-64 (64-bit)
  • Linux ARMv6hf (e.g. Raspberry PI Zero)
  • Linux ARMv7hf (e.g. Raspberry PI 3)
  • Linux ARMv8 (e.g. Raspberry PI 4, 5, etc.)
  • MacOS x86-64 and arm64 (Intel 64-bit and Apple Silicon)
  • Windows x86-64 (64-bit)

Code Example (CRUD - Create, Read, Update, Delete)

What does using ObjectBox in Python look like?

from objectbox import *

@Entity()
class Person:
    id = Id
    name = String

# The ObjectBox Store represents a database; keep it around...
store = Store()

# Get a box for the "Person" entity; a Box is the main interaction point with objects and the database.
box = store.box(Person)

person = Person()
person.name = "Joe Green"
id = box.put(person)  # Create
person = box.get(id)  # Read
person.name = "Joe Black"
box.put(person)       # Update
box.remove(person)    # Delete

Getting started

Latest version: 4.0.0 (2024-05-28)

To install or update the latest version of ObjectBox, run this:

pip install --upgrade objectbox

Now you are ready to use ObjectBox in your Python project.

Head over to the ObjectBox documentation and learn how to setup your first entity classes.

Examples

Do you prefer to dive right into working examples? We have you covered in the example folder. It comes with a task list application and a vector search example using cities. Additionally, for AI enthusiasts, we provide an "ollama" example, which integrates a local LLM (via ollama) with ObjectBox to manage and search embeddings effectively.

Alpha Notes

While ObjectBox Python is powered by a rock stable core written in C/C++, we label our Python binding still "alpha." We do this to manage expectations as some quality of life improvements are yet to come to our Python binding. This is mostly about "model management," which still requires you to do some manual coding setup, e.g. for model IDs. The final release will take care of this for you automatically.

Help wanted

ObjectBox for Python is open to contributions. The ObjectBox team will try its best to guide you and answer questions. See CONTRIBUTING.md to get started.

Feedback

We are looking for your feedback! Please let us know what you think about ObjectBox for Python and how we can improve it.

License

Copyright 2019-2024 ObjectBox Ltd. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

objectbox-4.0.0-py3-none-any.whl (4.0 MB view details)

Uploaded Python 3

File details

Details for the file objectbox-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: objectbox-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for objectbox-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb1281660ede3923501c47a68c6ad97e551c44061828530731525c7b271cfb2f
MD5 2e3a2e45c4cbbe1123a86cb7b6eae91d
BLAKE2b-256 a2b909f6521a35842542fe889a357722a35ff81ddcbed48ac9c086d996bec50b

See more details on using hashes here.

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