The web framework for inventors
Project description
Emmett is a full-stack Python web framework designed with simplicity in mind.
The aim of Emmett is to be clearly understandable, easy to be learned and to be used, so you can focus completely on your product's features:
from emmett import App, request, response
from emmett.orm import Database, Model, Field
from emmett.tools import service, requires
class Task(Model):
name = Field.string()
is_completed = Field.bool(default=False)
app = App(__name__)
app.config.db.uri = "postgres://user:password@localhost/foo"
db = Database(app)
db.define_models(Task)
app.pipeline = [db.pipe]
def is_authenticated():
return request.headers.get("api-key") == "foobar"
def not_authorized():
response.status = 401
return {'error': 'not authorized'}
@app.route(methods='get')
@requires(is_authenticated, otherwise=not_authorized)
@service.json
async def todo():
page = request.query_params.page or 1
tasks = Task.where(
lambda t: t.is_completed == False
).select(paginate=(page, 20))
return {'tasks': tasks}
Documentation
The documentation is available at https://emmett.sh/docs.
The sources are available under the docs folder.
Examples
The bloggy example described in the Tutorial is available under the examples folder.
Status of the project
Emmett is production ready and is compatible with Python 3.8 and above versions.
Emmett follows a semantic versioning for its releases, with a {major}.{minor}.{patch}
scheme for versions numbers, where:
- major versions might introduce breaking changes
- minor versions usually introduce new features and might introduce deprecations
- patch versions only introduce bug fixes
Deprecations are kept in place for at least 3 minor versions, and the drop is always communicated in the upgrade guide.
How can I help?
We would be very glad if you contributed to the project in one or all of these ways:
- Talking about Emmett with friends and on the web
- Adding issues and features requests here on GitHub
- Participating in discussions about new features and issues here on GitHub
- Improving the documentation
- Forking the project and writing beautiful code
License
Emmett is released under the BSD License.
However, due to original license limitations, contents under validators and libs are included in Emmett under their original licenses. Please check the source code for more details.
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 emmett-2.6.2.tar.gz
.
File metadata
- Download URL: emmett-2.6.2.tar.gz
- Upload date:
- Size: 360.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31653565f2b7017f73987f80b17dd360cc8e3889bb356f5d9965c42970912cff |
|
MD5 | 4db8cdc99ac2a673ac4453d73e148419 |
|
BLAKE2b-256 | 89d1d9ac12336fafc757aafdde178435d79732f2d2290c86d228d0e97c1411f0 |
Provenance
The following attestation bundles were made for emmett-2.6.2.tar.gz
:
Publisher:
publish.yml
on emmett-framework/emmett
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
emmett-2.6.2.tar.gz
- Subject digest:
31653565f2b7017f73987f80b17dd360cc8e3889bb356f5d9965c42970912cff
- Sigstore transparency entry: 149126787
- Sigstore integration time:
- Predicate type:
File details
Details for the file emmett-2.6.2-py3-none-any.whl
.
File metadata
- Download URL: emmett-2.6.2-py3-none-any.whl
- Upload date:
- Size: 263.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 250dd3e08219b22635cec4569d79c8ff2d9b57d4e90f583de9bb0b89d8f14573 |
|
MD5 | 1f000be8d21cec09bcca4cd098de4aeb |
|
BLAKE2b-256 | 84c534e1902058404b3bfdcb7fa4ac7b0a318f283faab7e76ab0b07b9eb6ab83 |
Provenance
The following attestation bundles were made for emmett-2.6.2-py3-none-any.whl
:
Publisher:
publish.yml
on emmett-framework/emmett
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
emmett-2.6.2-py3-none-any.whl
- Subject digest:
250dd3e08219b22635cec4569d79c8ff2d9b57d4e90f583de9bb0b89d8f14573
- Sigstore transparency entry: 149126791
- Sigstore integration time:
- Predicate type: