semvec/pypi-packages huggingface dataset:
fooster-web 0.4.0rc1
a small, process-pooled web server utilizing the built-in Python socketserver
License: MIT
Requires Python: >=3.6

fooster-web
===========

fooster-web is a small, process-pooled web server utilizing the built-in Python socketserver. It is designed from the ground up to be well structured, to conform to the HTTP/1.1 standard, and to allow for easy creation of a RESTful interface.

[![Build Status](https://img.shields.io/github/workflow/status/lilyinstarlight/python-fooster-web/Tox)](https://github.com/lilyinstarlight/python-fooster-web/actions?query=workflow%3ATox) [![Coverage Status](https://img.shields.io/codecov/c/github/lilyinstarlight/python-fooster-web)](https://codecov.io/github/lilyinstarlight/python-fooster-web)


Usage
-----

Below is a basic example that stores data via a PUT method and retrieves data via a GET method on any resource. If a resource has not been set, it returns a 404 error.

```python
import fooster.db

import fooster.web


data = fooster.db.Database('data.db', ['path', 'body'])


class Handler(fooster.web.HTTPHandler):
    def do_get(self):
        try:
            return 200, data[self.groups['path']].body
        except KeyError:
            raise fooster.web.HTTPError(404)

    def do_put(self):
        data[self.groups['path']] = data.Entry(self.request.body.decode())

        return 200, 'Accepted\n'

    def do_delete(self):
        try:
            del data[self.groups['path']]
        except KeyError:
            raise fooster.web.HTTPError(404)

        return 200, 'Deleted\n'


routes = {r'/(?P<path>.*)': Handler}


if __name__ == '__main__':
    import signal

    httpd = fooster.web.HTTPServer(('localhost', 8000), routes)

    httpd.start()

    signal.signal(signal.SIGINT, lambda signum, frame: httpd.close())

    httpd.join()
```

Examples and more information are available at the [wiki](https://github.com/lilyinstarlight/python-fooster-web/wiki).
xbox-remote 1.0.5
A Python package to connect to xbox and interface with its buttons and joysticks
License: MIT

xbox.py
=======

Python class to support reading xbox 360 wired and wireless controller input under Linux.  Makes it easy to get real-time input from controller buttons, analog sticks and triggers.  Built and tested on RaspberryPi running Raspbian.

Requires that xboxdrv be installed first:

    sudo apt-get install xboxdrv

To test the driver, issue the following command and see if the controller inputs are recognized

    sudo xboxdrv --detach-kernel-driver

See http://pingus.seul.org/~grumbel/xboxdrv/ for details on xboxdrv

Download the python module and sample code with the following:

    wget https://raw.githubusercontent.com/FRC4564/Xbox/master/xbox.py
    wget https://raw.githubusercontent.com/FRC4564/Xbox/master/sample.py

You can run the sample code to see how the Joystick class works.

    sudo python sample.py

Example class usage:

    import xbox
    joy = xbox.Joystick()         #Initialize joystick
    
    if joy.A():                   #Test state of the A button (1=pressed, 0=not pressed)
        print 'A button pressed'
    x_axis   = joy.leftX()        #X-axis of the left stick (values -1.0 to 1.0)
    (x,y)    = joy.leftStick()    #Returns tuple containing left X and Y axes (values -1.0 to 1.0)
    trigger  = joy.rightTrigger() #Right trigger position (values 0 to 1.0)
    
    joy.close()                   #Cleanup before exit

Note:
Run your code with sudo privileges to allow xboxdrv the necessary control over USB devices.
If you want, you can provide your user account with the proper access, so you needn't use sudo.

First, add your user to the root group. Here's how to do this for the user ‘pi’

    sudo usermod -a -G root pi

Create a permissions file using the nano text editor.

    sudo nano /etc/udev/rules.d/55-permissions-uinput.rules

Enter the following rule and save your entry.

    KERNEL=="uinput", MODE="0660", GROUP="root"

Troubleshooting
---------------

I find that xboxdrv occasionally has trouble connecting to the controller.  You may see a USB device error or something similar.  Issuing the following command will detach and reconnect the controller.

    sudo xboxdrv --detach-kernel-driver
    
You should now be able to move the joysticks and press buttons to see the controller state display for all inputs.  Just press Ctrl-C to exit and then relaunch your python code that uses xbox.py.

If your wireless controller still won't connect, press the sync button on the controller and the receiver (both devices need to be powered).

Usage
-----

A good application for an XBox controller is for robot control.  Check out [Basic PiBot](https://github.com/FRC4564/BasicPiBot) for more details.