File Explorer Plugins

File Explorer plugins allow you to import an entire folder of assets at once into the project of your choice, from a private bucket.

Creating a File Explorer Plugin

First, add an integration from Hub to the private bucket you'd like to navigate with the File Explorer. You may find instructions on doing so here.

Following the steps outlined in this section, create a new plugin from the UI, choosing "File Explorer" as the plugin type.

Then, create and run a Python script using the FileExplorerPlugin class you can find in our imerit-ango Python package under imerit_ango.plugins.

You will need to add the imerit-ango package to your Python environment by running

pip install imerit-ango

Here is the class's documentation, and an example:

FileExplorerPlugin

Parameters:

  • id: string

    • The plugin's ID. You may obtain this ID from the plugin's information box in the Development section of the Plugin page.

  • secret: string

    • The plugin's secret. You can think of this as a private key you'll need to be able to connect your script to the plugin. You may obtain this secret from the plugin's information box in the Development section of the Plugin page.

  • callback: Callable[[str, dict], Tuple[str, BytesIO]]

    • The callback function. This function will be run whenever a user runs this plugin.

Callback Function

Parameters:

  • **data: dict

    • folder: str

    • projectId: str

    • integrationId: str

    • bucket: str

      • The ID of the project for which the plugin was run.

    • apiKey: str

    • orgId: str

    • runBy: str

      • The user ID of the user running the plugin.

    • session: str

    • logger: PluginLogger

    • batches: List[str]

    • files

    • upload

    • project

    • scroll_token

    • configJSON: str

      • The config JSON your users will pass to you through the Config JSON text field when running the plugin. Warning: the JSON will be passed as a string so you will have to destringify it. Example code to obtain the original JSON as a Python object:

    def sample_callback(**data):
        config_str = data.get('configJSON')
        config = json.loads(config_str)

Sample Python Script

This script allows your users to navigate the file structure of a private bucket from AWS S3, from Ango Hub's UI, and to them import an entire folder of valid assets into the project of their choice.

Running the File Explorer

If you have added this plugin from the Directory, from the dashboard of the project where you'd like to run the script, enter the Settings tab and then the Plugin section. Then click on Open on the File Explorer plugin you need. A dialog will pop up.

If you have created this plugin yourself, from the Development section of the Plugins page, click on Open on the File Explorer plugin you need. A dialog will pop up.

Project: The project in which you wish to import the assets.

Bucket Name: The name of the bucket you have integrated with Hub, which contains the assets to be imported. Ensure this is typed correctly.

Integration: The integration you set up in the previous step.

Folder: Once all other fields are filled, this button will activate. By clicking it, a dialog will pop up. From the dialog, you will be able to select a folder from your bucket, and by clicking on "Import" you will instantly add all valid assets in that folder to the selected project on Hub.

Last updated