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
  • Multithreaded Downloading: Parallel download operations for improved performance
  • Progress Tracking: Visual progress bars showing completion status and data transfer
  • 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
tqdm Progress bar 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"

Download Fragment Slices

phalanx download-fragment SCROLL_ID FRAG_ID [OPTIONS]
  • SCROLL_ID: Numeric scroll ID (e.g., 5). This value will be prepended with "Scroll" (e.g., Scroll5).
  • FRAG_ID: Fragment identifier (e.g., 20241024131838).
  • --output-dir: Output data root directory (default: data).
  • --volpkg-name: Name of the volpkg (optional).
  • --slices: Slice ranges to download (default is all).
  • --mask: Download mask (default is true).

Parameters:

  • SCROLL_ID: Numeric ID (e.g., 5) - will be prepended with "Scroll" automatically
  • FRAG_ID: Fragment identifier (e.g., 20241024131838)
  • --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: (Optional) Whether to download the mask (default: true)

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 fragment with its mask:

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

Download a fragment without its mask:

phalanx download-fragment 1 20230503225234 --mask false

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

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

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.12.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.12-py3-none-any.whl (1.0 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vesuvius_phalanx-0.1.12.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.12.tar.gz
Algorithm Hash digest
SHA256 512d795a4cbcacf66c51cdb9e58a18b2126e7fd489f1d46d5368a11a07e89d68
MD5 e8862de865ac664c0b00ae0f84bcc129
BLAKE2b-256 73a63a8420237ef126e27e3f2b0edf54be3e32fa2087fbc3042d2d448fc5bc76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for vesuvius_phalanx-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 9a55eeda641c8f641b5f2fd191a64efff46b2a30f94042705084e9876f40c57a
MD5 0f2f3712fe0b4a7b9db3578f670df806
BLAKE2b-256 933ded8e4efaa997a54dd8b340ca6bcde13b45b486bb809b4a22b312bc96f524

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