emmett


Nameemmett JSON
Version 2.5.9 PyPI version JSON
download
home_pagehttps://emmett.sh
SummaryThe web framework for inventors
upload_time2024-01-28 15:21:48
maintainer
docs_urlNone
authorGiovanni Barillari
requires_python>=3.8,<4.0
licenseBSD-3-Clause
keywords web asyncio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Emmett](https://deneb.spaces.amira.io/emmett/artwork/logo-bwb-xb-xl.png)

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:

```python
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}
```

[![pip version](https://img.shields.io/pypi/v/emmett.svg?style=flat)](https://pypi.python.org/pypi/emmett)
![Tests Status](https://github.com/emmett-framework/emmett/workflows/Tests/badge.svg)

## Documentation

The documentation is available at [https://emmett.sh/docs](https://emmett.sh/docs).
The sources are available under the [docs folder](https://github.com/emmett-framework/emmett/tree/master/docs).

## Examples

The *bloggy* example described in the [Tutorial](https://emmett.sh/docs/latest/tutorial) is available under the [examples folder](https://github.com/emmett-framework/emmett/tree/master/examples). 

## 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](https://emmett.sh/docs/latest/upgrading).

## 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, some components are included 
in Emmett under their original licenses. Please check the LICENSE file for 
more details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://emmett.sh",
    "name": "emmett",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "",
    "keywords": "web,asyncio",
    "author": "Giovanni Barillari",
    "author_email": "gi0baro@d4net.org",
    "download_url": "https://files.pythonhosted.org/packages/6a/46/2cdbcae91ede5cb499d28a747444f5d07e06a27e7326998bbb06f4f22471/emmett-2.5.9.tar.gz",
    "platform": null,
    "description": "![Emmett](https://deneb.spaces.amira.io/emmett/artwork/logo-bwb-xb-xl.png)\n\nEmmett is a full-stack Python web framework designed with simplicity in mind.\n\nThe aim of Emmett is to be clearly understandable, easy to be learned and to be \nused, so you can focus completely on your product's features:\n\n```python\nfrom emmett import App, request, response\nfrom emmett.orm import Database, Model, Field\nfrom emmett.tools import service, requires\n\nclass Task(Model):\n    name = Field.string()\n    is_completed = Field.bool(default=False)\n\napp = App(__name__)\napp.config.db.uri = \"postgres://user:password@localhost/foo\"\ndb = Database(app)\ndb.define_models(Task)\napp.pipeline = [db.pipe]\n\ndef is_authenticated():\n    return request.headers.get(\"api-key\") == \"foobar\"\n    \ndef not_authorized():\n    response.status = 401\n    return {'error': 'not authorized'}\n\n@app.route(methods='get')\n@requires(is_authenticated, otherwise=not_authorized)\n@service.json\nasync def todo():\n    page = request.query_params.page or 1\n    tasks = Task.where(\n        lambda t: t.is_completed == False\n    ).select(paginate=(page, 20))\n    return {'tasks': tasks}\n```\n\n[![pip version](https://img.shields.io/pypi/v/emmett.svg?style=flat)](https://pypi.python.org/pypi/emmett)\n![Tests Status](https://github.com/emmett-framework/emmett/workflows/Tests/badge.svg)\n\n## Documentation\n\nThe documentation is available at [https://emmett.sh/docs](https://emmett.sh/docs).\nThe sources are available under the [docs folder](https://github.com/emmett-framework/emmett/tree/master/docs).\n\n## Examples\n\nThe *bloggy* example described in the [Tutorial](https://emmett.sh/docs/latest/tutorial) is available under the [examples folder](https://github.com/emmett-framework/emmett/tree/master/examples). \n\n## Status of the project\n\nEmmett is production ready and is compatible with Python 3.8 and above versions.\n\nEmmett follows a *semantic versioning* for its releases, with a `{major}.{minor}.{patch}` scheme for versions numbers, where:\n\n- *major* versions might introduce breaking changes\n- *minor* versions usually introduce new features and might introduce deprecations\n- *patch* versions only introduce bug fixes\n\nDeprecations are kept in place for at least 3 minor versions, and the drop is always communicated in the [upgrade guide](https://emmett.sh/docs/latest/upgrading).\n\n## How can I help?\n\nWe would be very glad if you contributed to the project in one or all of these ways:\n\n* Talking about Emmett with friends and on the web\n* Adding issues and features requests here on GitHub\n* Participating in discussions about new features and issues here on GitHub\n* Improving the documentation\n* Forking the project and writing beautiful code\n\n## License\n\nEmmett is released under the BSD License.\n\nHowever, due to original license limitations, some components are included \nin Emmett under their original licenses. Please check the LICENSE file for \nmore details.\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "The web framework for inventors",
    "version": "2.5.9",
    "project_urls": {
        "Documentation": "https://emmett.sh/docs",
        "Homepage": "https://emmett.sh",
        "Issue Tracker": "https://github.com/emmett-framework/emmett/issues",
        "Repository": "https://github.com/emmett-framework/emmett"
    },
    "split_keywords": [
        "web",
        "asyncio"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1a2be6b6fe9a323df50e778acbde880a79703a6543012dcef24970fa49c13823",
                "md5": "cd6cb688efd5b8734745bc3c0ed6c790",
                "sha256": "2e3e3b56d953983ba8c644bef703893a51dc947f49a64b560737ed692c559487"
            },
            "downloads": -1,
            "filename": "emmett-2.5.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cd6cb688efd5b8734745bc3c0ed6c790",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 450400,
            "upload_time": "2024-01-28T15:21:46",
            "upload_time_iso_8601": "2024-01-28T15:21:46.262162Z",
            "url": "https://files.pythonhosted.org/packages/1a/2b/e6b6fe9a323df50e778acbde880a79703a6543012dcef24970fa49c13823/emmett-2.5.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6a462cdbcae91ede5cb499d28a747444f5d07e06a27e7326998bbb06f4f22471",
                "md5": "38d10d3eb2da66634912c47f565cab4d",
                "sha256": "b84a86da0b6136298a7610d756f6ca47ce005eb35ce657995d24a37a5414f98a"
            },
            "downloads": -1,
            "filename": "emmett-2.5.9.tar.gz",
            "has_sig": false,
            "md5_digest": "38d10d3eb2da66634912c47f565cab4d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 412850,
            "upload_time": "2024-01-28T15:21:48",
            "upload_time_iso_8601": "2024-01-28T15:21:48.517399Z",
            "url": "https://files.pythonhosted.org/packages/6a/46/2cdbcae91ede5cb499d28a747444f5d07e06a27e7326998bbb06f4f22471/emmett-2.5.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-28 15:21:48",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "emmett-framework",
    "github_project": "emmett",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "emmett"
}
        
Elapsed time: 0.17547s