sqlite-rx


Namesqlite-rx JSON
Version 1.2.0 PyPI version JSON
download
home_pagehttps://github.com/aosingh/sqlite_rx
SummaryPython SQLite Client and Server
upload_time2023-11-10 19:47:59
maintainerAbhishek Singh
docs_urlNone
authorAbhishek Singh
requires_python>=3.8
licenseMIT License
keywords sqlite client server fast secure
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # sqlite_rx 
[![PyPI version](https://badge.fury.io/py/sqlite-rx.svg)](https://pypi.python.org/pypi/sqlite-rx) [![sqlite-rx](https://github.com/aosingh/sqlite_rx/actions/workflows/sqlite_build.yaml/badge.svg)](https://github.com/aosingh/sqlite_rx/actions) [![Downloads](https://pepy.tech/badge/sqlite-rx)](https://pepy.tech/project/sqlite-rx)


[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)
[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)]((https://www.python.org/downloads/release/python-390/))
[![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/)
[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/)
[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)


[![PyPy3.8](https://img.shields.io/badge/python-PyPy3.8-blue.svg)](https://www.pypy.org/download.html)
[![PyPy3.9](https://img.shields.io/badge/python-PyPy3.9-blue.svg)](https://www.pypy.org/download.html)


#### For documentation, usage and examples refer [https://aosingh.github.io/sqlite_rx/](https://aosingh.github.io/sqlite_rx/)

# Introduction

[SQLite](https://www.sqlite.org/index.html) is a lightweight database written in C. 
Python has in-built support to interact with the database (locally) which is either stored on disk or in memory.

With `sqlite_rx`, clients should be able to communicate with an `SQLiteServer` in a fast, simple and secure manner and execute queries remotely.

Key Features

- Client and Server for [SQLite](https://www.sqlite.org/index.html) database built using [ZeroMQ](http://zguide.zeromq.org/page:all) as the transport layer and [msgpack](https://msgpack.org/index.html) for serialization/deserialization.
- Authentication using [ZeroMQ Authentication Protocol (ZAP)](https://rfc.zeromq.org/spec:27/ZAP/)
- Encryption using [CurveZMQ](http://curvezmq.org/)
- Generic authorization policy during server startup
- Schedule regular backups for on-disk databases

# Install

```commandline
pip install -U sqlite_rx
```

# Server

`SQLiteServer` runs in a single thread and follows an event-driven concurrency model (using `tornado's` event loop) which minimizes the cost of concurrent client connections. Following snippet shows how you can start the server process.

```python
# server.py

from sqlite_rx.server import SQLiteServer

def main():

    # database is a path-like object giving the pathname 
    # of the database file to be opened. 
    
    # You can use ":memory:" to open a database connection to a database 
    # that resides in RAM instead of on disk

    server = SQLiteServer(database=":memory:",
                          bind_address="tcp://127.0.0.1:5000")
    server.start()
    server.join()

if __name__ == '__main__':
    main()

```

# Client

The following snippet shows how you can instantiate an `SQLiteClient` and execute a simple `CREATE TABLE` query.

```python
# client.py

from sqlite_rx.client import SQLiteClient

client = SQLiteClient(connect_address="tcp://127.0.0.1:5000")

with client:
  query = "CREATE TABLE stocks (date text, trans text, symbol text, qty real, price real)"
  result = client.execute(query)

```

```text
>> python client.py

{'error': None, 'items': []}
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aosingh/sqlite_rx",
    "name": "sqlite-rx",
    "maintainer": "Abhishek Singh",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "abhishek.singh20141@gmail.com",
    "keywords": "sqlite client server fast secure",
    "author": "Abhishek Singh",
    "author_email": "abhishek.singh20141@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0a/cb/f63f7770b034ab13e67f122db12cc0617db49b7f26287f275c08ce89e9f2/sqlite_rx-1.2.0.tar.gz",
    "platform": null,
    "description": "# sqlite_rx \n[![PyPI version](https://badge.fury.io/py/sqlite-rx.svg)](https://pypi.python.org/pypi/sqlite-rx) [![sqlite-rx](https://github.com/aosingh/sqlite_rx/actions/workflows/sqlite_build.yaml/badge.svg)](https://github.com/aosingh/sqlite_rx/actions) [![Downloads](https://pepy.tech/badge/sqlite-rx)](https://pepy.tech/project/sqlite-rx)\n\n\n[![Python 3.8](https://img.shields.io/badge/python-3.8-blue.svg)](https://www.python.org/downloads/release/python-380/)\n[![Python 3.9](https://img.shields.io/badge/python-3.9-blue.svg)]((https://www.python.org/downloads/release/python-390/))\n[![Python 3.10](https://img.shields.io/badge/python-3.10-blue.svg)](https://www.python.org/downloads/release/python-3100/)\n[![Python 3.11](https://img.shields.io/badge/python-3.11-blue.svg)](https://www.python.org/downloads/release/python-3110/)\n[![Python 3.12](https://img.shields.io/badge/python-3.12-blue.svg)](https://www.python.org/downloads/release/python-3120/)\n\n\n[![PyPy3.8](https://img.shields.io/badge/python-PyPy3.8-blue.svg)](https://www.pypy.org/download.html)\n[![PyPy3.9](https://img.shields.io/badge/python-PyPy3.9-blue.svg)](https://www.pypy.org/download.html)\n\n\n#### For documentation, usage and examples refer [https://aosingh.github.io/sqlite_rx/](https://aosingh.github.io/sqlite_rx/)\n\n# Introduction\n\n[SQLite](https://www.sqlite.org/index.html) is a lightweight database written in C. \nPython has in-built support to interact with the database (locally) which is either stored on disk or in memory.\n\nWith `sqlite_rx`, clients should be able to communicate with an `SQLiteServer` in a fast, simple and secure manner and execute queries remotely.\n\nKey Features\n\n- Client and Server for [SQLite](https://www.sqlite.org/index.html) database built using [ZeroMQ](http://zguide.zeromq.org/page:all) as the transport layer and [msgpack](https://msgpack.org/index.html) for serialization/deserialization.\n- Authentication using [ZeroMQ Authentication Protocol (ZAP)](https://rfc.zeromq.org/spec:27/ZAP/)\n- Encryption using [CurveZMQ](http://curvezmq.org/)\n- Generic authorization policy during server startup\n- Schedule regular backups for on-disk databases\n\n# Install\n\n```commandline\npip install -U sqlite_rx\n```\n\n# Server\n\n`SQLiteServer` runs in a single thread and follows an event-driven concurrency model (using `tornado's` event loop) which minimizes the cost of concurrent client connections. Following snippet shows how you can start the server process.\n\n```python\n# server.py\n\nfrom sqlite_rx.server import SQLiteServer\n\ndef main():\n\n    # database is a path-like object giving the pathname \n    # of the database file to be opened. \n    \n    # You can use \":memory:\" to open a database connection to a database \n    # that resides in RAM instead of on disk\n\n    server = SQLiteServer(database=\":memory:\",\n                          bind_address=\"tcp://127.0.0.1:5000\")\n    server.start()\n    server.join()\n\nif __name__ == '__main__':\n    main()\n\n```\n\n# Client\n\nThe following snippet shows how you can instantiate an `SQLiteClient` and execute a simple `CREATE TABLE` query.\n\n```python\n# client.py\n\nfrom sqlite_rx.client import SQLiteClient\n\nclient = SQLiteClient(connect_address=\"tcp://127.0.0.1:5000\")\n\nwith client:\n  query = \"CREATE TABLE stocks (date text, trans text, symbol text, qty real, price real)\"\n  result = client.execute(query)\n\n```\n\n```text\n>> python client.py\n\n{'error': None, 'items': []}\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Python SQLite Client and Server",
    "version": "1.2.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/aosingh/sqlite_rx/issues",
        "CI": "https://github.com/aosingh/sqlite_rx/actions",
        "Documentation": "https://aosingh.github.io/sqlite_rx/",
        "Homepage": "https://github.com/aosingh/sqlite_rx",
        "License": "https://github.com/aosingh/sqlite_rx/blob/master/LICENSE",
        "Release Notes": "https://github.com/aosingh/sqlite_rx/releases",
        "Source": "https://github.com/aosingh/sqlite_rx"
    },
    "split_keywords": [
        "sqlite",
        "client",
        "server",
        "fast",
        "secure"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "89a74f447479cc672087db774ab14dd0080302c10c723c626a7f8ad11c7e5657",
                "md5": "f410094f849358745eef185523541cd5",
                "sha256": "d3ec6a6039b609adc63997ea1e126a8aabcfc08d832a95d69675c14825af1e2e"
            },
            "downloads": -1,
            "filename": "sqlite_rx-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f410094f849358745eef185523541cd5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 28199,
            "upload_time": "2023-11-10T19:47:57",
            "upload_time_iso_8601": "2023-11-10T19:47:57.424119Z",
            "url": "https://files.pythonhosted.org/packages/89/a7/4f447479cc672087db774ab14dd0080302c10c723c626a7f8ad11c7e5657/sqlite_rx-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0acbf63f7770b034ab13e67f122db12cc0617db49b7f26287f275c08ce89e9f2",
                "md5": "a9be74e1d9d5fd84a952dab593f7dd13",
                "sha256": "2fbd3e8c7fc761954d83a8dbfc58a13fd9075a0dd33a4c1e6731d52d379fd05d"
            },
            "downloads": -1,
            "filename": "sqlite_rx-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a9be74e1d9d5fd84a952dab593f7dd13",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 21141,
            "upload_time": "2023-11-10T19:47:59",
            "upload_time_iso_8601": "2023-11-10T19:47:59.325324Z",
            "url": "https://files.pythonhosted.org/packages/0a/cb/f63f7770b034ab13e67f122db12cc0617db49b7f26287f275c08ce89e9f2/sqlite_rx-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-10 19:47:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aosingh",
    "github_project": "sqlite_rx",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "sqlite-rx"
}
        
Elapsed time: 0.13723s