semvec/pypi-packages huggingface dataset:
abletonparsing 0.1.3
Python module for parsing Ableton Live ASD clip files containing warp markers.
Requires Python: >=3.8

# AbletonParsing

[![CI](https://github.com/DBraun/AbletonParsing/actions/workflows/ci.yml/badge.svg)](https://github.com/DBraun/AbletonParsing/actions/workflows/ci.yml)
[![PyPI version](https://badge.fury.io/py/abletonparsing.svg)](https://badge.fury.io/py/abletonparsing)

Parse an Ableton ASD clip file and its warp markers in Python. This module has been tested with `.asd` files saved with Ableton 9 and Ableton 10. 

**Note:** Ableton Live 12 uses a different binary format that is not yet supported by this library.

## Install

`pip install abletonparsing`

### Development Dependencies

To run the tests, you'll need to install additional dependencies:

```bash
# On macOS
brew install rubberband

# On Ubuntu/Debian
sudo apt-get install -y rubberband-cli

# Install Python test dependencies
pip install abletonparsing[test]
# or
pip install -e ".[test]"  # for development
```

## API

Clip class:
* .loop_on - ( bool , READ/WRITE ) - Loop toggle is on
* .start_marker - ( float , READ/WRITE ) - Start marker in beats relative to 1.1.1
* .end_marker - ( float , READ/WRITE ) - End marker in beats relative to 1.1.1
* .loop_start - ( float , READ/WRITE ) - Loop start in beats relative to 1.1.1
* .loop_end - ( float , READ/WRITE ) - Loop end in beats relative to 1.1.1
* .hidden_loop_start - ( float , READ/WRITE ) - Hidden loop start in beats relative to 1.1.1
* .hidden_loop_end - ( float , READ/WRITE ) - Hidden loop end in beats relative to 1.1.1
* .warp_markers - ( list[WarpMarker] , READ/WRITE ) - List of warp markers
* .warp_on - ( bool , READ/WRITE ) - Warping is on
* .sr - ( float , READ/WRITE ) - Sample rate of audio data

WarpMarker class:
* .seconds - ( float , READ/WRITE ) - Position in seconds in the audio data.
* .beats - ( float , READ/WRITE ) - Position in "beats" (typically quarter note) relative to 1.1.1

If `loop_on` is false, then `loop_start` will equal the `start_marker`, and `loop_end` will equal the `end_marker`.

## Example

```python
import abletonparsing

import librosa
import soundfile as sf
import pyrubberband as pyrb

bpm = 130.
audio_path = 'drums.wav'
clip_path = audio_path + '.asd'

audio_data, sr = librosa.load(audio_path, sr=None, mono=False)
num_samples = audio_data.shape[1]

clip = abletonparsing.Clip(clip_path, sr, num_samples)

time_map = clip.get_time_map(bpm)

# Time-stretch the audio to the requested bpm.
output_audio = pyrb.timemap_stretch(audio_data.transpose(), sr, time_map)

with sf.SoundFile('output.wav', 'w', sr, 2, 'PCM_24') as f:
	f.write(output_audio)
```
mlpLogger 0.1.0
A Python package to set up structured logging for your applications.
Requires Python: >=3.7


# mlpLogger

**mlpLogger** is a Python package designed to simplify structured logging for your applications. It provides easy-to-use methods to create daily log files, manage log handlers, and include structured metadata in your logs.

---

## 📦 Installation

Install the latest version from [PyPI](https://pypi.org/project/mlpLogger/) using:

```bash
pip install mlpLogger
```

---

## 🚀 Usage

Here’s a quick example of how to use `mlpLogger` in your project:

```python
from mlpLogger import MLPLogger

# Initialize the logger
logger = MLPLogger()

# Print the current log file name
print(f"Current log file: {logger.logfilename}")

# Log a simple info message
logger.logger.info("This is a simple info log message.")

# Change the log file name dynamically
logger.logfilename = "custom_mlpLogger.log"
print(f"Updated log file: {logger.logfilename}")

# Log a message to the new file
logger.logger.info("This is a log message in the new file.")

# Log a structured 'success' outcome
log_extras = logger.logSuccess({})
print(f"Logged success with extras: {log_extras}")
```

---

## 🛠️ Features

✅ **Automatic Daily Log Files**  
✅ **Structured Logging with ECS Formatter**  
✅ **Dynamic Log File Switching**  
✅ **Helper Methods for Structured Logging (e.g., `logSuccess`)**  
✅ **Fully Configurable for Use in Any Project**

---

## 🔧 Methods

- **`MLPLogger.logfilename`**  
  - *Getter*: Prints and returns the current log filename.  
  - *Setter*: Dynamically updates the log file and reconfigures the logger.

- **`MLPLogger.logSuccess(logExtrasIn)`**  
  - Logs a structured “success” message and returns the updated dictionary of log extras.

- **`MLPLogger.createDailyLogfileName(logfile)`**  
  - Creates a daily log filename based on UTC date.

- **`MLPLogger.createScriptRunID(scriptname)`**  
  - Generates a unique ID for script runs.

---

## 📂 Project Structure

```
mlpLogger/
├── mlpLogger/          # Main package module
│   ├── __init__.py
│   └── mlpLogger.py
├── tests/              # Unit tests
├── LICENSE
├── README.md
├── setup.py
├── pyproject.toml
└── example_usage.py    # Demonstration script
```

---

## ⚖️ License

This project is licensed under the **MIT License**. See the [LICENSE](LICENSE) file for details.

---

## 👤 Author

**Michael Baskaran**  
Email: [mbas@caasco.ca](mailto:mbas@caasco.ca)  

---

## 🙏 Contributing

Contributions are welcome! Please fork this repository and submit a pull request with your improvements.

---

**mlpLogger** — making structured logging simpler and more reliable for your Python applications!