semvec/pypi-packages huggingface dataset:
torch-repr-shape 0.0.2
Patch torch.Tensor.__repr__ to include tensor shape.
Requires Python: >=3.8

## torch_repr_shape

A tiny utility that patches `torch.Tensor.__repr__` so that every printed tensor shows its shape.

一个很小的工具，用来给 `torch.Tensor.__repr__` 打补丁，让你在 `print(tensor)` 时一眼看到张量的形状。在 VS Code 的 Debugger 中更有用。

示例输出：

```text
{Tensor:(2, 3)} tensor([[...]])
```

也就是说，原本的 PyTorch 输出前面会多一段 `{Tensor:(shape)}`。

---

## Features / 特性

- ✅ **Lazy loading / 惰性加载**：可以在导入 `torch` 之前或之后调用，首次导入 `torch` 时自动打补丁。
- ✅ **Idempotent / 幂等**：多次调用 `enable_torch_repr_shape()` 不会重复打补丁。
- ✅ **One-click disable / 一键关闭**：通过环境变量 `DISABLE_TORCH_REPR_SHAPE=1` 即可禁用。
- ✅ **Fail-safe / 安全兜底**：如果补丁失败，会自动忽略错误，不影响你的正常代码。

---

## Installation / 安装

```bash
pip install torch_repr_shape
```

请确保你已经在环境中安装了 PyTorch（如 `torch`, `torchvision` 等），本包只对已有的 PyTorch 做输出增强。

---

## Quick Start / 快速上手

在任何需要的地方调用一次 `enable_torch_repr_shape()` 即可：

```python
from torch_repr_shape import enable_torch_repr_shape

enable_torch_repr_shape()

import torch

x = torch.randn(2, 3)
print(x)
```

典型输出类似：

```text
{Tensor:(2, 3)} tensor([[ 0.1234, -0.5678, ...],
                        [...,      ...,      ...]])
```

你也可以在已经导入 `torch` 之后调用，效果相同：

```python
import torch
from torch_repr_shape import enable_torch_repr_shape

enable_torch_repr_shape()

print(torch.zeros(4, 5))
```

---

## Disable via env / 环境变量关闭

如果某些场景下你不想改写 `torch.Tensor.__repr__`，可以通过环境变量一键关闭：

```bash
DISABLE_TORCH_REPR_SHAPE=1 python your_script.py
```

当 `DISABLE_TORCH_REPR_SHAPE=1` 时，`enable_torch_repr_shape()` 会直接返回，不做任何修改。

---

## How it works / 实现原理

- 如果此时 `torch` 已经在 `sys.modules` 中，直接给 `torch.Tensor.__repr__` 打补丁。
- 如果还没有导入 `torch`，临时 hook 内置 `__import__`，在第一次导入 `torch` 时打补丁，然后恢复原来的导入逻辑。
- 新的 `__repr__` 会在原有输出前面加上 `{Tensor:(shape)}`，比如 `{Tensor:(2, 3, 4)}`。
- 使用一个内部标记属性 `__repr__adds_shape__` 确保不会重复打补丁。

---

## Use cases / 适用场景

- 快速区分多个 tensor 的尺寸。
- VS Code Debugger 中显示 tensor shape。
- 在 REPL / Jupyter / 脚本中频繁 `print(tensor)` 时，更快定位维度错误。

---

## Development / 开发信息

欢迎在 PyPI 上使用 `torch_repr_shape` 并在实际项目中反馈问题或改进建议。
tilsit-i18n 1.0.0
Translation services
Requires Python: >=3.13

# tilsit-i18n

`tilsit-i18n` is a lightweight wrapper around Python’s built‑in `gettext` module.
Its purpose is to make internationalization **simple and runtime‑switchable**
with a single global translation object.

```python
from pathlib import Path
from tilsit_i18n import tr

tr.localedir = Path(__file__).parent / "locale"
tr.language = "pl"
print(tr("Hello"))
```
---

## ✨ Features

- Simple, minimalistic interface: **use `tr("message")` anywhere**
- Runtime language switching (`tr.language = "pl"`)
- Built on `gettext` — full `.po`/`.mo` compatibility
- Safe fallbacks:
  - English (`"en"`) as default
  - `NullTranslations` when `.mo` not found
- Automatic logging of missing translation files
- Zero dependencies beyond Python + `loguru`

---

## 📦 Installation

```bash
pip install tilsit-i18n
```

---

## 🧩 Usage

### Initialize the translation directory

```python
from pathlib import Path
from tilsit_i18n import tr

tr.localedir = Path(__file__).parent / "locale"
```

### Set language

```python
tr.language = "pl"
```

### Translate messages

```python
print(tr("Hello world"))
```

When the language is `"en"` (default), the message is returned unchanged.

---

## 🔧 Generating `.mo` files

Translations are edited in `.po` files and compiled to `.mo`.

Compile:

```bash
msgfmt.py -o messages.mo messages
```

---

## 🧪 Example `.po`

```po
msgid "Hello"
msgstr "Cześć"

msgid "Exit"
msgstr "Wyjście"
```

---

## ⚠️ Error handling

`tilsit-i18n` logs common issues:

- Missing `localedir`
- Missing `.mo` file for selected language

Example log:

```
ERROR localedir is not initialized
ERROR .mo file is not found
```

---

## 💡 Internals (how it works)

The core object:

```python
@dataclass
class Translation:
    default_language = "en"
    default_domain = "messages"

    localedir: Path | None = None
    _language: str = "en"
    _gnutranslations = gettext.NullTranslations()
```

It:

- Tracks language
- Loads the correct `GNUTranslations` object
- Falls back to English when needed
- Is callable: `tr("message")`

---

## 🤝 Contributing

Issues, pull requests and suggestions are welcome!

---

## 📝 License

MIT License — see `LICENSE` for details.
handsoff 1.2.0
Auto file tranfer with scp command.
Requires Python: >=3.11.13

# Handsoff

Automatic file transfer with `scp` `UNIX` command.

# Installation

It's on `pip` server.

```bash
pip install handsoff
```

# Usage Examples

## In terminal

### Set

```bash
handsoff set user=MovingJu port=22 host=localhost client="README.md" server="Target_dir"
```

or you can simply define these attributes in .env file and recall env file.

```env
HOST = "localhost"
PORT = "22"
USER = "MovingJu"
```

```bash
handsoff set env="handsoff.env"
```

### Push or Pull

```bash
handsoff (push/pull) ^`client` ^`server`
```

> ^ is optional.

## In python code

```python
import handsoff

handsoff.set(
    "dasom.io",
    "MovingJu",
    client="./",
    server="~/",
    pem="./ssh_throughout.pem",
    port="0425"
)
print(handsoff.get())
handsoff.push("main.py", "project.sh", target="~/")

```
vitag 1.2.0
Tag music files using your $EDITOR
Requires Python: >=3.10
Keywords: audio, music, cli, metadata, id3

# vitag
![Python](https://img.shields.io/badge/python-3.10+-blue) ![License](https://img.shields.io/badge/license-MIT-blue.svg) ![PyPI](https://img.shields.io/pypi/v/vitag.svg)

A minimal CLI tool inspired by [vidir](https://github.com/trapd00r/vidir), enabling fast batch editing of audio metadata in your favorite text editor (default is your $EDITOR system var).

## Features

- Collects audio files from given paths
- Extracts tags using `mutagen` and writes them into a temp file in a structured `json` format
- Lets you edit the json in your preferred text editor
- Validates changes, detects conflicts, and translates the json updates to audio file tags
- **Supported formats**:
    - MP3
    - FLAC

## Requirements

- `Python 3.10+`
- [`mutagen`](https://pypi.org/project/mutagen/)
- [`typer`](https://pypi.org/project/typer/)

## Instalation

Install through [pip](https://pip.pypa.io/en/stable/):

```bash
$ pip install vitag
```

Or clone the repository:
```bash
$ git clone https://github.com/Tx270/vitag
$ cd vitag
# build locally and install with pip
$ pip install .
# or manually install dependencies and run
$ pip install mutagen typer
$ python3 "./cli.py"
```

## Usage

For more info check `--help`

```bash
vitag [PATH ...] \
    [--recursive -r] \
    [--editor -e TEXT] \
    [--verbose -v] \
    [--extensions -x TEXT]
```

## Examples

```bash
# Edit all audio files in a folder
vitag "Omnium Gatherum/"

# Edit all audio files in current directory that have mp3 or wav extensions
vitag --extensions mp3,wav

# Edit multiple paths at once with custom editor
vitag "01 Robot Stop.mp3" "Fishing for Fishies/" -e nano

# Recursive scan (for example useful for albums with many disks)
vitag "Petrodragonic Apocalypse/" -r
```
The star (*) symbol means that the tag is not the same between all given files
```json
{
  "artist": "King Gizzard",
  "album": "*",
  "genre": "*",
  "year": 2018
}
```
You can edit, add and remove tags by editing the json
```json
{
  "artist": "King Gizzard",
  "album": "*",
  "genre": "pop",
  "year": 2020
}
```
In the example above, in all selected files:
 - `artist` and `album` tags will stay the same for each file
 - `genre` tag will be changed to *pop* regardless of the previous value
 - `year` tag will be changed to *2020*.

## Roadmap

- Extensions:
    - [X]  Add `--extension` option to filter file types
    - [ ]  Test with more audio formats
    - [X]  Add supported audio formats to the README file
- UI/UX:
    - [X]  Add progress bars for loading and saving tags
    - [ ]  Add better error messages
- Distribution:
    - [X]  Upload package to PyPI
- Features:
    - [ ]  Add cover art support


## License

See [LICENSE](https://github.com/Tx270/vitag/blob/main/LICENSE)
py-mineatar 1.0.2
A Python wrapper for the Mineatar API.
Requires Python: >=3.11
Keywords: mineatar, minecraft, api, wrapper

# py-mineatar
[![Tests](https://github.com/rzn1r/py-mineatar/actions/workflows/test.yml/badge.svg)](https://github.com/rzn1r/py-mineatar/actions/workflows/test.yml)
[![Ruff Lint](https://github.com/rzn1r/py-mineatar/actions/workflows/lint.yml/badge.svg)](https://github.com/rzn1r/py-mineatar/actions/workflows/lint.yml)
![PyPI - Version](https://img.shields.io/pypi/v/py-mineatar)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/py-mineatar)
![License](https://img.shields.io/github/license/rzn1r/py-mineatar)

A Python wrapper for mineatar.io

## Installation
You can install the package via pip:

```bash
pip install py-mineatar
```

## Usage
Here's an example of how to use the `py-mineatar` package:

### Synchronous Example

```python
from mineatar import MineatarClient

with MineatarClient() as client:
    avatar_bytes = client.get_skin("069a79f4-44e9-4726-a5be-fca90e38aaf5") # Notch's UUID

    # Save the avatar image
    with open("notch_skin.png", "wb") as f:
        f.write(avatar_bytes)
```

### Asynchronous Example

```python
import asyncio
from mineatar import AsyncMineatarClient

async def main():
    async with AsyncMineatarClient() as client:
        avatar_bytes = await client.get_skin("069a79f4-44e9-4726-a5be-fca90e38aaf5") # Notch's UUID

        # Save the avatar image
        with open("notch_skin.png", "wb") as f:
            f.write(avatar_bytes)

asyncio.run(main())
```

## Features
- Fast and easy access to Minecraft avatars and skins.
- Supports both synchronous and asynchronous operations.
- Simple and easy-to-use.

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

## Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue.