ozmadb-py


Nameozmadb-py JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://ozma.io/
SummaryPython client library for interacting with the OzmaDB API
upload_time2024-08-04 04:03:45
maintainerNone
docs_urlNone
authorNikolay Amiantov
requires_python>=3.10
licenseApache-2.0
keywords ozmadb database database-client python client
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 Python Client](#ozmadb-python-client)
  - [Table of Contents](#table-of-contents)
  - [OzmaDB Features](#ozmadb-features)
  - [Installation](#installation)
  - [Usage](#usage)
    - [Authentication](#authentication)
    - [Instance Management](#instance-management)
    - [Database Operations](#database-operations)
    - [Schemas Management](#schemas-management)
  - [License](#license)
  - [Contact and Support](#contact-and-support)

## 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:

```sh
pip install ozmadb-py
```

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

```python
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`:

```python 
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`:

```python
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

```python
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](https://github.com/ozma-io/ozmadb/blob/9d5d920aec8d71ed690404a070d4ed6906e2ca1f/LICENSE) file for more details.

## Contact and Support

For more information, visit [OzmaDB](https://github.com/ozma-io/ozmadb) repository.

If you have any questions or need support, feel free to reach out to our community or contact us via our [Discord](https://discord.gg/Mc8YcF63yt).





            

Raw data

            {
    "_id": null,
    "home_page": "https://ozma.io/",
    "name": "ozmadb-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "ozmadb, database, database-client, python, client",
    "author": "Nikolay Amiantov",
    "author_email": "namiantov@ozma.io",
    "download_url": "https://files.pythonhosted.org/packages/f0/c4/644254f06d44fef932ebbcb4c24141b06d2b17eecd7457f6521d8f2578b8/ozmadb_py-0.0.4.tar.gz",
    "platform": null,
    "description": "# OzmaDB Python Client\n\nOzmaDB 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.\n\n## Table of Contents\n\n- [OzmaDB Python Client](#ozmadb-python-client)\n  - [Table of Contents](#table-of-contents)\n  - [OzmaDB Features](#ozmadb-features)\n  - [Installation](#installation)\n  - [Usage](#usage)\n    - [Authentication](#authentication)\n    - [Instance Management](#instance-management)\n    - [Database Operations](#database-operations)\n    - [Schemas Management](#schemas-management)\n  - [License](#license)\n  - [Contact and Support](#contact-and-support)\n\n## OzmaDB Features\n\n- **Customizable Metadata**: All information about schemas, tables, columns, and permissions is stored in tables and can be edited in real-time.\n- **System Fields**: Each entity has system fields like `id` and `sub_entity` which are automatically managed.\n- **System Tables**: Comprehensive management of schemas, entities, columns, constraints, indexes, and more.\n- **Public API**: Interact directly with your data through a public API.\n- **Security Roles**: Fine-grained security roles to control access to data.\n- **Open-Source**: Completely open-source project.\n\n## Installation\n\nTo install the OzmaDB Python Client, run:\n\n```sh\npip install ozmadb-py\n```\n\n## Usage\n### Authentication\nTo authenticate with the OzmaDB API, you need to create an instance of `OzmaAuth`:\n\n```python\nfrom ozmadb.auth import OzmaAuth\n\nauth = OzmaAuth(\n    client_id='your_client_id',\n    client_secret='your_client_secret',\n    login='your_login',\n    password='your_password'\n)\n```\n\n### Instance Management\nTo manage instances, use the `OzmaInstancesAPI`:\n\n```python \nfrom ozmadb.instances import OzmaInstancesAPI, NewInstance\n\ninstances_api = OzmaInstancesAPI(auth)\n\n# Get instances\ninstances = await instances_api.get_instances()\n\n# Create a new instance\nnew_instance = NewInstance(name='new_instance_name')\ncreated_instance = await instances_api.create_instance(new_instance)\n\n# Delete an instance\nawait instances_api.delete_instance('instance_name')\n```\n\n### Database Operations\nTo perform database operations, use the `OzmaDBAPI`:\n\n```python\nfrom ozmadb.ozmadb import OzmaDBAPI\n\ndb_api = OzmaDBAPI(auth, name='your_instance_name')\n\n# Get a named user view\nresult = await db_api.get_named_user_view('schema_name', 'view_name')\n\n# Run a transaction\nfrom ozmadb_py.types import OzmaDBInsertEntityOp, OzmaDBEntityRef\n\noperations = [\n    OzmaDBInsertEntityOp(\n        entity=OzmaDBEntityRef(schema_name='your_schema', name='your_entity'),\n        fields={'field_name': 'value'}\n    )\n]\ntransaction_result = await db_api.run_transaction(operations)\n\n# Run an action\naction_result = await db_api.run_action('schema_name', 'action_name')\n```\n\n### Schemas Management\n\n```python\nfrom ozmadb.ozmadb import OzmaDBAPI\n\ndb_api = OzmaDBAPI(auth, name='your_instance_name')\n\n# Save schemas\nsaved_schemas = await db_api.save_schemas(schemas=['schema1', 'schema2'])\n\n# Restore schemas\nawait db_api.restore_schemas(saved_schemas, drop_others=True)\n```\n\n## License\nThis project is licensed under the Apache 2.0 License. See the [LICENSE](https://github.com/ozma-io/ozmadb/blob/9d5d920aec8d71ed690404a070d4ed6906e2ca1f/LICENSE) file for more details.\n\n## Contact and Support\n\nFor more information, visit [OzmaDB](https://github.com/ozma-io/ozmadb) repository.\n\nIf you have any questions or need support, feel free to reach out to our community or contact us via our [Discord](https://discord.gg/Mc8YcF63yt).\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Python client library for interacting with the OzmaDB API",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://ozma.io/",
        "Repository": "https://github.com/ozma-io/ozmadb"
    },
    "split_keywords": [
        "ozmadb",
        " database",
        " database-client",
        " python",
        " client"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f0c4644254f06d44fef932ebbcb4c24141b06d2b17eecd7457f6521d8f2578b8",
                "md5": "d66ae6e122ed2e785efc725d2c2681d3",
                "sha256": "7bc03790c71eb2348ea7447d690496b91855516821057dada20a269834f23ed3"
            },
            "downloads": -1,
            "filename": "ozmadb_py-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "d66ae6e122ed2e785efc725d2c2681d3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 12598,
            "upload_time": "2024-08-04T04:03:45",
            "upload_time_iso_8601": "2024-08-04T04:03:45.875478Z",
            "url": "https://files.pythonhosted.org/packages/f0/c4/644254f06d44fef932ebbcb4c24141b06d2b17eecd7457f6521d8f2578b8/ozmadb_py-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-04 04:03:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ozma-io",
    "github_project": "ozmadb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ozmadb-py"
}
        
Elapsed time: 0.28740s