semvec/pypi-packages huggingface dataset:
pyxi 0.1.4
A small library for interacting with `.pyxel` files from PyxelEdit.
Requires Python: >=3.8

# Pyxi
[![PyPI version](https://badge.fury.io/py/pyxi.svg)](https://badge.fury.io/py/pyxi) [![Documentation Status](https://readthedocs.org/projects/pyxi/badge/?version=latest)](https://pyxi.readthedocs.io/en/latest/?badge=latest)

`pyxi` is a small library for interfacing with PyxelEdit `.pyxel` files in an object-oriented manner.
Currently it allows for viewing all attributes of a `.pyxel` file, modifying values, and repacking the file
into its original format for use within PyxelEdit.

### Examples
Editing tile width and height on an image.
```python
from pyxi import PyxelImage

p = PyxelImage('test_8px.pyxel')  # assume the tiles are 8x8
p.extract()  # extracts all the files into the converted/ directory (seperated layers, json data)
```

Loading a `.pyxel` file as a texture in `arcade`.
```python
import arcade
from pyxi import PyxelImage

p = PyxelImage('test_8px.pyxel')
texture = p.get_tile()  # returns a Pillow Image object
player = arcade.Sprite(scale=4)
player.texture = arcade.Texture(name='S8dhS7dja', image=texture)
```
pyft232 0.12
Python bindings to d2xx and libftdi to access FT232 chips with the same interface as pyserial. Using this method gives easy access to the additional features on the chip like CBUS GPIO.

# pyft232

This module provides a simple Serial-Like interface to FT232 chips while still
allowing access to the CBUS pins for controlling simple signals.

Ctypes is used to interface with either FTDI's d2xx library (when available)
or libftdi. In this way this package works on both Windows and Linux (and other
libftdi supported OS's) without needing to mess with the FTDI drivers on windows.

In contrast, pyftdi is more feature rich and also cross platform but requires
special drivers on windows so you can't also use the FTDI chip as a pure
COM port.


## Usage

```python
import ft232

serial_number = "FT1234"

try:
    sp = ft232.Ft232(serial_number, baudrate=115200)
except ft232.Ft232Exception:
    print("Unable to open the ftdi device: %s" % serial_number)
    sys.exit(1)

#You may use sp as you would a Serial object
sp.write(b"Hello World!\n")
resp = sp.read(100)

#If you want to use the CBUS pins, you enable them with cbus_setup
# 'mask' is a bitmask which specifies which pins to enable
# 'init' is a bitmask for the initial value for each pin
sp.cbus_setup(mask=3, init=3)

#Change the current value of all setup pins
sp.cbus_write(2)

#Print the current value of all setup pins
print("CBUS: %s" % sp.cbus_read())

```