anysql


Nameanysql JSON
Version 0.0.4 PyPI version JSON
download
home_pageNone
SummaryLightweight, Thread-Safe, Version-Agnostic, SQL Client Implementation
upload_time2024-09-12 03:01:14
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseThe MIT License (MIT) Copyright (c) 2020 wcember Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords database simple sql universal
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            AnySQL
-------
Lightweight, Thread-Safe, Version-Agnostic, SQL Client Implementation
inspired by [Databases](https://github.com/encode/databases)

### Features

* **Lightweight** - no use of sqlalchemy or other massive frameworks
* **ThreadSafe**  - implements threadsafe features for fearless concurrent usage
* **Flexible**    - acts as a standard frontend for a wide variety of SQL backends
* **Powerful**    - simple API design with powerful utilities and quality-of-life features

### Installation

```bash
$ pip install anysql           # plain install
$ pip install anysql[mysql]    # install with mysql driver
$ pip install anysql[postgres] # install with postgres driver
```

### Security

It should be noted that anysql implements its own query parameterization to
allow for greater API flexibility and performance, rather than rely on
individual sql backends or relying on massive frameworks like sqlalchemy to
handle query generation.

The existing parameterization has been thoroughly tested with
[sqlmap](https://github.com/sqlmapproject/sqlmap), the world standard of
sql pentesting-tools, to prevent and detect any possible sql-injection
vulnerabilities.

The test-suite used is publically available within the source-code repo
within the [tests](https://github.com/imgurbot12/anysql/tree/master/tests)
folder.

### Example

```python
# Create a database instance, and connect to it.
from anysql import Database
database = Database('sqlite://:memory:')
database.connect()

# Create a table.
query = """CREATE TABLE HighScores (id INTEGER PRIMARY KEY, name VARCHAR(100), score INTEGER)"""
database.execute(query=query)

# Insert some data.
query = "INSERT INTO HighScores(name, score) VALUES (:name, :score)"
values = [
    {"name": "Daisy", "score": 92},
    {"name": "Neil", "score": 87},
    {"name": "Carol", "score": 43},
]
database.execute_many(query=query, values=values)

# Run a database query.
query = "SELECT * FROM HighScores"
rows = database.fetch_all(query=query)
print('High Scores:', rows)
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "anysql",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "database, simple, sql, universal",
    "author": null,
    "author_email": "Andrew C Scott <imgurbot12@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/34/85/580b15c567f0a6f955ba65a41a174236462f03d35ef9f84c16c6e31137de/anysql-0.0.4.tar.gz",
    "platform": null,
    "description": "AnySQL\n-------\nLightweight, Thread-Safe, Version-Agnostic, SQL Client Implementation\ninspired by [Databases](https://github.com/encode/databases)\n\n### Features\n\n* **Lightweight** - no use of sqlalchemy or other massive frameworks\n* **ThreadSafe**  - implements threadsafe features for fearless concurrent usage\n* **Flexible**    - acts as a standard frontend for a wide variety of SQL backends\n* **Powerful**    - simple API design with powerful utilities and quality-of-life features\n\n### Installation\n\n```bash\n$ pip install anysql           # plain install\n$ pip install anysql[mysql]    # install with mysql driver\n$ pip install anysql[postgres] # install with postgres driver\n```\n\n### Security\n\nIt should be noted that anysql implements its own query parameterization to\nallow for greater API flexibility and performance, rather than rely on\nindividual sql backends or relying on massive frameworks like sqlalchemy to\nhandle query generation.\n\nThe existing parameterization has been thoroughly tested with\n[sqlmap](https://github.com/sqlmapproject/sqlmap), the world standard of\nsql pentesting-tools, to prevent and detect any possible sql-injection\nvulnerabilities.\n\nThe test-suite used is publically available within the source-code repo\nwithin the [tests](https://github.com/imgurbot12/anysql/tree/master/tests)\nfolder.\n\n### Example\n\n```python\n# Create a database instance, and connect to it.\nfrom anysql import Database\ndatabase = Database('sqlite://:memory:')\ndatabase.connect()\n\n# Create a table.\nquery = \"\"\"CREATE TABLE HighScores (id INTEGER PRIMARY KEY, name VARCHAR(100), score INTEGER)\"\"\"\ndatabase.execute(query=query)\n\n# Insert some data.\nquery = \"INSERT INTO HighScores(name, score) VALUES (:name, :score)\"\nvalues = [\n    {\"name\": \"Daisy\", \"score\": 92},\n    {\"name\": \"Neil\", \"score\": 87},\n    {\"name\": \"Carol\", \"score\": 43},\n]\ndatabase.execute_many(query=query, values=values)\n\n# Run a database query.\nquery = \"SELECT * FROM HighScores\"\nrows = database.fetch_all(query=query)\nprint('High Scores:', rows)\n```\n",
    "bugtrack_url": null,
    "license": "The MIT License (MIT)  Copyright (c) 2020 wcember  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Lightweight, Thread-Safe, Version-Agnostic, SQL Client Implementation",
    "version": "0.0.4",
    "project_urls": {
        "Repository": "https://github.com/imgurbot12/anysql.git"
    },
    "split_keywords": [
        "database",
        " simple",
        " sql",
        " universal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "24b30138e381592b25d144319501a6347ed40c130c4af9e94e5d6e08495425a5",
                "md5": "bfedb489930699bb9bde853ea0d87795",
                "sha256": "60c6fc4e071d13088d2cb152b032caf3b6ec245573d60d4209b681edaf3bedf3"
            },
            "downloads": -1,
            "filename": "anysql-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bfedb489930699bb9bde853ea0d87795",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 17706,
            "upload_time": "2024-09-12T03:01:12",
            "upload_time_iso_8601": "2024-09-12T03:01:12.555263Z",
            "url": "https://files.pythonhosted.org/packages/24/b3/0138e381592b25d144319501a6347ed40c130c4af9e94e5d6e08495425a5/anysql-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3485580b15c567f0a6f955ba65a41a174236462f03d35ef9f84c16c6e31137de",
                "md5": "0216c20c8c7ad211dffe130f3e3dba4b",
                "sha256": "a796fdf68fcfb761faa0ab2faf3e1f4dfa974ed6aafc445f73e301f6be237e8c"
            },
            "downloads": -1,
            "filename": "anysql-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "0216c20c8c7ad211dffe130f3e3dba4b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 14548,
            "upload_time": "2024-09-12T03:01:14",
            "upload_time_iso_8601": "2024-09-12T03:01:14.032093Z",
            "url": "https://files.pythonhosted.org/packages/34/85/580b15c567f0a6f955ba65a41a174236462f03d35ef9f84c16c6e31137de/anysql-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-12 03:01:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "imgurbot12",
    "github_project": "anysql",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "anysql"
}
        
Elapsed time: 0.58712s