Skip to main content

AllInOne Framework for Python/PyPy

Project description

cemirfw

Install

sudo bash install.sh
cemirfw start
cemirfw stop
cemirfw restart
cemirfw disable
cemirfw status

Sample endpoints

from func_dbs import db_query, Tablo
from func_handlers import put, get, check_params


@put(r"/fiyat-guncelle", auth=False, redis_cache_params={"expire_time": 30, "key": "ip,useragent"})
async def putete(request, data):
    table = Tablo("test1")

    # ins_result = await table.insert(name="asd", blocked=True, content=data).execute()
    # upd_result = await table.update(blocked=True, name="asdasdasdasdasdasd").where(id=7).execute()

    # del_result = await table.where(id=15).delete()

    # sel_result = await table.select("*", fetchall=True).wherenot(name=["asd", "John", "Johdddddddddddddddddn"]).order('id').asc().execute()
    # sel_result = await table.select("*", fetchall=True).wherenot(id=3).order('id').asc().execute()
    # sel_result = await table.select("*", fetchall=True).wherenot(name="Johdddddddddddddddddn").order('id').asc().execute()
    # sel_result = await table.select("*", fetchall=True).likenot(name="John").order('id').asc().execute()
    # sel_result = await table.select("*", fetchall=True).likeew(name="hn").order('id').asc().execute()
    # sel_result = await table.select("*", fetchall=True).likenotew(name="asd").order('id').asc().execute()
    # sel_result = await table.select("*", fetchall=True).likesw(name="Jo").order('id').asc().execute()
    sel_result = await table.select("*", fetchall=True).likenotsw(name="asd").order('id').asc().execute()
    # sel_result = await table.select("*").where(id=7).execute()
    return sel_result


@get(r"/pi", redis_cache_params={"expire_time": 3, "key": "ip,useragent"})
@check_params(["id"])
async def get_pi(request):
    id = request.params("id")
    # return await db_query("SELECT content FROM accounting__customer_proforma_invoices where id=%s;", id, False, 2, "proformainvoices")
    return await db_query("SELECT content FROM test1 where id in (1,2,3,4);", id, True, 2, "proformainvoices")

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

cemirfw-20240624.1.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

cemirfw-20240624.1-py3-none-any.whl (2.6 kB view hashes)

Uploaded Python 3

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