semvec/pypi-packages huggingface dataset:
virtual-term 2.0.2
A simple Python library for creating and interacting with virtual terminals
License: MIT
Requires Python: >=3.10

# VirtualTerm

_A simple Python library for creating and interacting with virtual terminals_

VirtualTerm is a Python library designed for creating and managing virtual terminal sessions programmatically. It allows users to run interactive shell commands, handle command timeouts, and monitor output streams within isolated terminal environments. This library is particularly useful for developers building automation tools, testing environments, or managing interactive shell-based workflows.

```python
import asyncio
from virtual_term import VirtualTerm

async def main():
    with await VirtualTerm.spawn() as term:
        term.write(b"sudo apt-get upgrade\n")
        await asyncio.sleep(1)
        print((await term.read_new_output()).decode())

        term.write(b"y\n")  # Respond with 'y' to confirm upgrade
        result = await term.wait_for_last_command()

        print(result.output.decode())
        assert result.return_code == 0

asyncio.run(main())
```

## Installation

Install with pip:

```sh
pip install virtual-term
```

## Development

VirtualTerm uses Rye for dependency management and development workflows. To get started with development, ensure you have [Rye](https://github.com/astral-sh/rye) installed, then clone the repository and set up the environment:

```sh
git clone https://github.com/MatthewScholefield/virtual-term.git
cd virtual-term
rye sync
rye run pre-commit install

# Run tests
rye test
```
wagtail-linksnippet 1.0.1
A Wagtail extension to open custom chooser from RichText Editor.
License: MIT

# Wagtail Link Snippet

This package provides a custom implementation for adding link buttons in Wagtail’s rich text editor to link specific snippets within the Wagtail admin interface.

![How to use it](wagtail_linksnippet.gif)

## Overview

The package integrates with Wagtail’s `ChooserViewSet` ([Wagtail documentation](https://docs.wagtail.org/en/v6.2.2/extending/generic_views.html#chooserviewset)).
The package works only if the snippet has the get_absolute_url method implemented.


## Installation and Setup

pip install watail_linksnippet

Make sure to include the relevant app that contains the rich text features and handlers in your INSTALLED_APPS within settings.py.
```python
INSTALLED_APPS = [
    # Other installed apps
    'wagtail_linksnippet',
]
```

## Usage Example

You can configure the snippet choosers in your wagtail_hooks.py file by registering the chooser viewsets.

```python
from wagtail_linksnippet.richtext_utils import add_snippet_link_button

add_snippet_link_button(snippet1_chooser_viewset)
add_snippet_link_button(snippet2_chooser_viewset)
```

## Bonus TitleExtraChooseView
The package includes a view_utils.py module designed to add attributes to chooser modal links, similar to how attributes are handled in the page chooser modal.

Here’s an example of how to use the **TitleExtraChooseView** module:

```python
# views.py

from wagtail.admin.views.generic.chooser import ChooseView
from wagtail_linksnippet.views_utils import CustomChooseView

class CustomChooseView(TitleExtraChooseView):
    # Your code here
```
rclone-crypt 1.2.0
Python implementation of encryption/decryption for rclone (crypt storage)
License: MIT
Requires Python: >=3.8
Keywords: rclone, decrypt, encrypt

# rclone_crypt_py

[English](https://github.com/Ftbom/rclone_crypt_py/blob/main/README.md), [简体中文](https://github.com/Ftbom/rclone_crypt_py/blob/main/README-zh.md)

Python implementation of encryption/decryption for rclone (crypt storage)

## Usage

```python
from rclone import Crypt
# Initialize
# Pass in passwd1 and passwd2

# The password here is the password for creating the crypt, not the password in the rclone configuration file
# If passwd2 is not set, the second parameter can be omitted
crypt = Crypt('PvrhK9lOaJMdJO2', 'bjnW66SNkUuV4hX')

# To use passwords directly in the rclone configuration file(obscured password), you should set the passwd_obscured parameter to True.
# crypt = Crypt('SpnX0yEFxpNJjo9bxd3xAlVoXA7F4cr3C0SA-zmfzw', 'ziWH7jKYerB6o5vHnaXAvISTguFD6ZFJFbhT3BlLVQ', True)

# File encryption/decryption
crypt.File.file_decrypt(input_file_path, output_file_path)
crypt.File.file_encrypt(input_file_path, output_file_path)

# File path encryption/decryption
# obfuscate
crypt.Name.obfuscate_encrypt('Hello,Word')
crypt.Name.obfuscate_decrypt('188.Nkrru,cuxj')

#standard
crypt.Name.standard_encrypt('Hello,Word/你好，世界')
crypt.Name.standard_decrypt('tj0ivgsmd9vh4ccfov7f739in0/lb8g1ak1849smj6mlmpv2c5aio')
```

```python
from rclone import Crypt
crypt = Crypt('PvrhK9lOaJMdJO2', 'bjnW66SNkUuV4hX')

# bytes decryption
with open('test.bin', 'rb') as f:
    f.seek(8) # Skip the fixed file header b'RCLONE\x00\x00'
    init_nonce = f.read(24) # Read the nonce
    f.seek(5 * (1024 * 64 + 16), 1) # Skip 5 data blocks
    input_bytes = f.read(10 * (1024 * 64 + 16)) # Read 10 data blocks
    output_bytes = crypt.File.bytes_decrypt(input_bytes, init_nonce, 5) # Decrypt the data blocks

# bytes encryption
import nacl
with open('test.bin', 'wb') as f:
    f.write(b'RCLONE\x00\x00') # Write the standard header
    init_nonce = nacl.utils.random(24) # Generate a random nonce (24 bits)
    f.write(init_nonce) # Write the nonce
    with open('origin.bin', 'rb') as fl:
        origin_bytes = fl.read(1024 * 64 * 10) # Read 10 data blocks
        i = 0
        while origin_bytes:
            f.write(crypt.File.bytes_encrypt(origin_bytes, init_nonce, i))
            origin_bytes = fl.read(1024 * 64 * 10)
            i = i + 10
```