# PyKite: A research and development initiative for crafting a Python-centric micro framework.
[//]: # (![Pykite, the Python framework](./extras/yellow-kite.png))
![PyKite Icon](https://raw.githubusercontent.com/ImamHossainRoni/pykite/main/extras/yellow-kite.png)
## Features
- **Route Definition:** Define routes using the `@app.route(path)` decorator.
- **HTTP Request Handling:** Create handler functions for each route to process and respond to incoming HTTP requests.
- **Development Server:** Start a development server with a single command, making it easy to test your application locally.
- **Basic Error Handling:** Includes a default 404 response for routes that are not found.
## Installation
To get started with PyKite, follow these steps:
```bash
pip install pykite
```
## Run the application
1. Create a Python script for your web application using PyKite. Define routes and handlers as needed.
2. Run your application using the `run` method:
```python
from pykite import PyKite
from pykite.http.response import Response
# Create a PyKite application
app = PyKite(debug=True)
# Define a route for the '/' path
@app.route('/')
def index(request, response):
"""Respond with a JSON object containing the message "Hello, World!" to all requests to the '/' path."""
data = {"message": "Hello, World!"}
response = Response(data=data, status=200)
return response
@app.route('/hello/{name}')
def hello(request, response, name):
""" Took a name from the URL and responds with a friendly greeting in JSON."""
data = {"message": f"Hello, {name}"}
response = Response(data=data, status=200)
return response
# Run the application
if __name__ == "__main__":
app.run()
```
3. Access your application in a web browser at http://localhost:8000.
## License
This project is licensed under the [MIT License](LICENSE).
Raw data
{
"_id": null,
"home_page": "https://github.com/imamhossainroni/pykite",
"name": "pykite",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "pykite,web framework,micro framework,web applications,Python,HTTP,WSGI",
"author": "Imam Hossain Roni",
"author_email": "imamhossainroni95@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/60/77/af86c0810e72199056afe9ddaac8ec5fcf2fef22c28630aa3e2865f29002/pykite-0.3.0.tar.gz",
"platform": null,
"description": "# PyKite: A research and development initiative for crafting a Python-centric micro framework.\n\n[//]: # (![Pykite, the Python framework](./extras/yellow-kite.png))\n![PyKite Icon](https://raw.githubusercontent.com/ImamHossainRoni/pykite/main/extras/yellow-kite.png)\n\n## Features\n\n- **Route Definition:** Define routes using the `@app.route(path)` decorator.\n\n- **HTTP Request Handling:** Create handler functions for each route to process and respond to incoming HTTP requests.\n\n- **Development Server:** Start a development server with a single command, making it easy to test your application locally.\n\n- **Basic Error Handling:** Includes a default 404 response for routes that are not found.\n\n\n## Installation\nTo get started with PyKite, follow these steps:\n```bash\npip install pykite\n```\n## Run the application\n1. Create a Python script for your web application using PyKite. Define routes and handlers as needed.\n2. Run your application using the `run` method:\n\n```python\nfrom pykite import PyKite\nfrom pykite.http.response import Response\n\n# Create a PyKite application\napp = PyKite(debug=True)\n\n\n# Define a route for the '/' path\n@app.route('/')\ndef index(request, response):\n \"\"\"Respond with a JSON object containing the message \"Hello, World!\" to all requests to the '/' path.\"\"\"\n data = {\"message\": \"Hello, World!\"}\n response = Response(data=data, status=200)\n return response\n\n\n@app.route('/hello/{name}')\ndef hello(request, response, name):\n \"\"\" Took a name from the URL and responds with a friendly greeting in JSON.\"\"\"\n data = {\"message\": f\"Hello, {name}\"}\n response = Response(data=data, status=200)\n return response\n\n\n# Run the application\nif __name__ == \"__main__\":\n app.run()\n\n```\n3. Access your application in a web browser at http://localhost:8000.\n\n\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n",
"bugtrack_url": null,
"license": "",
"summary": "A Python-centric micro-framework for building web applications",
"version": "0.3.0",
"project_urls": {
"Bug Tracker": "https://github.com/imamhossainroni/pykite/issues",
"Documentation": "https://github.com/imamhossainroni/pykite/blob/main/README.md",
"Homepage": "https://github.com/imamhossainroni/pykite",
"Icon Image": "https://raw.githubusercontent.com/ImamHossainRoni/pykite/main/extras/yellow-kite.png",
"Source Code": "https://github.com/imamhossainroni/pykite"
},
"split_keywords": [
"pykite",
"web framework",
"micro framework",
"web applications",
"python",
"http",
"wsgi"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "dfb60e8d184c9c8c5c3a812fd3519f30841f0ef74ad6fe76a37697ba4dddf734",
"md5": "92ce17ae845c3186b51fba8a8fc0b4b6",
"sha256": "46d12ed799ca08521db4a1e006aa750cef6afcf6eb1c51a21c6fd8b6289a31fa"
},
"downloads": -1,
"filename": "pykite-0.3.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "92ce17ae845c3186b51fba8a8fc0b4b6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 8067,
"upload_time": "2023-09-04T18:58:23",
"upload_time_iso_8601": "2023-09-04T18:58:23.859177Z",
"url": "https://files.pythonhosted.org/packages/df/b6/0e8d184c9c8c5c3a812fd3519f30841f0ef74ad6fe76a37697ba4dddf734/pykite-0.3.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6077af86c0810e72199056afe9ddaac8ec5fcf2fef22c28630aa3e2865f29002",
"md5": "308a8c031072cb389417a99a404f1495",
"sha256": "f4bfcb4d8e903ee58ec3429aade347b5720307868e3a782d997fc3c098f65988"
},
"downloads": -1,
"filename": "pykite-0.3.0.tar.gz",
"has_sig": false,
"md5_digest": "308a8c031072cb389417a99a404f1495",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5943,
"upload_time": "2023-09-04T18:58:25",
"upload_time_iso_8601": "2023-09-04T18:58:25.827370Z",
"url": "https://files.pythonhosted.org/packages/60/77/af86c0810e72199056afe9ddaac8ec5fcf2fef22c28630aa3e2865f29002/pykite-0.3.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-04 18:58:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "imamhossainroni",
"github_project": "pykite",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "pykite"
}