Skip to content

Repository files navigation

PyPI PyPI - Downloads Downloads Python PyPI - License

Code style: ruff "Buy Me A Coffee"


MapTasker

Display/Edit the Tasker Project(s), Profile(s), Task(s), and Scene(s) in your browser based on Tasker's backup or exported XML file

Configuration Map...

Diagram Map...

[More Samples]

This is an application in support of Tasker that is intended to run on in a web browser (see Note 1).

I found that my Tasker Projects/Profiles/Tasks/Scenes were becoming unmanageable, and my phone was too small to navigate over my Projects, Profiles, Tasks and Scenes. So I wrote a Python program to provide a complete map of my entire configuration in my web browser based on my Tasker backup XML file that I saved to my local desktop drive.

Over time, I refined the map by providing many additional options, including the ability to edit Tasker objects.

The Tasker backup or other Tasker exported XML can either be manually uploaded to your PC/Mac/Linux/cloud drive, or this program can retrieve it directly from your Android device (see Note 2).

Features

  • Your choice of output detail level, from a summary overview to a very detailed level of your configuration.
  • Display just a single Project, Profile, or Task.
  • Include/exclude Profile and Task conditions: States, Events, etc.
  • Just stream everything and/or make the output "pretty" by aligning all of the fields.
  • Change the appearance: select 'light', or 'dark' or use the 'system' default.
  • Output using your favorite monospaced font, and accent Project, Profile and Task names by making them italicized, bold, highlighted and/or underscored.
  • Modify the colors associated with various aspects of the output to suit your mood.
  • Include TaskerNet descriptions and/or Tasker preferences.
  • For complex configurations, optionally include a dictionary of hotlinks to your Projects, Profiles, Tasks and Scenes.
  • Display a diagram of your entire Tasker configuration.
  • Command line or GUI interface.
  • Use exported XML or fetch the XML directly from your Android device for the configuration mapping.
  • Save and restore runtime settings.
  • Identify Tasks that have too many 'actions', and which should potentially be broken up into multiple Tasks.
  • Ai Analysis option to analyze a specific Project, Profile, Task or Scene using either the server-based ChatGPT/Claude/DeepSeek/Gemini or the local-based Llama (via Ollama) supported models.
  • Display results directly within the GUI: (Configuration) Map View, Tree View, and Diagram View.
  • Automatic update detection and optional installation of new versions.
  • Enhanced search capabilities.
  • Add and Edit Projects, Profiles, and Tasks (see Note 6)

Program Dependencies

- Python version 3.11 or higher

- Tasker full or partial XML file: backup.xml or other Tasker exported XML file

   You will be prompted to locate and identify your Tasker exported XML file (e.g. backup.xml) on your desktop, created by Tasker version 5 or version 6. Optionally, you can retrieve it directly from your Android device (see Note 2).

- Ai Analysis

   This requires a valid API key if using the server-based analysis and/or Ollama to be installed for local analysis (See Note 5).

Project Structure

A brief overview of the main files and their purpose:

  • maptasker/: Contains the core application code.
    • maptasker/src/: The main Python source files for MapTasker's logic.
    • maptasker/assets/: Static assets like icons, images, and JSON data used by the application.
    • maptasker/custom_overrides/: Contains custom modifications to third-party libraries.
    • maptasker/locale: language files for translations.
  • documentation_images/: Images used within this README and other documentation.
  • tests/: Contains test scripts and related files for ensuring code quality.
  • main.py: The main entry point script for running MapTasker from a cloned repository.
  • LICENSE: The MIT License file for the project.
  • README.md: This file.
  • Changelog.md: A log of changes made in each version.
  • pyproject.toml: Project metadata and build system configuration.

Installation

This program and all of it's perquisites will take about 230MBs of space. It is recommended that you install it into a virtual environment (option 2).

  • Install MapTasker by entering one of the following commands into the Terminal/Command Prompt:

    python -m pip install maptasker -U ...OR... uv add maptasker

  • To install it into a virtual environment, enter the following command into Terminal/command prompt:

    via pip...

    • cd xxx, where 'xxx' is a directory into which you want to set up the virtual environment.
    • python -m venv venv
    • Activate the virtual environment... MAC/linux: source {directory path to 'xxx'}/venv/bin/activate Windows: .venv\Scripts\activate
    • pip install maptasker

    ...or...

    via uv...

    • cd xxx, where 'xxx' is a directory into which you want to set up the virtual environment.
    • uv venv
    • Activate the virtual environment... MAC/linux: source {directory path to 'xxx'}/venv/bin/activate Windows: .venv\Scripts\activate
    • uv pip install maptasker

Usage

  • Enter the command:

    maptasker ...or if using uv to manage the virtual environment... uv run maptasker

Program Output

  • “MapTasker.html”

    This file will be written to your runtime/current folder, which will be opened in your default browser as a new tab. It will contain the mapping of your Tasker configuration.

  • “MapTasker_Map.txt”

    This file will be written to your runtime/current folder as a result of running with the runtime option '-outline'. It will contain a textual diagram of the configuration. It will be displayed in your default text editor. Ensure that 'text-wrap' is off and a monospace font is used when viewing this map in the text editor.

  • "MapTasker_Settings.toml"

    This file contains your saved program settings. You can modify this file but care should be taken not to change the field formats (e.g. do not change an integer to a text string). Incorrect values will be ignored.

  • "MapTasker_Analysis.txt"

    This file will be created if you run the Ai analysis from the GUI, which holds the response from the analysis. It will be displayed in a separate window along with the GUI.

  • "maptasker.log"

    This is a trace log file used for program debugging and will only be created if '-debug' is specified in the runtime options.

  • hidden files: system settings, run counter, last 'version checked' date, and API keys.

License

This project is licensed under the MIT License.

The MIT License is a permissive free software license originating at the Massachusetts Institute of Technology (MIT). As a permissive license, it puts only very limited restriction on reuse and has, therefore, high license compatibility.

In brief, this means you are free to:

  • Use: Use the software for any purpose (commercial or private).
  • Modify: Modify the software.
  • Distribute: Distribute the original or modified software.
  • Sublicense: Sublicense the software.

You must:

  • Include Copyright: Include the original copyright notice and the license itself in any substantial portions of the software.

The software is provided "AS IS", without warranty of any kind. For the full license text, please see the LICENSE file.

Troubleshooting and FAQ

Q: The MapTasker_Map.txt diagram looks misaligned in Notepad on Windows.

A: Notepad may not handle spacing correctly for this file.

It's recommended to use a different text editor like Notepad++, VS Code, or Typepad (and set it as your default for .txt files). Ensure 'text-wrap' is off and a monospace font is used.

Q: How do I retrieve the Tasker XML file directly from my Android device?

A: Prerequisites:

1- Browser and Android device on the same local network.

2- The 'Http Server Example' Tasker Project installed and active on the Android device, server running.

3- The MapTasker List TaskerNet profile imported into Tasker for the 'List XML Files' button in the GUI.

Further details are available in the "Notes" section of this README.

Q: Diagram connectors are misaligned for names in Chinese, Korean, or Japanese.

A: This is a known issue related to font metrics for these languages in the diagramming library.

**Q: Why are some Task actions and Profile states/events not available for edit/addition?

A: In some cases, these actions, events, or states require information that is only available on Android and/or within Tasker, itself. Allowing an edit for these would result in an incomplete Task or Profile, causing a Tasker failure.

Notes

Details for some of the points mentioned in the "Troubleshooting and FAQ" section are preserved here for additional context.

1

Windows 11 Specifics:

  • Only WIndows 11 is supported. Any earlier versions of Windows are not supported.
  • For MapTasker_Map.txt display issues in Notepad, use an alternative text editor like Typepad and set it as default for .txt files.

2

Direct XML Retrieval from Android:

To retrieve the Tasker XML file directly:

  • Ensure both desktop and Android devices are on the same local network.
  • The 'Http Server Example' Tasker Project must be installed and active on the Android device, with the server running. Remember to run the "launch" Task and enter your Google Drive ID.
  • The MapTasker List TaskerNet profile must be imported into Tasker for the 'List XML Files' button in the GUI. You can preview this app on TaskerNet.
  • Once retrieved, the XML is saved on your desktop and doesn't need constant re-fetching unless changed.

4

TBD:

5

AI Support

Ai analysis is available through the GUI only. You can run an analysis using a single Project, Profile, Task, or Scene only. Support is available for server-based OpenAi (ChatGPT), Gemini, and Anthropic, as well as local-based Llama models.

Llama based models are supported via Ollama, which you must manually download, install and run it once to set up the server on your desktop. MapTasker will dynamically load the Llama models for you if not already loaded.

The supporting AI modules are not installed by default when MapTasker is installed. Instead, they are dynamically installed upon first-use of the specific AI request. In this way, if you do not plan to use AI, then you do not incur the overhead.

6

MapTasker Editing Caveats

  • Not all edits are available

    Certain Task actions and Profile states and event may have arguments that can only be determined under Android and/or within Tasker. In this case, they are not (yet) available to be added/edited.

  • Extra Arguments in Tasks

    In some cases, you will be prompted for action arguments that do not appear when adding the same under Tasker. From what I can tell, this is due to the fact that Tasker's argument definition specifications support older versions of Tasker, in which such arguments are still supported. For example, the 'Flash' action prompts for a 'Title' under MapTasker, but the current beta 6.5.6 of Tasker does not. In this case, Tasker should just ignore this argument when it is found in the action.

  • Save Tasks to Android (Tasker import) --> Requires Tasker 6.2 or higher.

    This function actually loads the item into the pre-existing Tasker session on your Android device. Since there is no 'Refresh View' in Tasker, it may be necessary to exit and restart Tasker to actually see the added Task. If Tasker is not running, you will be notified with an error message in the GUI. The current implementation saves the Task under the 'Base' (Home) Project.

  • Single Object Edit

    All edits work off a single Project, Profile, or Task, which must be preselected before the edit can occur. Adding a Task requires a single Project to be selected. Likewise for adding Profiles.

  • Profile State and Event conditions

    Adding a State or Event condition is a 2-to-3 step process. First you must add the State or Condition, and then once added, select it to add/modify it's arguments.

  • Save to Current File

    This command makes a copy of your current file and updates the copy. It then reads back the modified copy which becomes your new 'current file'. The original is never changed.

  • Edit Options

    'Cancel' just cancels Task action edits and Profile state/event edits.
    'Ok': make the change in memory only. 'Rename' and 'Delete' are self explanatory. 'Save to Android': saves Tasks to the current Tasker session. Saves Profiles and Projects to /Tasker/profiles and /Tasker/projects, respectively.
    'Save to Current File': see 6, above.
    'Export': Save as the single Project, Profile or Task to the current directory with the given name.

  • Validation and Defaults

    MapTasker does not do any extensive validation of arguments. Additionally, default settings for arguments are not all populated.

  • Remember, this is NOT Tasker. So the look and feel will be somewhat different. It may feel a little clunky at first. Suggestions are welcome.

To-Do List (in no particular order)

  • Auto Update Feature

  • Fix output column alignment

  • Support Windows 11

  • Add a runtime option for more pretty output

  • Add AI support to analyze Profiles and Tasks

  • Save and restore the AI analysis window location

  • Add color to the Map View in the GUI

  • Add name attributes (highlight, bold, italicize, underline) to the Map View in the GUI

  • Display progress bar for diagram view

  • Add 'Search' and 'Word Wrap' to the Map view.

  • Add 'Search' to the Diagram view.

  • Identify Tasks with too many actions.

  • Support additional AI's

  • Fix minor formatting issues.

  • If Profile has no name, display the same name as that of Tasker

  • Properly handle Task anchors with embedded HTML

  • Multilingual Support

  • Edit Support

  • Support additional plugins

  • Map remaining Tasker preferences

Privacy Statement

No information whatsoever is captured and sent via the network to myself or any other third party, other than that listed below (Network Traffic).

When reporting an error, you will most likely be asked to provide the output log file from the error and your XML file, both of which will be solely used to debug the program and then immediately deleted.

Network traffic is as follows:

  • Local LAN traffic when fetching XML directly from your Android device.
  • On startup, check against pypi.com to determine if a new release is available.
  • Update the program from pypi.com (via 'pip) if 'Upgrade' is selected in the GUI.
  • Read file 'maptasker_changelog.json' from 'https://github.com/mctinker/Map-Tasker' if "What's New" is selected in the GUI.
  • Use chatgpt.com when using AI analysis with any of the OpenAi models. The output of MapTasker is sent to the server via the standard API call for analysis. Likewise for Claude (Anthropic), Google (Gemini) and DeepSeek.
  • New and updated local Ai models will be loaded from 'https://ollama.com/library' when running the AI Analysis feature.
  • Image and video sources as defined via the '' HTML tag in Task action labels and TaskerNet descriptions will be accessed. Examples: imggur.com, Youtube, Dropbox, Google Drice, etc.

Contributing

Contributions are welcome! Here are some ways you can contribute to MapTasker:

Reporting Bugs:

  • If you find a bug, please open an issue on the GitHub Issues page.
  • Include as much detail as possible:
    • Steps to reproduce the bug.
    • Expected behavior and actual behavior.
    • Your operating system and Python version.
    • MapTasker version.
    • Relevant parts of your Tasker XML file (if applicable, and ensure no sensitive information is included).
    • The maptasker.log file if generated with the -debug option.

Suggesting Enhancements:

  • Open an issue on GitHub, outlining your suggestion.
  • Explain the use case and why this enhancement would be beneficial.

Pull Requests:

  • If you'd like to contribute code:
    1. Fork the repository.
    2. Create a new branch for your feature or bug fix (e.g., feature/new-output-format or fix/xml-parsing-error).
    3. Make your changes.
    4. Ensure your code adheres to the Black code style (as indicated by the badge).
    5. Add tests for your changes in the tests/ directory if applicable.
    6. Ensure all tests pass.
    7. Submit a pull request to the Master branch.

Coding Style:

  • This project uses Ruff for code formatting. Please ensure your contributions are formatted with Ruff.

We appreciate your help in making MapTasker better!

Known Issues

  • Diagram connectors are misaligned if names are in Chinese, Korean or Japanese.
  • Not all Task actions and Profile state/event editing are supported, since some require information which is only available on an Android device.

Contributions

Taskometer

©Connor Talbot 2021 for Clippy

Ollama, OpenAi, Claude AI, Gemini AI, DeepSeek AI

Anonyo Noor for cria

NiceGui

"Buy Me A Coffee"

About

Display the Tasker Configuration: Project/Profile/Task/Scene hierarchy based on Tasker's backup XML

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages