emmett


Nameemmett JSON
Version 2.6.2 PyPI version JSON
download
home_pageNone
SummaryThe web framework for inventors
upload_time2024-11-15 16:49:37
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseBSD-3-Clause
keywords asyncio web
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Emmett](https://emmett.sh/static/img/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}
```

## 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, contents under [validators](https://github.com/emmett-framework/emmett/tree/master/emmett/validators) and [libs](https://github.com/emmett-framework/emmett/tree/master/emmett/libs) are included in Emmett under their original licenses. Please check the source code for more details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "emmett",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "asyncio, web",
    "author": null,
    "author_email": "Giovanni Barillari <g@baro.dev>",
    "download_url": "https://files.pythonhosted.org/packages/89/d1/d9ac12336fafc757aafdde178435d79732f2d2290c86d228d0e97c1411f0/emmett-2.6.2.tar.gz",
    "platform": null,
    "description": "![Emmett](https://emmett.sh/static/img/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## 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, contents under [validators](https://github.com/emmett-framework/emmett/tree/master/emmett/validators) and [libs](https://github.com/emmett-framework/emmett/tree/master/emmett/libs) are included in Emmett under their original licenses. Please check the source code for more details.\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "The web framework for inventors",
    "version": "2.6.2",
    "project_urls": {
        "Documentation": "https://emmett.sh/docs",
        "Funding": "https://github.com/sponsors/gi0baro",
        "Homepage": "https://emmett.sh",
        "Issues": "https://github.com/emmett-framework/emmett/issues",
        "Source": "https://github.com/emmett-framework/emmett"
    },
    "split_keywords": [
        "asyncio",
        " web"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84c534e1902058404b3bfdcb7fa4ac7b0a318f283faab7e76ab0b07b9eb6ab83",
                "md5": "1f000be8d21cec09bcca4cd098de4aeb",
                "sha256": "250dd3e08219b22635cec4569d79c8ff2d9b57d4e90f583de9bb0b89d8f14573"
            },
            "downloads": -1,
            "filename": "emmett-2.6.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f000be8d21cec09bcca4cd098de4aeb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 263708,
            "upload_time": "2024-11-15T16:49:35",
            "upload_time_iso_8601": "2024-11-15T16:49:35.325393Z",
            "url": "https://files.pythonhosted.org/packages/84/c5/34e1902058404b3bfdcb7fa4ac7b0a318f283faab7e76ab0b07b9eb6ab83/emmett-2.6.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "89d1d9ac12336fafc757aafdde178435d79732f2d2290c86d228d0e97c1411f0",
                "md5": "4db8cdc99ac2a673ac4453d73e148419",
                "sha256": "31653565f2b7017f73987f80b17dd360cc8e3889bb356f5d9965c42970912cff"
            },
            "downloads": -1,
            "filename": "emmett-2.6.2.tar.gz",
            "has_sig": false,
            "md5_digest": "4db8cdc99ac2a673ac4453d73e148419",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 360208,
            "upload_time": "2024-11-15T16:49:37",
            "upload_time_iso_8601": "2024-11-15T16:49:37.555144Z",
            "url": "https://files.pythonhosted.org/packages/89/d1/d9ac12336fafc757aafdde178435d79732f2d2290c86d228d0e97c1411f0/emmett-2.6.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 16:49:37",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "sponsors",
    "github_project": "gi0baro",
    "github_not_found": true,
    "lcname": "emmett"
}
        
Elapsed time: 0.54117s