semvec/pypi-packages huggingface dataset:
oberoon 0.1.3
A simple Python WSGI framework built for learning purposes
License: MIT
Requires Python: >=3.10.0


# Oberoon: Python Web Framework

![Oberoon framework logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2l8tlofpzya247a3pils.png)

![purpose](https://img.shields.io/badge/purpose-learning-green)

![PyPI - Version](https://img.shields.io/pypi/v/oberoon)

Oberoon is a WSGI framework for Python, written for mainly learning purposes. Can be used with any WSGI server such as Gunicorn. 

Soon, the author is planning to release his own WSGI server - Obicorn, then you can easily integrate the framework with it.

**Source code**: https://github.com/Samandar-Komilov/oberoon

## Installation

```bash
  pip install oberoon
```

## How to use it

### Basic Usage

```python
from oberoon.app import Oberoon


app = Oberoon()


# Simple text response handlers
@app.route("/home", allowed_methods=["get"])
def home(request, response):
    response.text = "Hello from the Home Page"


# Parametrized handlers
@app.route("/hello/{name}")
def greeting(request, response, name):
    response.text = f"Hello {name}"


# Class-based handlers
@app.route("/books")
class Books:
    def get(self, request, response):
        response.text = "Books page"
    
    def post(self, request, response):
        response.text = "Endpoint to create a book\n"


# Explicit addition of handlers
def new_handler(request, response):
    response.text = "From new handler"

app.add_route("/new-handler", new_handler)


# Templates support
@app.route("/template")
def template(req, resp):
    resp.body = app.template(
        "home.html",
        context = {"new_title": "Best Title", "new_body": "Best Body"}
    ).encode()


# JSON response handlers
@app.route("/json")
def json_handler(request, response):
    response_data = {"name": "some name", "type": "json"}
    response.json = response_data
```

## Unit Tests

The recommended way of writing unit tests is with [pytest](https://docs.pytest.org/en/stable/). Here is an example:

```python
def test_basic_route_adding(app):
    @app.route('/home')
    def home(req, resp):
        resp.text = "Hello from Home"


def test_parametrized_routes(app, test_client):
    @app.route("/hello/{name}")
    def greeting(request, response, name):
        response.text = f"Hello {name}"

    assert test_client.get("http://testserver/hello/Sam").text == "Hello Sam"


def test_class_based_get(app, test_client):
    @app.route("/books")
    class Books:
        def get(self, request, response):
            response.text = "Books page"

    response = test_client.get("http://testserver/books")
    assert response.text == "Books page"
    assert response.status_code == 200
```
pyxo 1.2.2
An easy way to create XO game with python.
License: MIT
Requires Python: <4.0,>=3.10

## Pyxo package :

an easy way to create **XO game** with python.

<p align="center">
    <a href="https://github.com/ouhammmourachid/pyxo/blob/main/LICENSE" >
        <img src="https://img.shields.io/github/license/ouhammmourachid/pyxo"
            alt="GitHub LICENSE" /></a>
    <a href="https://pypistats.org/packages/pyxo">
        <img src="https://img.shields.io/pypi/dm/pyxo"
            alt="Mounthly Download" /></a>
    <a href="https://pypi.org/project/pyxo/">
        <img src="https://img.shields.io/pypi/v/pyxo.svg?style=flat"
            alt="latest version" /></a>
    <a href="https://pypi.org/project/pyxo/">
        <img src="https://img.shields.io/pypi/pyversions/pyxo"
            alt="suported python version" /></a>
</p>

#### get staretd:

* you need to install the package from the pypi by `pip install pyxo`.
* you are ready to play you just need create a game with the building Engin and the run easy .

```python
from pyxo import Engin

game:Engin = Engin()

game.run()

```
or by running
```shell
$ pyxo
# or
$ python -m pyxo
```
```shell
           _____ _        _____            _____
          |_   _(_) ___  |_   _|_ _  ___  |_   _|__   ___
            | | | |/ __|   | |/ _` |/ __|   | |/ _ \ / _ \
            | | | | (__    | | (_| | (__    | | (_) |  __/
            |_| |_|\___|   |_|\__,_|\___|   |_|\___/ \___|

            by ouhammmourachid                      v1.2.2


                welcome to the game [X,O]

      that is the roles you should chose one the nomber between (1...9)

                        _|___|___|___|_
                         | 1 | 2 | 3 |
                        _|___|___|___|_
                         | 4 | 5 | 6 |
                        _|___|___|___|_
                         | 7 | 8 | 9 |
                        _|___|___|___|_
                         |   |   |   |

      should we start who will begin first you or your friend !

 press ENTER to begin ..

```
have fun playing with your friend.