semvec/pypi-packages huggingface dataset:
plpy-man 0.2.0
Simplifies working with PlPython
License: MIT
Requires Python: >=3.8,<4.0
Keywords: plpythonu,plpython3u

# Plpy Man 🦸‍♂️
###### PlPython manager that synchronizes Python code between your web server and Postgres database 
[comment]: <> (No more messing about with PlPgSQL; Plpy Man to the rescue!)

## Quickstart
### Write database function in pure Python.
```python
import plpy_man
import sqlalchemy as sa
from sqlalchemy.orm import Session

# Setup your database
engine = sa.create_engine("<Postgres connection string>")
db = sa.orm.Session(bind=engine)


# Write the database function. Decorate it with plpy_man.plpy_func.
@plpy_man.plpy_func
def py_add(x, y):
    return x + y


# Flush the function to the database!
plpy_man.flush(db)

value = db.execute(sa.text("SELECT py_add(3, 5)"))
assert value == 8
```
### Synchronizes Python code between your web server and database functions
Ensure your PlPython functions match the web-server functions by copying them to PlPython's GD (Gloabl Dict)
```python
import plpy_man
import sqlalchemy as sa
from plpy_man.mocks import plpy, GD
from sqlalchemy.orm import Session, declarative_base

# Setup your database
engine = sa.create_engine("<Postgres connection string>")
db = sa.orm.Session(bind=engine)
Base = declarative_base()
class Employees(Base):
    __tablename__ = "employees"
    id = sa.Column("id", sa.Integer, primary_key=True),
    name = sa.Column("name", sa.TEXT, nullable=False),
    pay = sa.Column("pay", sa.Integer)
db.add(Employees(id=1, name="Alice", pay=15))
db.add(Employees(id=2, name="Bob", pay=15))
db.add(Employees(id=3, name="Charlie", pay=200))
db.flush()


# Write a function.
# This function will be available in both your Python and PlPython scripts
def py_average(sequence):
    return sum(sequence) / len(sequence)


plpy_man.to_gd(py_average)


@plpy_man.plpy_func
def average_wage():
    rows = plpy.execute("SELECT pay FROM employees;")
    wages = [row["pay"] for row in rows]
    average = round(GD["py_average"](wages), 2)
    return f"Average wage is ${average}"


# Flush py_average to the Global Dict and average_wage to the database
plpy_man.flush()

value = db.execute(sa.text("SELECT living_wages()"))
assert value == "Average wage is $76.67"
```
wusa 0.0.4
CLI for managing containerized self-hosted GitHub Actions Runner
License: MIT
Requires Python: >=3.7,<4.0

# Wusa

> Isis (Ancient Egyptian: ꜣst; Coptic: Ⲏⲥⲉ Ēse; Classical Greek: Ἶσις Isis; Meroitic: 𐦥𐦣𐦯‎ Wos[a] or <span style="text-decoration: underline;">Wusa</span>) was a major goddess in ancient Egyptian religion whose worship spread throughout the Greco-Roman world.
>
> Source: [Wikipedia](https://en.wikipedia.org/wiki/Isis)

![Demo video for Wusa](docs/assets/wusa_demo.gif)

Wusa is also a command-line tool to help manage _containerized self-hosted GitHub Action Runner_. In some rare cases, you might require special hardware to execute your CI/CD pipeline. For these cases, `wusa` removes the burden of setting up a docker container on your local machine, connecting it to your GitHub repositories, and managing it over time.

> **WARNING** wusa is in the early stages, and issues might appear. Please try it out and let me know what you think of wusa.

## Installation

If you wish to install wusa, use pip

```shell
pip install wusa
```

or use [pipx](https://github.com/pipxproject/pipx)

```shell
pipx install wusa
```

## Usage

Wusa uses, at the moment, a ubuntu image with the GitHub Action runners. Wusa requires permission to be able to create runners for you. For this, run the following command and follow the steps:

```shell
wusa auth
```

Afterward, you can create a containerized docker runner for a repo by running

```shell
wusa create "ahelm/wusa"
```

With `"ahelm/wusa"` is the short name of the repository.

If you wish to list all the runner for a repository, run

```shell
wusa list-repo "ahelm/wusa"
```

or if you wish to remove a runner

```shell
wusa remove <some_runner_name>
```