Skip to main content

No project description provided

Project description

UniversityHeader

phalanx

PyPI version Python versions License

A specialized tool for downloading scrolls and fragments from the Vesuvius Challenge dataset. Phalanx allows users to efficiently retrieve specific slices from volumes and fragments with parallel downloading capability.

The name "phalanx" draws inspiration from the mythical phoenix, symbolizing rebirth and revival. Just as the phoenix rises from its ashes, phalanx helps resurrect and breathe new life into ancient scrolls buried under the ashes of Mount Vesuvius.

Key Features

  • Selective Downloads: Download specific slice ranges instead of entire volumes
  • Multi-Fragment Support: Download multiple fragments with a single command
  • Parallel/Sequential Mode: Choose between parallel or sequential download modes
  • Rich Terminal Interface: Color-coded progress bars and status messages
  • Multithreaded Downloading: Parallel download operations for improved performance
  • Progress Tracking: Visual progress bars showing completion status and data transfer
  • Operation Summaries: Detailed download summaries showing success rates and statistics
  • Smart Defaults: Automatically selects appropriate volume/fragment IDs when possible
  • Error Handling: Robust retry mechanism and helpful error messages
  • Clean CLI: Intuitive command-line interface with comprehensive help documentation

Installation

pip install vesuvius-phalanx

Dependencies

Package Purpose
requests HTTP requests and content downloading
beautifulsoup4 HTML parsing and web page data extraction
rich Terminal formatting and progress visualization
click User-friendly command-line interface

Command-line Usage

Download Volume Slices

phalanx download-volume SCROLL_ID --output-path OUTPUT_PATH [OPTIONS]

Parameters:

  • SCROLL_ID: Numeric ID (e.g., 5) - will be prepended with "Scroll" automatically
  • --output-path: Path to store downloaded data (full_scrolls directory)
  • --volpkg-name: (Optional) Specific volpkg name if multiple are available
  • --volume-id: (Optional) Specific volume identifier
  • --slices: (Optional) Slice ranges to download (default: all)
    • Format: "start-end" or "start-end,another-range"
    • Example: "1-5,10,15-20"
  • --verbosity: (Optional) Control output detail level (quiet, normal, verbose)

Download Fragment Slices

phalanx download-fragment SCROLL_ID FRAG_IDS [OPTIONS]

Parameters:

  • SCROLL_ID: Numeric ID (e.g., 5) - will be prepended with "Scroll" automatically
  • FRAG_IDS: Fragment identifier(s) - can be a single ID or comma-separated list
    • Example single: 20241024131838
    • Example multiple: 20241024131838,20241024131839,20241024131840
  • --output-dir: (Optional) Output data root directory (default: data)
  • --volpkg-name: (Optional) Specific volpkg name if multiple are available
  • --slices: (Optional) Slice ranges to download (default: all)
  • --mask/--no-mask: (Optional) Whether to download the mask (default: true)
  • --parallel/--sequential: (Optional) Download mode for multiple fragments (default: parallel)
  • --verbosity: (Optional) Control output detail level (quiet, normal, verbose)

Examples

Basic Usage

Download all volume slices for Scroll 1 with auto-detected defaults:

phalanx download-volume 1 --output-path ./data

Download specific slices from Scroll 1:

phalanx download-volume 1 --output-path ./data --slices 1-5

Advanced Usage

Download with explicit volume identifier:

phalanx download-volume 1 --output-path ./data --volume-id 20230205180739 --slices 1-5

Download a single fragment with its mask:

phalanx download-fragment 1 20230503225234 --output-dir ./vesuvius_data --slices all

Download multiple fragments in parallel:

phalanx download-fragment 5 20241108120732,20241108111522,20241113090990 --slices 17-20 --parallel

Download multiple fragments sequentially:

phalanx download-fragment 5 20241108120732,20241108111522 --slices 17-20 --sequential --no-mask

Download with minimal console output:

phalanx download-fragment 5 20241108120732 --verbosity quiet

How It Works

Phalanx operates by:

  1. Discovery: Identifying available volpkgs and volumes for the requested scroll
  2. Selection: Choosing appropriate defaults or using user-specified identifiers
  3. Metadata Retrieval: Fetching slice information and other metadata
  4. Parallel Downloads: Creating multiple worker threads for faster downloading
  5. Error Handling: Implementing retries and cleanup for failed or interrupted downloads
  6. Operation Summary: Providing detailed statistics about the download operation

Technical Details

  • Intelligent Defaults: The tool maintains a defaults.json file with preferred volpkg and volume IDs for common scrolls
  • Session Management: Creates optimized HTTP sessions with retry capabilities
  • Resource Management: Cleans up partial downloads on startup and handles interruptions
  • Progress Reporting: Shows real-time download progress with data transfer rates
  • Rich Terminal Interface: Uses the Rich library for enhanced console output
  • Parallel Processing: Manages concurrent downloads while maintaining readable output

Command Aliases

For convenience, you can also use the shorter phnx command instead of phalanx:

phnx download-volume 1 --output-path ./data

Contributing

Contributions are welcome! Please submit a pull request or open an issue on GitHub.

Before contributing:

  • Fork the repository
  • Create a feature branch
  • Add your changes
  • Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vesuvius_phalanx-0.1.13.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vesuvius_phalanx-0.1.13-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

Details for the file vesuvius_phalanx-0.1.13.tar.gz.

File metadata

  • Download URL: vesuvius_phalanx-0.1.13.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.5

File hashes

Hashes for vesuvius_phalanx-0.1.13.tar.gz
Algorithm Hash digest
SHA256 104f6551bf2a26266b780489385cbf7de4f263c44607564c3185a700253a1940
MD5 39fae49cc551a0ba948b63a9cadeba19
BLAKE2b-256 d57a070b67c0cf9333e2340b5a5e52f10bc9b8cec688797999d22c384d80872b

See more details on using hashes here.

File details

Details for the file vesuvius_phalanx-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for vesuvius_phalanx-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 a0541aa5eaf9c19d016c24938817fb086c24a25d3a657b90c67f47d3cf9e4bb3
MD5 7287ad7b0f1041715633fcb05219e6e7
BLAKE2b-256 e5e1a198305c5225a5f126186486308174306f68b965cdb4fcfe4b542eca37ac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page