GraphQL type features in a REST API
Project description
GraphQL type features in a REST API using SQLAlchemy and Marshmallow.
Drowsy aims to provide a similar feature set to GraphQL, and shares some similarities with projects like Django-Tastypie and Flask-RESTful while also being web framework agnostic.
Get started by visiting our Docs and checking out the Quickstart section.
Key Features
Given a series of SQLAlchemy models, corresponding Marshmallow schemas and Drowsy resources based off those models can be easily defined (or dynamically generated). By using those resources, the following features are made available:
Filter any resource collection by any field or nested resource field. Filters are not limited to an equality check, but can also handle >, >=, <=, and <, along with simple like text searches.
Optionally embed nested resources within a result, enabling getting all child resources along with the parent resource in a single database query.
Filter any embedded nested resource to get back only the child objects you want.
Complex conditional filters may be applied to resources or nested resources as well using MQLAlchemy style syntax.
Easily override fields to prevent them from being queried, or define specific query whitelist rules and permissions.
Sort and paginate resource collections.
Create or update resources, including their own nested resources, all in one API call and database transaction.
Parse filters, sorts, and pagination info from query params.
Dynamically route all API requests to the appropriate resource.
Requirements
The project is largely built around Marshmallow and SQLAlchemy. There has been an explicit attempt to keep things modular and extensible, but if you want to use a different ORM or different schema toolkit it’ll take a good bit of manual effort.
Drowsy is however web framework agnostic, and is capable of working with Flask, CherryPy, Bottle.py, Falcon, or any other Python web framework.
Contributing
Submit a pull request to the dev branch and make sure to include an updated AUTHORS with your name along with an updated CHANGES.rst.
License
MIT
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
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 drowsy-1.0.0.tar.gz.
File metadata
- Download URL: drowsy-1.0.0.tar.gz
- Upload date:
- Size: 88.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
77a17d7013d3f64735e29abcc7832e21de6eeaad588c42b58aacff1bbba6b110
|
|
| MD5 |
e5a9e3c4288c63364b2355d2ece0b01b
|
|
| BLAKE2b-256 |
332fbde27f5c420d00dbe7c714ab5b63c97122029f4b100fb6540d51a90fcc66
|
File details
Details for the file drowsy-1.0.0-py3-none-any.whl.
File metadata
- Download URL: drowsy-1.0.0-py3-none-any.whl
- Upload date:
- Size: 71.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b5fbfac3d071b69cae195ffc08ab2e7c11b13771bf9a032af4975208f75092b
|
|
| MD5 |
ddffccc25654d71070c9732752f23b52
|
|
| BLAKE2b-256 |
b9403219ae0902a63120f222b0136e0487e297cddc54d6b4e54f6b75a5ed0106
|