A fast, user friendly ORM and query builder which supports asyncio.
Project description
Piccolo is a fast, user friendly ORM and query builder which supports asyncio. Read the docs.
Features
Some of it’s stand out features are:
- Support for sync and async.
- 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).
Syntax
The syntax is clean and expressive.
You can use it as a query builder:
# Select:
await Band.select(
Band.name
).where(
Band.popularity > 100
)
# Join:
await Band.select(
Band.name,
Band.manager.name
)
# Delete:
await Band.delete().where(
Band.popularity < 1000
)
# Update:
await Band.update({Band.popularity: 10000}).where(
Band.name == 'Pythonistas'
)
Or like a typical ORM:
# To create a new object:
b = Band(name='C-Sharps', popularity=100)
await b.save()
# To fetch an object from the database, and update it:
b = await Band.objects().get(Band.name == 'Pythonistas')
b.popularity = 10000
await b.save()
# To delete:
await b.remove()
Installation
Installing with PostgreSQL driver:
pip install 'piccolo[postgres]'
Installing with SQLite driver:
pip install 'piccolo[sqlite]'
Installing with all optional dependencies (easiest):
pip install 'piccolo[all]'
Building a web app?
Let Piccolo scaffold you an ASGI web app, using Piccolo as the ORM:
piccolo asgi new
Starlette, FastAPI, BlackSheep, Xpresso and Starlite are currently supported.
Are you a Django user?
We have a handy page which shows the equivalent of common Django queries in Piccolo.
Documentation
Our documentation is on Read the docs.
We also have some great tutorial videos on YouTube.
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
File details
Details for the file piccolo-0.97.0.tar.gz
.
File metadata
- Download URL: piccolo-0.97.0.tar.gz
- Upload date:
- Size: 214.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.2.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.6 CPython/3.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd7946189d3f7debeaf0dca83b707236caec1aa8bb3a3a9335378341f8c12d2b |
|
MD5 | ad5ed021de125cf0ec23bf5f89ba0f86 |
|
BLAKE2b-256 | 537660b646feefa81e7017dea01e1730b5c880034e47652c0796a6c53a990381 |
File details
Details for the file piccolo-0.97.0-py3-none-any.whl
.
File metadata
- Download URL: piccolo-0.97.0-py3-none-any.whl
- Upload date:
- Size: 327.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.3 requests/2.28.1 requests-toolbelt/0.10.1 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/4.2.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.6 CPython/3.7.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 126d73d89b99b1bc2ad81f3ca9665ba00441bc3d4f41b53fbf45f3fabb9478f9 |
|
MD5 | 97263d05a33064039277d66632645ce4 |
|
BLAKE2b-256 | af5a1b8dcb59cfeb0153eae74f59ab5d57749a8ae76a7366c4de6b9b90f87002 |