vexy-lines-utils


Namevexy-lines-utils JSON
Version 1.0.8 PyPI version JSON
download
home_pageNone
SummaryCommand-line automation for batch exporting Vexy Lines vector art documents to PDF on macOS
upload_time2025-11-07 15:34:31
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseMIT
keywords automation batch-processing cli creative-tools macos pdf-export vector-art vexy-lines
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ---
this_file: README.md
---

# Vexy Lines Utils

Export Vexy Lines `.lines` documents to crisp PDFs without pointing and clicking. This package provides a command-line interface for batch automation of [Vexy Lines](https://www.vexy.art) on macOS, wrapping the exact workflow described in the original `vexy-lines2pdf.py` script with a Fire-powered CLI.

## About Vexy Lines

Vexy Lines is a creative desktop application that transforms photos, illustrations, AI-generated images and other bitmaps into expressive vector art. It reads the color value of every pixel and intelligently builds vector artwork from it.

### Core Concept

Feed it a portrait, get back an engraving. Drop in a landscape, receive flowing wave patterns. The software offers twelve different ways to interpret your images, each method responding to the light and dark areas of your source image differently. Dark areas generate thick strokes, bright areas create thin ones—or reverse it for dramatic effects.

### The 12 Fill Algorithms

- **Linear**: Classic copper-plate engravings with parallel straight lines
- **Wave**: Flowing parallel curves that undulate across your image
- **Radial**: Lines exploding from a center point like sun rays
- **Circular**: Concentric rings emanating outward
- **Spiral**: Continuous winding patterns from center to edge
- **Halftone**: Newspaper-style dots that scale with brightness
- **Trace**: Clean edge detection that converts boundaries to paths
- **Wireframe**: 3D-looking dimensional lattices
- **Scribble**: Hand-drawn energy with organic randomness
- **Fractal**: Intricate mathematical recursive patterns
- **Text**: Paint with letters and typography
- **Handmade**: Draw your own custom strokes for full control

### Professional Features

- **Layer System**: Stack multiple fills, organize with groups, control visibility with masks
- **Dynamic Color**: Strokes pull actual colors from source images segment by segment
- **3D Mesh Warping**: Wrap patterns around cylinders, drape over waves, add perspective
- **Multiple Sources**: Each group can reference different images for complex compositions
- **Production Export**: SVG, PDF, EPS for infinite scaling; PNG, JPEG for quick sharing
- **Overlap Control**: Fills can cut through each other creating woven effects

Files save as `.lines` projects that preserve every layer, fill, mask, mesh, and parameter—allowing iterative refinement.

## What This Package Provides

This automation tool helps power users and studios process large batches of Vexy Lines artwork efficiently:

- **Fire CLI**: A `vexy-lines` command implemented with Google's `fire` framework for intuitive command-line usage
- **Batch Processing**: Recursive discovery and processing of `.lines` files in folders or single-file operations
- **macOS Automation**: PyXA-powered menu control for **File → Export…** and **File → Close** operations
- **Smart Dialog Navigation**: `pyautogui-ng` keyboard automation to navigate save dialogs and set proper filenames
- **Voice Feedback**: Optional macOS text-to-speech announcements for accessibility
- **Dry-Run Mode**: Preview operations without touching the UI—perfect for CI tests or validating large batches
- **Robust Error Handling**: Continues processing remaining files even if individual exports fail

## System Requirements

- **macOS 10.14+** (required for PyXA automation framework)
- **Vexy Lines** desktop application installed
- **Python 3.10+**
- **4GB RAM** minimum (same as Vexy Lines)

## Installation

### From PyPI (Recommended)

```bash
pip install vexy-lines-utils
```

### From Source

```bash
git clone https://github.com/vexyart/vexy-lines-utils.git
cd vexy-lines-utils
pip install -e .
```

### Required Permissions

Grant accessibility permissions to your Terminal/IDE for UI automation:
1. Open **System Preferences** → **Security & Privacy**
2. Navigate to **Privacy** → **Accessibility**
3. Add your Terminal app or IDE
4. Restart Terminal/IDE after granting permissions

## Usage Examples

### Basic Export Operations

```bash
# Export a single document
vexy-lines export ~/Art/portrait.lines

# Export everything in a folder (recursive)
vexy-lines export ~/Projects/posters

# Process specific project with verbose output
vexy-lines export ~/Clients/BigCorp/logos --verbose

# Preview what would be processed without running
vexy-lines export ~/batch --dry_run --verbose

# Get voice confirmation when batch completes
vexy-lines export ~/batch --say_summary
```

### Advanced Workflows

```bash
# Process today's work
vexy-lines export ~/Desktop/vexy-today/ --verbose --say_summary

# Validate large batch before running
vexy-lines export ~/Archive/2024 --dry_run | grep "processed"

# Export with detailed logging for troubleshooting
vexy-lines export ~/problem-files/ --verbose 2>&1 | tee export.log
```

### Command-Line Arguments

**Required:**
- `target`: Path to a `.lines` file or folder containing them (searched recursively)

**Optional Flags:**
- `--verbose`: Show detailed progress including each file being processed
- `--dry_run`: Preview files that would be processed without UI automation
- `--say_summary`: Announce completion summary via macOS text-to-speech

### Output Format

The command returns a structured dictionary with export statistics:

```json
{
  "processed": 10,
  "success": 9,
  "failed": 1,
  "failures": [
    ["path/to/broken.lines", "Failed to open file"]
  ],
  "dry_run": false
}
```

## How It Works

1. **Discovery** – `find_lines_files` resolves the target path, supports single files, and sorts recursive directory walks for deterministic runs.
2. **App bridge** – `PyXABridge` launches/activates Vexy Lines via macOS scripting bridges and exposes a minimal interface (`window_titles`, `click_menu_item`).
3. **Window watching** – `WindowWatcher` polls the live window list so we wait for the expected document title, the Export dialog, and the Save dialog instead of relying on coarse `sleep()` delays.
4. **Keyboard automation** – `UIActions` wraps `pyautogui-ng` + `pyperclip` to press Command-Shift-G, paste the folder path, select the filename, and confirm overwrites.
5. **Verification** – the exporter waits for the Save window to close, then checks that the new PDF exists and is non-empty before moving on.

If any step fails (missing dialog, file cannot open, permissions issue, etc.), the run continues with the next `.lines` document and reports the failure reason in the final summary.

## Python API

For integration into larger workflows:

```python
from pathlib import Path
from vexy_lines_utils import VexyLinesExporter, AutomationConfig

# Create custom configuration
config = AutomationConfig(
    poll_interval=0.2,        # Window check frequency (seconds)
    wait_for_app=20.0,        # App launch timeout
    wait_for_file=20.0,       # File open timeout
    wait_for_dialog=25.0,     # Dialog appearance timeout
    post_action_delay=0.4     # Pause after UI actions
)

# Initialize exporter
exporter = VexyLinesExporter(config=config)

# Process files
stats = exporter.export(Path("~/Documents/vexy-projects"))

# Check results
print(f"Success rate: {stats.success}/{stats.processed}")
for path, reason in stats.failures:
    print(f"Failed: {path} - {reason}")
```

## Development

### Project Structure

```
vexy-lines-utils/
├── src/vexy_lines_utils/
│   ├── __init__.py           # Package exports
│   ├── vexy_lines_utils.py   # Main implementation
│   └── py.typed               # PEP 561 type marker
├── tests/
│   ├── test_package.py       # Unit tests
│   └── fixtures/              # Test data
├── pyproject.toml             # Package configuration
└── README.md                  # This file
```

### Development Setup

```bash
# Clone repository
git clone https://github.com/vexyart/vexy-lines-utils.git
cd vexy-lines-utils

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install with development dependencies
pip install -e ".[dev,test]"

# Run tests
uvx hatch test

# Format code
uvx hatch fmt

# Type checking
uvx hatch run lint:typing
```

### Testing Philosophy

Tests focus on the automation logic rather than UI interaction:
- Discovery logic for finding `.lines` files
- Stats tracking and error reporting
- Window watching state machines
- Dry-run mode for CI environments

### Contributing

When adding features:
1. Keep scope focused on `.lines` → PDF export automation
2. Add unit tests for new functionality
3. Update this README with new options
4. Follow existing code style (Ruff-formatted)

## Troubleshooting

### Common Issues

**"PyXA is not available"**
- Ensure you're on macOS
- Install with: `pip install mac-pyxa`
- Check Python architecture matches system

**"Failed to launch Vexy Lines"**
- Verify Vexy Lines.app is in /Applications
- Try launching manually first
- Check for trial/license expiration

**Export dialogs timing out**
- Increase timeout values in AutomationConfig
- Check if Vexy Lines has modal dialogs open
- Verify no system dialogs blocking

**"Accessibility permissions required"**
- Grant Terminal.app accessibility permissions
- If using VS Code/PyCharm, grant IDE permissions too
- Log out and back in after permission changes

**PDFs not appearing**
- Check source `.lines` files aren't corrupted
- Verify write permissions in target directory
- Look for hidden error dialogs in Vexy Lines

## About

**vexy-lines-utils** is developed by [FontLab Ltd.](https://www.fontlab.com), creators of Vexy Lines and industry-standard font editing software.

### Links

- [Vexy Lines Homepage](https://www.vexy.art)
- [Vexy Lines Documentation](https://help.vexy.art)
- [FontLab Support](https://support.vexy.art)
- [Package Issues](https://github.com/vexyart/vexy-lines-utils/issues)

### License

MIT License - see [LICENSE](LICENSE) file for details.

### Credits

Based on the original `vexy-lines2pdf.py` automation script. The package structure follows modern Python packaging standards with Fire CLI, comprehensive testing, and robust error handling.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "vexy-lines-utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "automation, batch-processing, cli, creative-tools, macos, pdf-export, vector-art, vexy-lines",
    "author": null,
    "author_email": "\"Fontlab Ltd.\" <opensource@vexy.art>",
    "download_url": "https://files.pythonhosted.org/packages/30/ba/ca1c12abd20fc7f3bd11e4bf575ef9375166745b5b8f6ac37df3196082ed/vexy_lines_utils-1.0.8.tar.gz",
    "platform": null,
    "description": "---\nthis_file: README.md\n---\n\n# Vexy Lines Utils\n\nExport Vexy Lines `.lines` documents to crisp PDFs without pointing and clicking. This package provides a command-line interface for batch automation of [Vexy Lines](https://www.vexy.art) on macOS, wrapping the exact workflow described in the original `vexy-lines2pdf.py` script with a Fire-powered CLI.\n\n## About Vexy Lines\n\nVexy Lines is a creative desktop application that transforms photos, illustrations, AI-generated images and other bitmaps into expressive vector art. It reads the color value of every pixel and intelligently builds vector artwork from it.\n\n### Core Concept\n\nFeed it a portrait, get back an engraving. Drop in a landscape, receive flowing wave patterns. The software offers twelve different ways to interpret your images, each method responding to the light and dark areas of your source image differently. Dark areas generate thick strokes, bright areas create thin ones\u2014or reverse it for dramatic effects.\n\n### The 12 Fill Algorithms\n\n- **Linear**: Classic copper-plate engravings with parallel straight lines\n- **Wave**: Flowing parallel curves that undulate across your image\n- **Radial**: Lines exploding from a center point like sun rays\n- **Circular**: Concentric rings emanating outward\n- **Spiral**: Continuous winding patterns from center to edge\n- **Halftone**: Newspaper-style dots that scale with brightness\n- **Trace**: Clean edge detection that converts boundaries to paths\n- **Wireframe**: 3D-looking dimensional lattices\n- **Scribble**: Hand-drawn energy with organic randomness\n- **Fractal**: Intricate mathematical recursive patterns\n- **Text**: Paint with letters and typography\n- **Handmade**: Draw your own custom strokes for full control\n\n### Professional Features\n\n- **Layer System**: Stack multiple fills, organize with groups, control visibility with masks\n- **Dynamic Color**: Strokes pull actual colors from source images segment by segment\n- **3D Mesh Warping**: Wrap patterns around cylinders, drape over waves, add perspective\n- **Multiple Sources**: Each group can reference different images for complex compositions\n- **Production Export**: SVG, PDF, EPS for infinite scaling; PNG, JPEG for quick sharing\n- **Overlap Control**: Fills can cut through each other creating woven effects\n\nFiles save as `.lines` projects that preserve every layer, fill, mask, mesh, and parameter\u2014allowing iterative refinement.\n\n## What This Package Provides\n\nThis automation tool helps power users and studios process large batches of Vexy Lines artwork efficiently:\n\n- **Fire CLI**: A `vexy-lines` command implemented with Google's `fire` framework for intuitive command-line usage\n- **Batch Processing**: Recursive discovery and processing of `.lines` files in folders or single-file operations\n- **macOS Automation**: PyXA-powered menu control for **File \u2192 Export\u2026** and **File \u2192 Close** operations\n- **Smart Dialog Navigation**: `pyautogui-ng` keyboard automation to navigate save dialogs and set proper filenames\n- **Voice Feedback**: Optional macOS text-to-speech announcements for accessibility\n- **Dry-Run Mode**: Preview operations without touching the UI\u2014perfect for CI tests or validating large batches\n- **Robust Error Handling**: Continues processing remaining files even if individual exports fail\n\n## System Requirements\n\n- **macOS 10.14+** (required for PyXA automation framework)\n- **Vexy Lines** desktop application installed\n- **Python 3.10+**\n- **4GB RAM** minimum (same as Vexy Lines)\n\n## Installation\n\n### From PyPI (Recommended)\n\n```bash\npip install vexy-lines-utils\n```\n\n### From Source\n\n```bash\ngit clone https://github.com/vexyart/vexy-lines-utils.git\ncd vexy-lines-utils\npip install -e .\n```\n\n### Required Permissions\n\nGrant accessibility permissions to your Terminal/IDE for UI automation:\n1. Open **System Preferences** \u2192 **Security & Privacy**\n2. Navigate to **Privacy** \u2192 **Accessibility**\n3. Add your Terminal app or IDE\n4. Restart Terminal/IDE after granting permissions\n\n## Usage Examples\n\n### Basic Export Operations\n\n```bash\n# Export a single document\nvexy-lines export ~/Art/portrait.lines\n\n# Export everything in a folder (recursive)\nvexy-lines export ~/Projects/posters\n\n# Process specific project with verbose output\nvexy-lines export ~/Clients/BigCorp/logos --verbose\n\n# Preview what would be processed without running\nvexy-lines export ~/batch --dry_run --verbose\n\n# Get voice confirmation when batch completes\nvexy-lines export ~/batch --say_summary\n```\n\n### Advanced Workflows\n\n```bash\n# Process today's work\nvexy-lines export ~/Desktop/vexy-today/ --verbose --say_summary\n\n# Validate large batch before running\nvexy-lines export ~/Archive/2024 --dry_run | grep \"processed\"\n\n# Export with detailed logging for troubleshooting\nvexy-lines export ~/problem-files/ --verbose 2>&1 | tee export.log\n```\n\n### Command-Line Arguments\n\n**Required:**\n- `target`: Path to a `.lines` file or folder containing them (searched recursively)\n\n**Optional Flags:**\n- `--verbose`: Show detailed progress including each file being processed\n- `--dry_run`: Preview files that would be processed without UI automation\n- `--say_summary`: Announce completion summary via macOS text-to-speech\n\n### Output Format\n\nThe command returns a structured dictionary with export statistics:\n\n```json\n{\n  \"processed\": 10,\n  \"success\": 9,\n  \"failed\": 1,\n  \"failures\": [\n    [\"path/to/broken.lines\", \"Failed to open file\"]\n  ],\n  \"dry_run\": false\n}\n```\n\n## How It Works\n\n1. **Discovery** \u2013 `find_lines_files` resolves the target path, supports single files, and sorts recursive directory walks for deterministic runs.\n2. **App bridge** \u2013 `PyXABridge` launches/activates Vexy Lines via macOS scripting bridges and exposes a minimal interface (`window_titles`, `click_menu_item`).\n3. **Window watching** \u2013 `WindowWatcher` polls the live window list so we wait for the expected document title, the Export dialog, and the Save dialog instead of relying on coarse `sleep()` delays.\n4. **Keyboard automation** \u2013 `UIActions` wraps `pyautogui-ng` + `pyperclip` to press Command-Shift-G, paste the folder path, select the filename, and confirm overwrites.\n5. **Verification** \u2013 the exporter waits for the Save window to close, then checks that the new PDF exists and is non-empty before moving on.\n\nIf any step fails (missing dialog, file cannot open, permissions issue, etc.), the run continues with the next `.lines` document and reports the failure reason in the final summary.\n\n## Python API\n\nFor integration into larger workflows:\n\n```python\nfrom pathlib import Path\nfrom vexy_lines_utils import VexyLinesExporter, AutomationConfig\n\n# Create custom configuration\nconfig = AutomationConfig(\n    poll_interval=0.2,        # Window check frequency (seconds)\n    wait_for_app=20.0,        # App launch timeout\n    wait_for_file=20.0,       # File open timeout\n    wait_for_dialog=25.0,     # Dialog appearance timeout\n    post_action_delay=0.4     # Pause after UI actions\n)\n\n# Initialize exporter\nexporter = VexyLinesExporter(config=config)\n\n# Process files\nstats = exporter.export(Path(\"~/Documents/vexy-projects\"))\n\n# Check results\nprint(f\"Success rate: {stats.success}/{stats.processed}\")\nfor path, reason in stats.failures:\n    print(f\"Failed: {path} - {reason}\")\n```\n\n## Development\n\n### Project Structure\n\n```\nvexy-lines-utils/\n\u251c\u2500\u2500 src/vexy_lines_utils/\n\u2502   \u251c\u2500\u2500 __init__.py           # Package exports\n\u2502   \u251c\u2500\u2500 vexy_lines_utils.py   # Main implementation\n\u2502   \u2514\u2500\u2500 py.typed               # PEP 561 type marker\n\u251c\u2500\u2500 tests/\n\u2502   \u251c\u2500\u2500 test_package.py       # Unit tests\n\u2502   \u2514\u2500\u2500 fixtures/              # Test data\n\u251c\u2500\u2500 pyproject.toml             # Package configuration\n\u2514\u2500\u2500 README.md                  # This file\n```\n\n### Development Setup\n\n```bash\n# Clone repository\ngit clone https://github.com/vexyart/vexy-lines-utils.git\ncd vexy-lines-utils\n\n# Create virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n\n# Install with development dependencies\npip install -e \".[dev,test]\"\n\n# Run tests\nuvx hatch test\n\n# Format code\nuvx hatch fmt\n\n# Type checking\nuvx hatch run lint:typing\n```\n\n### Testing Philosophy\n\nTests focus on the automation logic rather than UI interaction:\n- Discovery logic for finding `.lines` files\n- Stats tracking and error reporting\n- Window watching state machines\n- Dry-run mode for CI environments\n\n### Contributing\n\nWhen adding features:\n1. Keep scope focused on `.lines` \u2192 PDF export automation\n2. Add unit tests for new functionality\n3. Update this README with new options\n4. Follow existing code style (Ruff-formatted)\n\n## Troubleshooting\n\n### Common Issues\n\n**\"PyXA is not available\"**\n- Ensure you're on macOS\n- Install with: `pip install mac-pyxa`\n- Check Python architecture matches system\n\n**\"Failed to launch Vexy Lines\"**\n- Verify Vexy Lines.app is in /Applications\n- Try launching manually first\n- Check for trial/license expiration\n\n**Export dialogs timing out**\n- Increase timeout values in AutomationConfig\n- Check if Vexy Lines has modal dialogs open\n- Verify no system dialogs blocking\n\n**\"Accessibility permissions required\"**\n- Grant Terminal.app accessibility permissions\n- If using VS Code/PyCharm, grant IDE permissions too\n- Log out and back in after permission changes\n\n**PDFs not appearing**\n- Check source `.lines` files aren't corrupted\n- Verify write permissions in target directory\n- Look for hidden error dialogs in Vexy Lines\n\n## About\n\n**vexy-lines-utils** is developed by [FontLab Ltd.](https://www.fontlab.com), creators of Vexy Lines and industry-standard font editing software.\n\n### Links\n\n- [Vexy Lines Homepage](https://www.vexy.art)\n- [Vexy Lines Documentation](https://help.vexy.art)\n- [FontLab Support](https://support.vexy.art)\n- [Package Issues](https://github.com/vexyart/vexy-lines-utils/issues)\n\n### License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n### Credits\n\nBased on the original `vexy-lines2pdf.py` automation script. The package structure follows modern Python packaging standards with Fire CLI, comprehensive testing, and robust error handling.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Command-line automation for batch exporting Vexy Lines vector art documents to PDF on macOS",
    "version": "1.0.8",
    "project_urls": {
        "Documentation": "https://github.com/vexyart/vexy-lines-utils#readme",
        "Issues": "https://github.com/vexyart/vexy-lines-utils/issues",
        "Source": "https://github.com/vexyart/vexy-lines-utils"
    },
    "split_keywords": [
        "automation",
        " batch-processing",
        " cli",
        " creative-tools",
        " macos",
        " pdf-export",
        " vector-art",
        " vexy-lines"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cd18985805ae4631fd4aa6ac00ba210df554d7db0c9e5ba825d89147b2396021",
                "md5": "a24f505392ef1ba2916e0a4d4ea02b40",
                "sha256": "4a47a0f871c54c870e3e0b9087db55cbceff1cb0b48e412701deaaca6c865ff7"
            },
            "downloads": -1,
            "filename": "vexy_lines_utils-1.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a24f505392ef1ba2916e0a4d4ea02b40",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 34790,
            "upload_time": "2025-11-07T15:34:29",
            "upload_time_iso_8601": "2025-11-07T15:34:29.760252Z",
            "url": "https://files.pythonhosted.org/packages/cd/18/985805ae4631fd4aa6ac00ba210df554d7db0c9e5ba825d89147b2396021/vexy_lines_utils-1.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "30baca1c12abd20fc7f3bd11e4bf575ef9375166745b5b8f6ac37df3196082ed",
                "md5": "6ea48ef714b7b91ab5f1ea6b3aecd05e",
                "sha256": "05c04913949904c2f622ebbb32db24d378c67d920728e80e688a4cfa839958ef"
            },
            "downloads": -1,
            "filename": "vexy_lines_utils-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "6ea48ef714b7b91ab5f1ea6b3aecd05e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 13288,
            "upload_time": "2025-11-07T15:34:31",
            "upload_time_iso_8601": "2025-11-07T15:34:31.090255Z",
            "url": "https://files.pythonhosted.org/packages/30/ba/ca1c12abd20fc7f3bd11e4bf575ef9375166745b5b8f6ac37df3196082ed/vexy_lines_utils-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-07 15:34:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "vexyart",
    "github_project": "vexy-lines-utils#readme",
    "github_not_found": true,
    "lcname": "vexy-lines-utils"
}
        
Elapsed time: 4.65267s