Metadata-Version: 2.1
Name: pykite
Version: 1.0.1
Summary: A Python-centric micro-framework for building web applications
Home-page: https://github.com/imamhossainroni/pykite
Author: Imam Hossain Roni
Author-email: imamhossainroni95@gmail.com
Project-URL: Bug Tracker, https://github.com/imamhossainroni/pykite/issues
Project-URL: Source Code, https://github.com/imamhossainroni/pykite
Project-URL: Documentation, https://github.com/imamhossainroni/pykite/blob/main/README.md
Project-URL: Icon Image, https://raw.githubusercontent.com/ImamHossainRoni/pykite/main/extras/yellow-kite.png
Keywords: pykite,web framework,micro framework,web applications,Python,HTTP,WSGI
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: parse
Requires-Dist: werkzeug

### PyKite: A research and development initiative for crafting a Python-centric micro framework.

[//]: # (![Pykite, the Python framework]&#40;./extras/yellow-kite.png&#41;)
![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.

## Middleware
Middleware in web development refers to software components that sit between a web server and an application. They intercept requests and responses, allowing for additional processing or modification before they reach the application or client. Middleware can be used for tasks like authentication, authorization, logging, caching, and more. Let's see [ 👉 how to use middleware in `PyKite`](docs/middleware.md)  framework. 


## License

This project is licensed under the [MIT License](LICENSE).
