semvec/pypi-packages huggingface dataset:
llm-tools-docker 0.1a0
Run commands in a Docker container via an LLM tool
Requires Python: >=3.9

# llm-tools-docker

[![PyPI](https://img.shields.io/pypi/v/llm-tools-docker.svg)](https://pypi.org/project/llm-tools-docker/)
[![Changelog](https://img.shields.io/github/v/release/simonw/llm-tools-docker?include_prereleases&label=changelog)](https://github.com/simonw/llm-tools-docker/releases)
[![Tests](https://github.com/simonw/llm-tools-docker/actions/workflows/test.yml/badge.svg)](https://github.com/simonw/llm-tools-docker/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/llm-tools-docker/blob/main/LICENSE)

Run commands in a Docker container via an LLM tool

## Installation

Install this plugin in the same environment as [LLM](https://llm.datasette.io/).
```bash
llm install llm-tools-docker
```
## Usage

To use this with the [LLM command-line tool](https://llm.datasette.io/en/stable/usage.html):

```bash
llm chat -T DockerAlpine --tools-debug --chain-limit 0
```
Then in the chat try:

> `Install Python 3 and use it to draw a cowsay cow`

This plugin currently only works with `llm chat` since the container is not persisted across multiple calls.

## Warning

This is a *very early alpha*. Every time you start a new chat it will create a new Docker container without closing down the previous one.

It will mount the current directory as a volume in the container, so commands that run in Docker will be able to modify or delete files in that directory.

## Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:
```bash
cd llm-tools-docker
python -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
llm install -e '.[test]'
```
To run the tests:
```bash
python -m pytest
```
mailgrab 1.3.0
Un outil Python pour extraire des adresses email depuis des pages web ou des fichiers texte.
Requires Python: >=3.7

[![PyPI Downloads](https://static.pepy.tech/badge/mailgrab)](https://pepy.tech/projects/mailgrab)
![PyPI](https://img.shields.io/pypi/v/mailgrab?style=flat-square)
![GitHub issues](https://img.shields.io/github/issues/nanaelie/mailgrab?style=flat-square)
![GitHub last commit](https://img.shields.io/github/last-commit/nanaelie/mailgrab?style=flat-square)
![License](https://img.shields.io/github/license/nanaelie/mailgrab?style=flat-square)
![Python](https://img.shields.io/badge/python-3.x-blue?style=flat-square)

# mailgrab

**mailgrab** is a Python tool designed to extract email addresses from web pages or text files. It uses regular expressions for email extraction and Playwright for web scraping. This tool is perfect for collecting email addresses from multiple sources.

## Features

- Extracts email addresses from a URL or text file
- Extracts emails from `mailto:` links in HTML
- Uses **Playwright** for headless web scraping
- Searches with **regular expressions**
- Simple **command-line interface (CLI)**
- Can be used as a **Python module**

## Installation

Install `mailgrab` from [PyPI](https://pypi.org/project/mailgrab/):

```bash
pip install mailgrab
````

> ⚠️ Make sure to install [Playwright](https://playwright.dev/python/docs/intro) browsers:

```bash
python -m playwright install
```

## Usage

### CLI (Command Line)

```bash
$ mailgrab --help                            
usage: mailgrab [-h] (--url WEBSITE_URL | --file PATH_TO_FILE) [-v]

Collection of emails in text file or website page.

options:
  -h, --help           show this help message and exit
  --url WEBSITE_URL    Website url to read and extract emails
  --file PATH_TO_FILE  Path to file to read and extract emails
  -v, --version        show program's version number and exit
```

#### Examples

```bash
mailgrab --url "https://example.com"        # Extract emails from https://example.com
mailgrab --file "file.txt"                  # Extract emails from file.txt
mailgrab -v                                 # Show program's version
```

### As a Python module

```python
import mailgrab as mgb  # or from mailgrab import *

# Validate the path to a file containing emails
path = mgb.validate_path("file.txt")

# Read file content
with open(path, "r") as f:
    content = f.read()

# Extract emails from content
emails = mgb.extract_emails(content)

# Display emails using the built-in printer
mgb.print_emails(emails)
```

## CLI Example Output

```bash
[¤] Found 3 unique email address(es):

 1) contact@example.com
 2) info@example.org
 3) support@sample.net
```

## Path validation

When using the `--file` option or `validate_path()` function, mailgrab ensures:

* the path exists,
* it is a valid file,
* it can be opened for reading.

If not, a `MailgrabError` with a clear message is raised.

## Contributing

Want to improve this project? Awesome!
Please read the [contributing guidelines](CONTRIBUTING.md) before submitting a pull request.

## License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.