🐍 Python & Raspberry 🐍
8.21K subscribers
1.92K photos
125 videos
623 files
1.23K links
Python- Raspberry Pi-AI-IOT
ادمین : فرهاد ناصری زاده
@farhad_naserizadeh
@farhad3412

گروه پایتون
@Python_QA
تبادل
@mmtahmasbi
کانال مرتبط
@new_mathematical
@micropython_iot
@c_micro
اینستاگرام
http://Instagram.com/python_raspberry
Download Telegram
🐍 Python & Raspberry 🐍
Piccolo is a fast, user friendly ORM and query builder which supports asyncio.
✔️ شاید با شنیدن کلمه‌ی ORM همه‌‌مون یاد SQLAlchamy یا Django ORM بیوفتیم، باشه اینا خیلی خوبن ولی لایبرری‌های جدیدی که نوشته میشن دارن از تمام language feature‌های نایس عه پایتون ۳ خصوصا 3.6 به بعد (Type Hints, F strings and async/await)
با قدرت استفاده میکنن و زیبایی خلق میکنن.

پیکولو، یکی از همین کتابخونه‌هاست.
نویسنده‌ی پیکولو چون از اوایل روزهای کاریش غرق در دنیای async بوده این ORM رو به صورت async first مینویسه :))
ولی میشه ازش به صورت sync هم استفاده کرد.

✔️ از دیگر ویژگی‌هاش
• A builtin playground, which makes learning a breeze.

• Tab completion support - works great with iPython and VSCode.

• Batteries included - a User model, authentication, migrations, an admin GUI, and more.

• Modern Python - fully type annotated.

• Make your codebase modular and scalable with Piccolo apps (similar to Django apps) 👌


میتونید ازش به عنوان یه کوئری بیلدر استفاده کنید:
# Select:
await Band.select(
Band.name
).where(
Band.popularity > 100
)

یا مثل یه ORM عادی باهاش رفتار کنید:
# To fetch an object from the database, and update it:

b = await Band.objects().get(Band.name == 'Pythonistas')
b.popularity = 10000
await b.save()


✔️ این ORM بهترین عملکرد رو با postgresql داره ولی از sqlite هم پشتیبانی میکنه و همچنین قسمت زیبای ماجرا اینه که از:
Starlette, FastAPI, BlackSheep, Xpresso and Starlite are currently supported.
هم برای ساختن web app های نایس پشتیبانی میکنه :))

🐙 https://github.com/piccolo-orm/piccolo

#m4hdi
#ORM
#library
#async

©raspberry_python

دنبال کردن هشتگ m4hdi
دنبال کردن هشتگ orm
دنبال کردن هشتگ library
دنبال کردن هشتگ async