DogmaDragon 43feb5909d Add URLs to plugins for better access and support
- Updated FileMonitor plugin URL to Discourse link
- Updated LocalVisage plugin URL to Discourse link
- Updated PlexSync plugin URL to Discourse link
- Updated PythonDepManager plugin URL to Discourse link
- Updated PythonToolsInstaller plugin URL to Discourse link
- Updated RenameFile plugin URL to Discourse link
- Updated SFW Switch plugin URL to Discourse link
- Updated SecondaryPerformerImage plugin URL to Discourse link
- Updated StashRandomButton plugin URL to Discourse link
- Updated TPDBMarkers plugin URL to Discourse link
- Updated ThumbPreviews plugin URL to Discourse link
- Updated VideoBanner plugin URL to Discourse link
- Updated VideoScrollWheel plugin URL to Discourse link
- Updated additionalFilesDeleter plugin URL to Discourse link
- Updated audio-transcodes plugin URL to Discourse link
- Updated bulkImageScrape plugin URL to Discourse link
- Updated chooseYourAdventurePlayer plugin URL to Discourse link
- Updated cjCardTweaks plugin URL to Discourse link
- Updated comicInfoExtractor plugin URL to Discourse link
- Updated defaultDataForPath plugin URL to Discourse link
- Updated dupeMarker plugin URL to Discourse link
- Updated e621_tagger plugin URL to Discourse link
- Updated externalLinksEnhanced plugin URL to Discourse link
- Updated filenameParser plugin URL to Discourse link
- Updated funscriptMarkers plugin URL to Discourse link
- Updated hotCards plugin URL to Discourse link
- Updated imageGalleryNavigation plugin URL to Discourse link
- Updated image_date_from_metadata plugin URL to Discourse link
- Updated markerDeleteButton plugin URL to Discourse link
- Updated markerTagToScene plugin URL to Discourse link
- Updated miscTags plugin URL to Discourse link
- Updated nfoSceneParser plugin URL to Discourse link
- Updated pathParser plugin URL to Discourse link
- Updated performerStashboxUrlToID plugin URL to Discourse link
- Updated sceneCoverCropper plugin URL to Discourse link
- Updated scenePageRememberStates plugin URL to Discourse link
- Updated setPerformersFromTags plugin URL to Discourse link
- Updated setSceneCoverFromFile plugin URL to Discourse link
- Updated starIdentifier plugin URL to Discourse link
- Updated stashAI plugin URL to Discourse link
- Updated stashAppAndroidTvCompanion plugin URL to Discourse link
- Updated stashNotes plugin URL to Discourse link
- Updated stashNotifications plugin URL to Discourse link
- Updated stashdb-performer-gallery plugin URL to Discourse link
- Updated stats plugin URL to Discourse link
- Updated tagCopyPaste plugin URL to Discourse link
- Updated tagGalleriesFromImages plugin URL to Discourse link
- Updated tagImagesWithPerfTags plugin URL to Discourse link
- Updated tagScenesWithPerfTags plugin URL to Discourse link
- Updated themeSwitch plugin URL to Discourse link
- Updated timestampTrade plugin URL to Discourse link
- Updated titleFromFilename plugin URL to Discourse link
- Updated untagRedundantTags plugin URL to Discourse link
- Updated videoChapterMarkers plugin URL to Discourse link
- Updated BlackHole theme URL to Discourse link
- Updated ColorPalette theme URL to Discourse link
- Updated Minimal theme URL to Discourse link
- Updated ModernDark theme URL to Discourse link
- Updated NeonDark theme URL to Discourse link
- Updated Night theme URL to Discourse link
- Updated Plex theme URL to Discourse link
- Updated PornHub theme URL to Discourse link
- Updated Pulsar theme URL to Discourse link
- Updated PulsarLight theme URL to Discourse link
- Updated RoundedYellow theme URL to Discourse link
- Updated FansDB Submission Helper userscript URL to Discourse link
- Updated StashDB Submission Helper userscript URL to Discourse link
2025-12-20 03:59:59 +02:00
..
2025-05-28 14:21:09 +03:00
2025-05-28 14:21:09 +03:00
2025-05-28 14:21:09 +03:00
2025-05-28 14:21:09 +03:00

PythonDepManager

https://discourse.stashapp.cc/t/pythondepmanager/1801

Python dependency management system for CommunityScripts plugins.

This plugin provides an easy way to install and manage Python package dependencies in your plugins without manual user interaction.

Don't worry about missing dependencies and wrong or conflicting versions anymore.

Features

  • 🚀 Automatic dependency installation and management

    • Users won't have to manually install dependencies
  • 🔒 Isolated dependency versions

    • Specify exact version of your dependencies without worrying about conflicts with other plugin installs
  • 📦 Support for multiple package sources:

    • PyPI packages with version constraints
    • Git repositories (with branch/tag/commit support)
    • Custom import names for metapackages
  • 🔄 Automatic version resolution and compatibility checking

  • 🧹 Easy dependency cleanup and flushing

Installation

  1. Add PythonDepManager as a requirement in your plugin's YAML file:
name: YourPlugin
# requires: PythonDepManager
description: Your plugin description

Usage

Basic Usage

In your plugin's Python code, import and use the dependency manager:

from PythonDepManager import ensure_import
# Install and import a package with specific version
ensure_import("requests==2.26.0")

# Afterwards imports will use only the requested versions
import requests

Advanced Usage

Minimum Versions

Define a minimum version to use. This will either use any cached version which matches or install the latest

from PythonDepManager import ensure_import
ensure_import("requests>=2.26.0")

Custom Import Names/Meta Packages

Use custom import names for packages with different import names or meta packages

from PythonDepManager import ensure_import
# Install beautifulsoup4 but import as bs4
ensure_import("bs4:beautifulsoup4==4.9.3")
from PythonDepManager import ensure_import
# Install stashapp-tools but import as stashapi
ensure_import("stashapi:stashapp-tools==0.2.58")

Git Repository Dependencies

Install packages directly from Git repositories:

from PythonDepManager import ensure_import
# Install from a Git repository
ensure_import("stashapi@git+https://github.com/user/repo.git")

# Install specific branch/tag
ensure_import("stashapi@git+https://github.com/user/repo.git@main")

# Install specific commit
ensure_import("stashapi@git+https://github.com/user/repo.git@ad483dc")

Multiple Imports

Handle multiple different requirements for imports:

from PythonDepManager import ensure_import
ensure_import(
  "requests",
  "bs4:beautifulsoup4==4.9.3",
  "stashapi:stashapp-tools==0.2.58",
  "someothermodule>=0.1",
)

Managing Dependencies

To flush all cached dependencies:

from PythonDepManager import flush_dependencies
flush_dependencies()

Requirements

  • Git (for Git repository dependencies)
  • pip (Python package installer)