semvec/pypi-packages huggingface dataset:
py-script-exec 1.2.0
A cross-platform Python script runner.
Requires Python: >=3.6

# py_script_exec

A Python utility to execute Python scripts with arguments across different operating systems.

## Features

- Run Python scripts programmatically.
- Handles arguments seamlessly.
- Compatible with both `python` and `python3` without changes.

---

## Installation

To use `py_script_exec`, install via pip:

```bash
pip install py_script_exec
```

```python
from py_script_exec import py_run

# Run a Python script with arguments
exit_code, stdout, stderr = py_run("example.py", ["arg1", "arg2"])

print(f"Exit Code: {exit_code}")
print(f"Output: {stdout}")
print(f"Error: {stderr}")
```
aire 0.0.2
AI-powered re
Requires Python: <4.0,>=3.12

## `aire`

Tired of wrestling with regex every once in a while? `aire` is an AI-powered `re` module.

It exposes one primitive `compile` which is equivalent to `re.compile` but you describe what the regex should be in 
natural language so you don't have to remember and relearn the rules. 

### 🚀 Quick Example

```
import aire

p = aire.compile("number indicating line item followed by a dot, space, and then the name of the section. Example is: 1. Introduction")

print(p.search("2. Related Materials"))
# <re.Match object; span=(0, 20), match='2. Related Materials'>
```

### 🛠️ Installation

Install from PyPI:

```
pip install aire
```

For local development, it's recommended to use [`poetry`](https://python-poetry.org/docs/):

```
poetry install 
poetry shell 
```

### 🤖 Which AI?

Currently it only works with OpenAI. Add your API_KEY as environment variable `export OPENAI_API_KEY=...` and `aire` will configure the client.
ezdvm 0.1.2
A simple python Data Vending Machine (DVM) implementation on nostr
Requires Python: >=3.12

# ezdvm
Easily run any python code behind a DVM on Nostr. Just pick a kind (for basic text-to-text use 5050) and put the code you want to run in the do_work() function. Then run the DVM. 

## Install from pip

```commandline
pip install ezdvm
```

## Install from local repo for development on ezdvm

```commandline
git clone https://github.com/dtdannen/ezdvm.git
cd ezdvm/
python3.12 -m venv venv
source venv/bin/activate
pip install -e .
```

## Create your own DVM

Steps:
1. Choose the job request kind in the init function
2. Run any python code inside the do_work() function. The `event` arg is the original job request from the user, in the form of `nostr-sdk event`, for python examples see here: https://github.com/rust-nostr/nostr/tree/master/bindings/nostr-sdk-ffi/bindings-python/examples

```python
from ezdvm import EZDVM


class HelloWorldDVM(EZDVM):

    def __init__(self):
        # choose the job request kinds you will listen and respond to
        super().__init__(kinds=[5050])

    async def do_work(self, event):
        return "Hello World!"


if __name__ == "__main__":
    hello_world_dvm = HelloWorldDVM()
    hello_world_dvm.add_relay("wss://relay.damus.io")
    hello_world_dvm.add_relay("wss://relay.primal.net")
    hello_world_dvm.add_relay("wss://nos.lol")
    hello_world_dvm.add_relay("wss://nostr-pub.wellorder.net")
    hello_world_dvm.start()
```



## Testing

Once it's running on your machine, if you are using kind 5050 you can test it here: https://dvmdash.live/playground/ 

_Note that currently you have to use a NIP-07 extension to login first_