semvec/pypi-packages huggingface dataset:
ftprelay 0.1
A framework for mock FTP servers that relay uploaded files
License: MIT
Requires Python: >=3.9,<4.0

# ftprelay

`ftprelay` is a lightweight Python module that provides a simple framework for setting up a minimal, non-persisting FTP server whose single purpose is to execute custom code on uploaded files before discarding them.

It was developed with the goal of retrofitting older devices or software that exclusively support FTP upload for file transfer, enabling a broader range of applications.

## Quick Navigation

- [Installation](#installation)
- [Usage](#usage)
- [Example](#example)
- [License](#license)

## Installation

Install `ftprelay` using pip:

```bash
pip install ftprelay
```

## Usage

1. Implement the `process_file()` method in a custom class that inherits from `FileProcessor`. This method defines how
   uploaded files should be processed.
2. Implement the `authenticate()` method in a custom class that inherits from `Authenticator`. This method should either
   raise an `AuthenticationFailedError` or, upon successful authentication, return an instance of the custom `FileProcessor` that dictates how the file should be processed for this user.
3. Instantiate and start FTPRelay:

```python
    relay = FTPRelay(authenticator=MyCustomAuthenticator(), host='127.0.0.1', port=21)
relay.start()
```

This initializes an FTP server, where logins are authenticated using your custom Authenticator. Upon successful
authentication, uploaded files are temporarily stored. The storage path of each file is then passed to the associated
FileProcessor class returned by the Authenticator. Finally, the files are promptly deleted after processing.

### Caveats

- Any other operation other than file upload is denied by the FTP server with a 550 error code.
- There are no subfolders on the FTP server, nor does it allow the creation of any. Thus, all files must be directly
  uploaded to the root directory.
- Using interactive FTP browsers to access the server may result in errors, as they are restricted from reading the
  contents of the root directory.

## Example

A basic example for a FTP relay that sends the uploaded files via email to a recipient address depending on the user.

```python
from dataclasses import dataclass
from pathlib import Path

from ftprelay import AuthenticationFailedError, Authenticator, FileProcessor, FTPRelay


@dataclass
class CustomFileProcessor(FileProcessor):
    recipient_email: str

    def process_file(self, path: Path) -> None:
        # Placeholder code: send email with attachment
        send_email(to=self.recipient_email, attachment=path)


class CustomAuthenticator(Authenticator):

    def authenticate(self, username: str, password: str) -> FileProcessor:
        # Placeholder code: verify credentials
        if verify(username, password):
            return CustomFileProcessor(recipient_email=f"{username}@example.org")
        else:
            raise AuthenticationFailedError()

# Instantiate and start the FTPRelay
relay = FTPRelay(authenticator=CustomAuthenticator(), host='127.0.0.1', port=21)
relay.start()
```

## License

`ftprelay` is distributed under the terms of the MIT License.
check-keepass-passwords 0.1
A command-line tool that scans Keepass 2.x databases for weak or compromised passwords
License: MIT
Requires Python: >=3.11,<4.0

# check-keepass-passwords

`check-keepass-passwords` is a command-line tool that scans Keepass 2.x databases for weak or compromised passwords.

## Quick Navigation

- [Installation](#installation)
- [Usage](#usage)
- [Background](#background)
- [License](#license)

## Installation

Requires Python version 3.9 or higher and pip.

```bash
pip install check-keepass-passwords
```

## Usage

```bash
check-keepass-passwords /path/to/database.kdbx
```

## Background

- The compromise check is powered by [https://github.com/lionheart/pwnedpasswords](pwnedpasswords). For implementation
  details and security notes, refer to their repository.
- Password scoring is powered by [zxcvbn](https://github.com/dwolfhub/zxcvbn-python), which rates passwords on a scale
  from 0 to 4. By default, `check-keepass-passwords` considers a score of 2 to be sufficiently safe. You can customize
  this threshold using the `--min-score` parameter.

## License

`check-keepass-passwords` is distributed under the terms of the MIT License.
apt-log 0.1
A command-line tool and module for convenient APT log file display and filtering
License: MIT
Requires Python: >=3.11,<4.0

# apt-log

`apt-log` is a command-line tool that offers a user-friendly display and convenient filtering for APT package logs.

The package also contains a Python module that provides a parser and high-level interface to APT package logs.

## Quick Navigation

- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Installation

Requires Python version 3.9 or higher and pip.

```bash
pip install apt-log
```

## Usage

Expore the entire history

```bash
apt-log list
```

### Quick filters

- by time range:

  ```bash
  apt-log list -s 2023-01-01 -e 2023-01-31
  ```

- by a specific package or multiple packages using glob-style pattern matching:

  ```bash
  apt-log list -n python3
  apt-log list -n 'python3.*'
  ```

### Dive into details

Inspect a specific log entry using the assigned ID in the list.

```bash
apt-log show 13
```

**Note:** The IDs are not generated by APT itself but are assigned by `apt-log` in ascending chronological order. Be aware that any manipulation of APT log files, such as the deletion of old log files, may result in changes to these IDs.

## License

`apt-log` is distributed under the terms of the MIT License.