Skip to main content

The web framework for inventors

Project description

Emmett

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.9 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

emmett-2.7.1.tar.gz (363.1 kB view details)

Uploaded Source

Built Distribution

emmett-2.7.1-py3-none-any.whl (265.3 kB view details)

Uploaded Python 3

File details

Details for the file emmett-2.7.1.tar.gz.

File metadata

  • Download URL: emmett-2.7.1.tar.gz
  • Upload date:
  • Size: 363.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for emmett-2.7.1.tar.gz
Algorithm Hash digest
SHA256 886d3fa28c9c6c30404635d78fedff7a1f40a479e84adc9f09848b55ea2c4b1a
MD5 e9d915d188969c64caf93871a019a2f4
BLAKE2b-256 cfa926a44311262ea8a3c401d88b85f886af1572b8292fcc17372cec1e4a4031

See more details on using hashes here.

Provenance

The following attestation bundles were made for emmett-2.7.1.tar.gz:

Publisher: publish.yml on emmett-framework/emmett

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file emmett-2.7.1-py3-none-any.whl.

File metadata

  • Download URL: emmett-2.7.1-py3-none-any.whl
  • Upload date:
  • Size: 265.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for emmett-2.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b5f4f7f118e13bccaa19c880584c15533f49b42de935d08956cca904f37225d
MD5 20d02257ce40f16572fb04232ca66c04
BLAKE2b-256 96de3ef6cae8cf9622f91ddffd3b7e829cda748f369cb55a4f0dbadf1dcec0db

See more details on using hashes here.

Provenance

The following attestation bundles were made for emmett-2.7.1-py3-none-any.whl:

Publisher: publish.yml on emmett-framework/emmett

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page