odbms


Nameodbms JSON
Version 0.3.7 PyPI version JSON
download
home_pageNone
SummaryDatabase client for Mysql, MongoDB and Sqlite
upload_time2024-09-09 16:32:10
maintainerNone
docs_urlNone
authorAmos Amissah
requires_pythonNone
licenseNone
keywords python3 runit developer serverless architecture docker sqlite mysql mongodb
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # odbms

odbms is a Python package for managing MySQL, MongoDB, SQLite, and PostgreSQL database instances.

## Features

- Supports multiple database management systems (MySQL, MongoDB, SQLite, PostgreSQL)
- Provides a unified interface for database operations across different DBMSs
- Includes an ORM-like model system for easy data manipulation
- Supports table creation, alteration, and basic CRUD operations

## Installation

Install odbms using pip:

```shell
pip install odbms
```

## Usage

```python
from odbms import DBMS

# Initialize with default settings
DBMS.initialize_with_defaults('sqlite', 'database_name')

# Or initialize with custom settings
DBMS.initialize('postgresql', port=5432, username='postgres', password='', database='database_name')
```

```python
from odbms import Model

class User(Model):
    TABLE_NAME = 'users'

    def init(self, email: str, name: str, password: str, image: str = '', gat: str ='', grt: str ='', created_at=None, updated_at=None, id=None):
        super().init(created_at, updated_at, id)

        self.email = email
        self.name = name
        self.password = password
        self.image = image
        self.gat = gat
        self.grt = grt

#Create the table if not mongodb (sqlite, mysql, postgresql)
User.create_table()
```

```python
# Insert a new user
new_user = User('test@user.com', 'Test User', 'MyPassword')
new_user.save()

# Retrieve all users
users = User.all()

# Find a specific user
user = User.find_one({'email': 'test@user.com'})

# Update a user
user.name = 'Updated Name'
user.save()

# Get the json representation of the user
user.json()

# Delete a user
Delete a user
User.remove({'email': 'test@user.com'})
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "odbms",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "python3 runit developer serverless architecture docker sqlite mysql mongodb",
    "author": "Amos Amissah",
    "author_email": "theonlyamos@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/97/c8/b441dc046a5b56eae712a41f236bc73627be804d7f5aedfb4e22307c3da6/odbms-0.3.7.tar.gz",
    "platform": null,
    "description": "# odbms\n\nodbms is a Python package for managing MySQL, MongoDB, SQLite, and PostgreSQL database instances.\n\n## Features\n\n- Supports multiple database management systems (MySQL, MongoDB, SQLite, PostgreSQL)\n- Provides a unified interface for database operations across different DBMSs\n- Includes an ORM-like model system for easy data manipulation\n- Supports table creation, alteration, and basic CRUD operations\n\n## Installation\n\nInstall odbms using pip:\n\n```shell\npip install odbms\n```\n\n## Usage\n\n```python\nfrom odbms import DBMS\n\n# Initialize with default settings\nDBMS.initialize_with_defaults('sqlite', 'database_name')\n\n# Or initialize with custom settings\nDBMS.initialize('postgresql', port=5432, username='postgres', password='', database='database_name')\n```\n\n```python\nfrom odbms import Model\n\nclass User(Model):\n    TABLE_NAME = 'users'\n\n    def init(self, email: str, name: str, password: str, image: str = '', gat: str ='', grt: str ='', created_at=None, updated_at=None, id=None):\n        super().init(created_at, updated_at, id)\n\n        self.email = email\n        self.name = name\n        self.password = password\n        self.image = image\n        self.gat = gat\n        self.grt = grt\n\n#Create the table if not mongodb (sqlite, mysql, postgresql)\nUser.create_table()\n```\n\n```python\n# Insert a new user\nnew_user = User('test@user.com', 'Test User', 'MyPassword')\nnew_user.save()\n\n# Retrieve all users\nusers = User.all()\n\n# Find a specific user\nuser = User.find_one({'email': 'test@user.com'})\n\n# Update a user\nuser.name = 'Updated Name'\nuser.save()\n\n# Get the json representation of the user\nuser.json()\n\n# Delete a user\nDelete a user\nUser.remove({'email': 'test@user.com'})\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Database client for Mysql, MongoDB and Sqlite",
    "version": "0.3.7",
    "project_urls": {
        "Source": "https://github.com/theonlyamos/odbms/",
        "Tracker": "https://github.com/theonlyamos/odbms/issues"
    },
    "split_keywords": [
        "python3",
        "runit",
        "developer",
        "serverless",
        "architecture",
        "docker",
        "sqlite",
        "mysql",
        "mongodb"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2c7c0deaef89e0aa003054d5a73bbaa54067379d8de186d13e5d66e2adf8824a",
                "md5": "befb4e3909bf677e3184624246959f69",
                "sha256": "7e9ee478d929d40a253dc0efe4503756a9ff1fa393d5820dc772d89f6c118649"
            },
            "downloads": -1,
            "filename": "odbms-0.3.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "befb4e3909bf677e3184624246959f69",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 28905,
            "upload_time": "2024-09-09T16:32:08",
            "upload_time_iso_8601": "2024-09-09T16:32:08.819004Z",
            "url": "https://files.pythonhosted.org/packages/2c/7c/0deaef89e0aa003054d5a73bbaa54067379d8de186d13e5d66e2adf8824a/odbms-0.3.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "97c8b441dc046a5b56eae712a41f236bc73627be804d7f5aedfb4e22307c3da6",
                "md5": "25738327c1f38d30a3b093e90bb14b4a",
                "sha256": "704d944cb9dbd13477e5cea0ed885db24efb1df8aefb22f76239ea771f4bf14c"
            },
            "downloads": -1,
            "filename": "odbms-0.3.7.tar.gz",
            "has_sig": false,
            "md5_digest": "25738327c1f38d30a3b093e90bb14b4a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25862,
            "upload_time": "2024-09-09T16:32:10",
            "upload_time_iso_8601": "2024-09-09T16:32:10.202836Z",
            "url": "https://files.pythonhosted.org/packages/97/c8/b441dc046a5b56eae712a41f236bc73627be804d7f5aedfb4e22307c3da6/odbms-0.3.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-09 16:32:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "theonlyamos",
    "github_project": "odbms",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "odbms"
}
        
Elapsed time: 0.29894s