Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ozmadb-py

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ozmadb-py

Python client library for interacting with the OzmaDB API

  • 0.0.4
  • PyPI
  • Socket score

Maintainers
1

OzmaDB Python Client

OzmaDB Python Client is a robust and easy-to-use client library for interacting with the OzmaDB API. It allows you to efficiently manage customizable metadata, execute queries, handle data persistence, and enforce security roles. Ideal for developers building on the ozma.io platform, this client simplifies integration with the powerful open-source OzmaDB engine.

Table of Contents

OzmaDB Features

  • Customizable Metadata: All information about schemas, tables, columns, and permissions is stored in tables and can be edited in real-time.
  • System Fields: Each entity has system fields like id and sub_entity which are automatically managed.
  • System Tables: Comprehensive management of schemas, entities, columns, constraints, indexes, and more.
  • Public API: Interact directly with your data through a public API.
  • Security Roles: Fine-grained security roles to control access to data.
  • Open-Source: Completely open-source project.

Installation

To install the OzmaDB Python Client, run:

pip install ozmadb-py

Usage

Authentication

To authenticate with the OzmaDB API, you need to create an instance of OzmaAuth:

from ozmadb.auth import OzmaAuth

auth = OzmaAuth(
    client_id='your_client_id',
    client_secret='your_client_secret',
    login='your_login',
    password='your_password'
)

Instance Management

To manage instances, use the OzmaInstancesAPI:

from ozmadb.instances import OzmaInstancesAPI, NewInstance

instances_api = OzmaInstancesAPI(auth)

# Get instances
instances = await instances_api.get_instances()

# Create a new instance
new_instance = NewInstance(name='new_instance_name')
created_instance = await instances_api.create_instance(new_instance)

# Delete an instance
await instances_api.delete_instance('instance_name')

Database Operations

To perform database operations, use the OzmaDBAPI:

from ozmadb.ozmadb import OzmaDBAPI

db_api = OzmaDBAPI(auth, name='your_instance_name')

# Get a named user view
result = await db_api.get_named_user_view('schema_name', 'view_name')

# Run a transaction
from ozmadb_py.types import OzmaDBInsertEntityOp, OzmaDBEntityRef

operations = [
    OzmaDBInsertEntityOp(
        entity=OzmaDBEntityRef(schema_name='your_schema', name='your_entity'),
        fields={'field_name': 'value'}
    )
]
transaction_result = await db_api.run_transaction(operations)

# Run an action
action_result = await db_api.run_action('schema_name', 'action_name')

Schemas Management

from ozmadb.ozmadb import OzmaDBAPI

db_api = OzmaDBAPI(auth, name='your_instance_name')

# Save schemas
saved_schemas = await db_api.save_schemas(schemas=['schema1', 'schema2'])

# Restore schemas
await db_api.restore_schemas(saved_schemas, drop_others=True)

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.

Contact and Support

For more information, visit OzmaDB repository.

If you have any questions or need support, feel free to reach out to our community or contact us via our Discord.

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc