Skip to main content

dnd_firefly

Programmatically load file either drag-and-drop or via URL into Firefly Viewer

Overview

dnd_firefly is a command-line tool that allows you to programmatically upload local files to the Firefly Viewer (IRSA Viewer tool) by simulating a drag-and-drop action or loading from a URL.

This tool is particularly useful for automating data uploads and integrating with scripts or workflows that interact with the Firefly Viewer. This tools complements the existing URL API by enabling support for the Upload feature in scenarios where direct access is not yet available.

Firefly

Firefly is an open-source web-based UI library for astronomical data archive access and visualization developed at Caltech. The development was started in the context of archive-specific applications at the NASA/IPAC Infrared Science Archive (IRSA), and was then generalized to serve data from many different archives at IRSA (and beyond). It was open sourced in 2015, hosted at GitHub.

See details in the GitHub repository and how to install locally.

Compatibility

dnd_firefly tool makes use of IRSA Viewer and is compatible since release 2023.3 (Drag-n-drop introduced - FIREFLY-1310.

Features

  • Automate File Uploads: Upload files to the Firefly Viewer without manual intervention.
  • Simulate Drag-and-Drop: Programmatically simulate the drag-and-drop action to upload local files or from URL.
  • Easy Integration: Integrate seamlessly with existing data processing pipelines or scripts.

Installation

You can install dnd_firefly directly from PyPI using pip:

pip install dnd_firefly

PyPi: https://pypi.org/project/dnd-firefly/

Note: dnd_firefly requires Python 3.11 or higher.

Requirements

  • Python 3.11+
  • Google Chrome Browser: Ensure that the latest version of Chrome is installed on your system.

How It Works

The tool uses Selenium WebDriver to automate a Chrome browser session. It opens the Firefly Viewer and simulates the drag-and-drop action to upload your specified file or load from URL.

Selenium Manager: Starting from Selenium 4.6.0, Selenium includes Selenium Manager, which automatically manages the browser driver required for automation. If you have Chrome installed, Selenium will handle the rest.

Usage

The dnd_firefly tool accepts one argument: the path to the local file or URL you want to upload to the Firefly Viewer.

Command-Line Usage

For local files:

dnd_firefly /path/to/your/file.tbl

Replace /path/to/your/file.tbl with the actual path to your local file.

For URL:

dnd_firefly <http|https>://.../file.tbl

Replace <http|https>://.../file.tbl with the URL.

Example

To upload a file named WISE-allwise_p3as_psd-Cone_100asec.tbl located in your Downloads folder, run:

dnd_firefly ~/Downloads/WISE-allwise_p3as_psd-Cone_100asec.tbl

Example of VOTable with 2 tables via URL:

dnd_firefly https://raw.githubusercontent.com/ejoliet/playground/refs/heads/master/data/table_IRS_Enh-Spectra-1.vot

Troubleshooting

  • Selenium Exceptions: If you encounter errors related to Selenium WebDriver, ensure that you have the latest version of Chrome installed and that your Selenium version is up to date.
  • Internet Access: Selenium Manager requires internet access to download the appropriate WebDriver. If you're in an environment with restricted internet access, you may need to manually set up the WebDriver. Refer to the Selenium documentation for more details.
  • File Path / URL Issues: Ensure that the file path or URL you provide is correct and that the file exists.

Advanced Usage (Optional)

If you need to use a different browser or have specific requirements, you can manually set up the WebDriver.

Manual WebDriver Setup

  1. Download ChromeDriver:

    • Visit the ChromeDriver Downloads page.
    • Download the version that matches your installed Chrome browser version.
  2. Install ChromeDriver:

    • Place the chromedriver executable in a directory that's in your system's PATH, or specify its location in the code.

Note: Manual setup is only necessary if Selenium Manager is unable to manage the WebDriver automatically.

Contributing

Contributions are welcome! Please visit the GitHub repository to report issues or submit pull requests.

Metadata

Release files for dnd-firefly 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dnd-firefly 0.4.1
File Size Uploaded
dnd_firefly-0.4.1.tar.gz 7.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dnd-firefly 0.4.1
File Interpreter ABI Platform
dnd_firefly-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.4 kB

Release files / dnd_firefly-0.4.1.tar.gz

Download URL dnd_firefly-0.4.1.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
47466d07514883f5d8669749954fc795e92e50605208e8ecbcbf25f7b18901a7
BLAKE2b-256 checksum
How to use checksums
9acc66ff361c20dfde68f3af8cd0a6544fca1330b9ec348532f3c436ec93ead0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release files / dnd_firefly-0.4.1-py3-none-any.whl

Download URL dnd_firefly-0.4.1-py3-none-any.whl
Size 7.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e7d4b0c220b95c165601b490a3d7778ee2cda33d5cc24b2b1330fc42ca2c969e
BLAKE2b-256 checksum
How to use checksums
562df2a439f67e470c18233eccad42e2478b2bf8c303eb8130d5556fadaf6843
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page