@themost-framework alternative for python
Project description
pycentroid
@themost-framework for Python
@themost-framework is a fully-featured end-to-end framework for building scalable data-driven web applications and services under node.js. It consists of a wide set of server-side libraries and client-side tools for helping developers creating scalable and configurable production environments. pycentroid is a @themost-framework alternative for python.
pycentroid.client
A client-side library of @themost-framework application for python
from typing import List
from pycentroid.client import ClientDataContext, ClientContextOptions
from pycentroid.query import select
async def get_products():
context = ClientDataContext(ClientContextOptions('http://localhost:3000/api/'))
# get products
items: List = await context.model('Products').as_queryable().select(
lambda x: select(id=x.id, name=x.name, product_model=x.model,)
).where(
lambda x: x.category == 'Laptops'
).get_items()
return items
Read more at pycentroid.client
pycentroid.query
A database-agnostic query module which for writing SQL expressions of any kind
from pycentroid.query import QueryExpression, QueryEntity, SqlFormatter, select
products = QueryEntity('ProductData')
query = QueryExpression(products).select(
lambda x: select(id=x.id, name=x.name, price=round(x.price, 2))
).where(
lambda x: round(x.price, 2) < 800 and x.category == 'Laptops'
)
sql = SqlFormatter().format(query)
# sql > SELECT id,name,ROUND(price,2) AS price FROM ProductData WHERE ((ROUND(price,2)<800) AND (category='Laptops'))
pycentroid.data
A next-generation ORM data module for developing data-driven application and services.
from pycentroid.data.application import DataApplication
from os.path import abspath, join, dirname
APP_PATH = abspath(join(dirname(__file__), '..'))
async def main():
app = DataApplication(cwd=APP_PATH)
context = app.create_context()
results = await context.model('Order').where(
lambda x: x.orderedItem.category == 'Desktops'
).get_items()
print(results)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycentroid-1.1.5.tar.gz.
File metadata
- Download URL: pycentroid-1.1.5.tar.gz
- Upload date:
- Size: 59.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5c332894c4e74d081ec41dcf8d2769535bbf19bd812c4e9418ff36204426ff9
|
|
| MD5 |
3ee972dbd5c4e2633c9c973ed1c0acef
|
|
| BLAKE2b-256 |
296505a79c969706f9838ea055d068bc487914a347f92a7a363cc9dc6fa128a0
|
File details
Details for the file pycentroid-1.1.5-py3-none-any.whl.
File metadata
- Download URL: pycentroid-1.1.5-py3-none-any.whl
- Upload date:
- Size: 74.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ce856d278de8cddc8d1497be1d71ab4539069b16f309a2654cdf72979d03cd2
|
|
| MD5 |
3b14b47cb612d423b91de95e78078c02
|
|
| BLAKE2b-256 |
e6c68204a83f30afaadbfd814e9244ea1c24b549b7c66eea5d31e531a69857d0
|