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["Api-Key"] == "foobar"
    
def not_authorized():
    response.status = 401
    return {'error': 'not authorized'}

@app.route(methods='get')
@service.json
@requires(is_authenticated, otherwise=not_authorized)
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}

pip version Tests Status

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

Emmmett is released under the BSD License.

However, due to original license limitations, some components are included in Emmett under their original licenses. Please check the LICENSE file 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.5.2.tar.gz (412.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

emmett-2.5.2-py3-none-any.whl (449.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: emmett-2.5.2.tar.gz
  • Upload date:
  • Size: 412.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.9 Linux/5.15.0-1037-azure

File hashes

Hashes for emmett-2.5.2.tar.gz
Algorithm Hash digest
SHA256 74a99b350ad98cf5448734eb82b457cfd58ff35d0c9ea7f96cd6c3c0395e38f9
MD5 0c2b2bdbf5e1d3ec222b3173ff359c26
BLAKE2b-256 63186141f5af378e578bd8957c79957142b9ad2276302b440ee476b0e1929dbc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: emmett-2.5.2-py3-none-any.whl
  • Upload date:
  • Size: 449.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.10.9 Linux/5.15.0-1037-azure

File hashes

Hashes for emmett-2.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8694eac3a8302db7f10fb9c4b9d7953b8971d9043db6eee6c9f10c2758b20020
MD5 124036084e399ae16ade2b4a628a4bd9
BLAKE2b-256 bfe4dbea7fac3e120b7efb12f318c4fc7da05165c7f5117b90db7450e48cb6a3

See more details on using hashes here.

Supported by

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