sqlite2rest


Namesqlite2rest JSON
Version 1.5.0 PyPI version JSON
download
home_pagehttps://github.com/nside/sqlite2rest
SummaryA Python library for creating a RESTful API from an SQLite database using Flask.
upload_time2023-07-31 13:20:24
maintainer
docs_urlNone
authorDenis Laprise
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SQLite2REST

SQLite2REST is a Python library that simplifies the process of creating a RESTful API from an SQLite database using the Flask web framework. It automatically reads the schema of an SQLite database and generates endpoints for each table, allowing for Create, Read, Update, and Delete (CRUD) operations. The library also generates an OpenAPI specification for the API.

![Test status](https://img.shields.io/github/actions/workflow/status/nside/sqlite2rest/test.yaml)
[![Documentation Status](https://readthedocs.org/projects/sqlite2rest/badge/?version=latest)](https://sqlite2rest.readthedocs.io/?badge=latest)

## Installation

You can install SQLite2REST using pip:

```
pip install sqlite2rest
```


## Usage

You can use SQLite2REST from the command line by providing the path to your SQLite database:

```
sqlite2rest serve /path/to/database.db
```


This will start a Flask server with endpoints for each table in the database. For example, if your database has a table named `users`, you can access the records in this table at the `/users` endpoint.

You can also use the `/openapi.yaml` endpoint to get the OpenAPI specification for the API.

## Endpoints

For each table in the database, the following endpoints are available:

- `GET /<table>`: Get all records from the table.
- `GET /<table>/<id>`: Returns the record with the given ID from the table.
- `POST /<table>`: Create a new record in the table. The data for the record should be provided as JSON in the request body.
- `PUT /<table>/<id>`: Update an existing record in the table. The data for the record should be provided as JSON in the request body.
- `DELETE /<table>/<id>`: Delete an existing record from the table.

You can also generate an OpenAPI specification from an SQLite database:

```
sqlite2rest spec /path/to/database.db
```

## Contributing

Contributions are welcome! Please feel free to submit a pull request.

## License

SQLite2REST is licensed under the MIT license. See the LICENSE file for more details.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/nside/sqlite2rest",
    "name": "sqlite2rest",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Denis Laprise",
    "author_email": "git@2ni.net",
    "download_url": "https://files.pythonhosted.org/packages/e9/e9/d89fa6a8934955041910deb6b7e1a2f8800fa05cfd7cbe8905cff7a60576/sqlite2rest-1.5.0.tar.gz",
    "platform": null,
    "description": "# SQLite2REST\n\nSQLite2REST is a Python library that simplifies the process of creating a RESTful API from an SQLite database using the Flask web framework. It automatically reads the schema of an SQLite database and generates endpoints for each table, allowing for Create, Read, Update, and Delete (CRUD) operations. The library also generates an OpenAPI specification for the API.\n\n![Test status](https://img.shields.io/github/actions/workflow/status/nside/sqlite2rest/test.yaml)\n[![Documentation Status](https://readthedocs.org/projects/sqlite2rest/badge/?version=latest)](https://sqlite2rest.readthedocs.io/?badge=latest)\n\n## Installation\n\nYou can install SQLite2REST using pip:\n\n```\npip install sqlite2rest\n```\n\n\n## Usage\n\nYou can use SQLite2REST from the command line by providing the path to your SQLite database:\n\n```\nsqlite2rest serve /path/to/database.db\n```\n\n\nThis will start a Flask server with endpoints for each table in the database. For example, if your database has a table named `users`, you can access the records in this table at the `/users` endpoint.\n\nYou can also use the `/openapi.yaml` endpoint to get the OpenAPI specification for the API.\n\n## Endpoints\n\nFor each table in the database, the following endpoints are available:\n\n- `GET /<table>`: Get all records from the table.\n- `GET /<table>/<id>`: Returns the record with the given ID from the table.\n- `POST /<table>`: Create a new record in the table. The data for the record should be provided as JSON in the request body.\n- `PUT /<table>/<id>`: Update an existing record in the table. The data for the record should be provided as JSON in the request body.\n- `DELETE /<table>/<id>`: Delete an existing record from the table.\n\nYou can also generate an OpenAPI specification from an SQLite database:\n\n```\nsqlite2rest spec /path/to/database.db\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a pull request.\n\n## License\n\nSQLite2REST is licensed under the MIT license. See the LICENSE file for more details.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A Python library for creating a RESTful API from an SQLite database using Flask.",
    "version": "1.5.0",
    "project_urls": {
        "Homepage": "https://github.com/nside/sqlite2rest"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "476df7c80004dd28ae0a23202beec7b38376d238188210860570e1d1f56d7f29",
                "md5": "cf44175630394110ad5dfce05547c96b",
                "sha256": "7d22de36ae8c28b2e9f084fe812f0ba3330dbaf6ef15bd05702dedeb848ac615"
            },
            "downloads": -1,
            "filename": "sqlite2rest-1.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf44175630394110ad5dfce05547c96b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8183,
            "upload_time": "2023-07-31T13:20:23",
            "upload_time_iso_8601": "2023-07-31T13:20:23.505159Z",
            "url": "https://files.pythonhosted.org/packages/47/6d/f7c80004dd28ae0a23202beec7b38376d238188210860570e1d1f56d7f29/sqlite2rest-1.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9e9d89fa6a8934955041910deb6b7e1a2f8800fa05cfd7cbe8905cff7a60576",
                "md5": "8469a46640c3110228e1d49cf9826388",
                "sha256": "9422a84dee3b1a616fa00c2e1183322cdaa5211c4447d87e8a21dbc8e8f81fba"
            },
            "downloads": -1,
            "filename": "sqlite2rest-1.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8469a46640c3110228e1d49cf9826388",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8524,
            "upload_time": "2023-07-31T13:20:24",
            "upload_time_iso_8601": "2023-07-31T13:20:24.490361Z",
            "url": "https://files.pythonhosted.org/packages/e9/e9/d89fa6a8934955041910deb6b7e1a2f8800fa05cfd7cbe8905cff7a60576/sqlite2rest-1.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-31 13:20:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "nside",
    "github_project": "sqlite2rest",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sqlite2rest"
}
        
Elapsed time: 2.04211s