Skip to main content

An async package that makes database handling extremely easy!

Project description

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

Github Repository

https://github.com/cannonballchris/directdb

Installation

To install the library, use pip install directdb

License

GPL-3.0

Documentation

Documentation

Usage/Examples

Using the library with a discord bot

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.

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

directdb-1.0.0.tar.gz (16.1 kB view details)

Uploaded Source

Built Distribution

directdb-1.0.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file directdb-1.0.0.tar.gz.

File metadata

  • Download URL: directdb-1.0.0.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for directdb-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d025488f3a621379fe85754d3be774176378ba5c7bf65aea09118492731d2553
MD5 1e47f1eb422fb8c14fafc2cf32a33577
BLAKE2b-256 d6a26c4350d5d527fb6fbc31f9ad13315c9ad0bcf1fa601a93b3c0196ec18b0b

See more details on using hashes here.

File details

Details for the file directdb-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: directdb-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for directdb-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81afecef7f050a03279b68d9ebd685b1793f38e590df2b1c05d9217da6414990
MD5 a41e9b41476903af40282790efad67e8
BLAKE2b-256 a7fb0a472fe9010546cf279388b48093f004d686b721baf1ff332360e2feccf9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page