semvec/pypi-packages huggingface dataset:
anno2ls 0.1.0
Helper to import images and annotations to Label Studio
License: MIT
Requires Python: >=3.6

# anno2ls

**anno2ls** is a lightweight helper library to manage image and annotation import/export with [Label Studio](https://labelstud.io/). It simplifies importing images, pushing pre-annotated data (like LabelMe format), and removing tasks from your project using the Label Studio API.

---

## 🔧 Features

- Upload multiple images to a Label Studio project
- Import pre-annotated data (supports LabelMe format)
- Delete empty or all tasks from a project
- Fetch all filenames or task metadata from a project

---

## 📦 Installation

You can install via pip (after publishing to PyPI):

```bash
pip install anno2ls

Or use it locally:

git clone https://github.com/Vaaaaaalllll/anno2ls
cd anno2ls
pip install .
```

---

## 🧠 Usage

from anno2ls import anno2ls

```bash
# Initialize
from anno2ls import anno2ls

api_token = "your_label_studio_token"
ls_url = "https://your.labelstudio.instance"
project_id = 97

anno = anno2ls(token=api_token, url=ls_url)

# Upload all images from a directory
anno.import_images("path/to/image/folder", project_id)

# Import annotations in LabelMe format
anno.import_preannotated("path/to/json/folder", project_id)

# Delete all tasks in the project
anno.delete_all_task(project_id)

# Delete only empty (no annotation) tasks
anno.delete_empty_task(project_id)

# Get list of all task image filenames
filenames = anno.get_all_filenames(project_id)
```

---

## 📝 Annotation Format Support

Currently supported:

* LabelMe: Each image must have a .json file with the same base name (minus prefix) in the specified folder.

---

## 👤 Author

Val Kenneth Arado
📧 aradovalkenneth@gmail.com

---

## 🌐 Project Links

GitHub: https://github.com/Vaaaaaalllll/anno2ls
Label Studio: https://labelstud.io
pickle-openai 0.1.0
Securely Dumping and Loading an OpenAI Client with Pickle
License: MIT
Requires Python: <4,>=3.11

# pickle-openai

[![PyPI version](https://badge.fury.io/py/pickle-openai.svg)](https://badge.fury.io/py/pickle-openai)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Securely serialize and deserialize OpenAI client instances.

This library allows you to safely store your OpenAI client configuration (including API keys) in an encrypted format. It uses `pickle` for serialization and `cryptography` for strong encryption, requiring a password to protect your data.

## Installation

```bash
pip install pickle-openai
```

## Usage

Here's how to securely dump an `OpenAI` client to an encrypted string and load it back.

```python
import os
from pickle_openai import PickledOpenAI
from openai import OpenAI

# 1. Initialize your OpenAI client
# Make sure OPENAI_API_KEY is set in your environment
client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))

# 2. Create a PickledOpenAI instance from your client
pickled_client = PickledOpenAI.from_openai(client)

# 3. Dump the client to a password-protected, encrypted string
password = "your-strong-password"
encrypted_string = pickled_client.pickle_dumps(password)

print(f"Encrypted client string: {encrypted_string}")

# You can now store this encrypted_string safely.

# 4. Load the client back from the encrypted string
loaded_pickled_client = PickledOpenAI.pickle_loads(encrypted_string, password)

# 5. Recreate the OpenAI client
recreated_client = loaded_pickled_client.to_openai_sync()

# The recreated client is ready to use
response = recreated_client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello world!"}],
)
print(f"OpenAI API Response: {response.choices[0].message.content}")

```

This works for both `openai.OpenAI` and `openai.AzureOpenAI` clients (and their async versions).

## License

This project is licensed under the MIT License.