directdb


Namedirectdb JSON
Version 1.2.1 PyPI version JSON
download
home_pageNone
SummaryAn async package that makes database handling extremely easy!
upload_time2024-10-29 09:29:55
maintainerNone
docs_urlNone
authorCannonball Chris
requires_pythonNone
licenseNone
keywords db bot discord bot database postgresql asyncpg async pgutils nosql sqlite aiosqlite discord.py
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            


# directdb



A simple library that makes handling SQL databases in python easy without the need to understand the syntax. The library would act like an interface between your code and the database server parsing the data to SQL format.



If you enjoy using this project, consider giving it a star as it helps out a ton <3



Currently Supported Databases:

- PostgreSQL

- SQLite



## Github Repository



https://github.com/cannonballchris/directdb



## Installation



To install the library, use `pip install directdb`



    

## License



[GPL-3.0](https://choosealicense.com/licenses/gpl-3.0/)





## Documentation



[Documentation](https://indigodev.gitbook.io/directdb)





## Usage/Examples



Using the library with a discord bot



```py

import asyncio



import discord

from discord.ext import commands

from directdb import Postgresql



class MyBot(commands.Bot):

    def __init__(self):

        super().__init__(command_prefix = "!", intents = discord.Intents.all())

    

    async def setup_hook(self):

        setattr(self, "db", Postgresql(

            host = "localhost",

            user = "username",

            password = "password",

            database = "Database name here",

            port = 5000 #Your db port address here

        ))

        await self.db.connect()

        print("DB Ready")



if __name__ == "__main__":

    asyncio.run(MyBot().run("TOKEN"))

```



Using the library normally without a discord bot context.



```py

import asyncio



from directdb import Postgresql



async def database(host, user, password, database, port):

    db = Postgresql(host = host, user= user, password = password, database = database, port = port)

    await db.connect()



asyncio.run(database(...))

```











## Contributing



You can contribute to this project by providing valueable suggestions and reporting issues in our [Discord Server](https://discord.gg/sj2c7gzPzE)




            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "directdb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "db, bot, discord bot, database, postgresql, asyncpg, async, pgutils, nosql, sqlite, aiosqlite, discord.py",
    "author": "Cannonball Chris",
    "author_email": "cannonballchris8@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b0/12/cb016965651e8ed6d77db92f3f72e16ecfe2401b455265c1b5672a51717f/directdb-1.2.1.tar.gz",
    "platform": null,
    "description": "\r\n\r\n\r\n# directdb\r\n\r\n\r\n\r\nA simple library that makes handling SQL databases in python easy without the need to understand the syntax. The library would act like an interface between your code and the database server parsing the data to SQL format.\r\n\r\n\r\n\r\nIf you enjoy using this project, consider giving it a star as it helps out a ton <3\r\n\r\n\r\n\r\nCurrently Supported Databases:\r\n\r\n- PostgreSQL\r\n\r\n- SQLite\r\n\r\n\r\n\r\n## Github Repository\r\n\r\n\r\n\r\nhttps://github.com/cannonballchris/directdb\r\n\r\n\r\n\r\n## Installation\r\n\r\n\r\n\r\nTo install the library, use `pip install directdb`\r\n\r\n\r\n\r\n    \r\n\r\n## License\r\n\r\n\r\n\r\n[GPL-3.0](https://choosealicense.com/licenses/gpl-3.0/)\r\n\r\n\r\n\r\n\r\n\r\n## Documentation\r\n\r\n\r\n\r\n[Documentation](https://indigodev.gitbook.io/directdb)\r\n\r\n\r\n\r\n\r\n\r\n## Usage/Examples\r\n\r\n\r\n\r\nUsing the library with a discord bot\r\n\r\n\r\n\r\n```py\r\n\r\nimport asyncio\r\n\r\n\r\n\r\nimport discord\r\n\r\nfrom discord.ext import commands\r\n\r\nfrom directdb import Postgresql\r\n\r\n\r\n\r\nclass MyBot(commands.Bot):\r\n\r\n    def __init__(self):\r\n\r\n        super().__init__(command_prefix = \"!\", intents = discord.Intents.all())\r\n\r\n    \r\n\r\n    async def setup_hook(self):\r\n\r\n        setattr(self, \"db\", Postgresql(\r\n\r\n            host = \"localhost\",\r\n\r\n            user = \"username\",\r\n\r\n            password = \"password\",\r\n\r\n            database = \"Database name here\",\r\n\r\n            port = 5000 #Your db port address here\r\n\r\n        ))\r\n\r\n        await self.db.connect()\r\n\r\n        print(\"DB Ready\")\r\n\r\n\r\n\r\nif __name__ == \"__main__\":\r\n\r\n    asyncio.run(MyBot().run(\"TOKEN\"))\r\n\r\n```\r\n\r\n\r\n\r\nUsing the library normally without a discord bot context.\r\n\r\n\r\n\r\n```py\r\n\r\nimport asyncio\r\n\r\n\r\n\r\nfrom directdb import Postgresql\r\n\r\n\r\n\r\nasync def database(host, user, password, database, port):\r\n\r\n    db = Postgresql(host = host, user= user, password = password, database = database, port = port)\r\n\r\n    await db.connect()\r\n\r\n\r\n\r\nasyncio.run(database(...))\r\n\r\n```\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n## Contributing\r\n\r\n\r\n\r\nYou can contribute to this project by providing valueable suggestions and reporting issues in our [Discord Server](https://discord.gg/sj2c7gzPzE)\r\n\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "An async package that makes database handling extremely easy!",
    "version": "1.2.1",
    "project_urls": null,
    "split_keywords": [
        "db",
        " bot",
        " discord bot",
        " database",
        " postgresql",
        " asyncpg",
        " async",
        " pgutils",
        " nosql",
        " sqlite",
        " aiosqlite",
        " discord.py"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ade38112dbaf29dbaa9e83e475a5ab799a41044454b49a3729c97bce08b265e8",
                "md5": "5937cbb9bcbc628bdf0d899f5bad8f9e",
                "sha256": "2bd57a029d41f4bf71a773efce5a929581c56f1270c21e3b242ba55656e3005e"
            },
            "downloads": -1,
            "filename": "directdb-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5937cbb9bcbc628bdf0d899f5bad8f9e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 18910,
            "upload_time": "2024-10-29T09:29:54",
            "upload_time_iso_8601": "2024-10-29T09:29:54.455806Z",
            "url": "https://files.pythonhosted.org/packages/ad/e3/8112dbaf29dbaa9e83e475a5ab799a41044454b49a3729c97bce08b265e8/directdb-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b012cb016965651e8ed6d77db92f3f72e16ecfe2401b455265c1b5672a51717f",
                "md5": "bf5a23ae29cd977c918f108b4f49fae4",
                "sha256": "904952740067b421cef9f1b335da002be712652731ac5332bfd71f612a841725"
            },
            "downloads": -1,
            "filename": "directdb-1.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "bf5a23ae29cd977c918f108b4f49fae4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17980,
            "upload_time": "2024-10-29T09:29:55",
            "upload_time_iso_8601": "2024-10-29T09:29:55.987731Z",
            "url": "https://files.pythonhosted.org/packages/b0/12/cb016965651e8ed6d77db92f3f72e16ecfe2401b455265c1b5672a51717f/directdb-1.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-29 09:29:55",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "directdb"
}
        
Elapsed time: 9.46258s