Skip to main content

Type hinting library for Plex plugin development.

Project description

github_url:

https://github.com/LizardByte/plexhints/tree/nightly/README.rst

Overview

LizardByte has the full documentation hosted on Read the Docs.

About

Plexhints is a set of tools to aid in the development of plugins for Plex Media Server. It is not a framework, but rather a set of tools that can be used to make your life easier.

Features

  • Python library providing type hints to aid in the development of Plex plugins. Get rid of all those IDE warnings and errors!

  • A GitHub Action that will install and bootstrap a Plex Media Server in a CI environment. The action can install plugins and setup dummy libraries. Additionally the Plex token is provided as an output. This is useful for testing your plugin or other Plex project in a CI environment.

Integrations

GitHub Workflow Status (CI) Read the Docs Codecov GitHub Releases PyPI
github_url:

https://github.com/LizardByte/plexhints/tree/nightly/docs/source/about/installation.rst

Installation

Python Package

This library is available on PyPI as plexhints. It can be installed in several ways.

PyPI

python -m pip install plexhints

git

python -m pip install git+https://github.com/lizardbyte/plexhints.git@dist#egg=plexhints

github archive

python -m pip install https://github.com/lizardbyte/plexhints/archive/dist.zip#egg=plexhints
github_url:

https://github.com/LizardByte/plexhints/tree/nightly/docs/source/about/usage.rst

Usage

Plexhints can be used by just importing the plexhints module and running a couple of functions. After doing so you can use plexhints in your IDE and run most of your code outside of Plex. This is useful for debugging and testing.

Main Entry Point

Place this at the top of your Contents/Code/__init__.py file. It is important to only import these when running outside of Plex.

# plex debugging
try:
    import plexhints  # noqa: F401
except ImportError:
    pass
else:  # the code is running outside of Plex
    from plexhints import plexhints_setup, update_sys_path
    plexhints_setup()  # reads the plugin plist file and determine if plexhints should use elevated policy or not
    update_sys_path()  # when running outside plex, append the path

Submodules

In files other than the main __init__.py file, you can simply import the plexhints module and use it as shown.

# plex debugging
try:
    import plexhints  # noqa: F401
except ImportError:
    pass
else:  # the code is running outside of Plex
    from plexhints.log_kit import Log

Available Imports

from plexhints.agent_kit import Agent, Media  # agent kit
from plexhints.core_kit import Core  # core kit
from plexhints.decorator_kit import handler, indirect, route  # decorator kit
from plexhints.exception_kit import Ex  # exception kit
from plexhints.locale_kit import Locale  # locale kit
from plexhints.log_kit import Log  # log kit
from plexhints.model_kit import Movie, VideoClip, VideoClipObject  # model kit
from plexhints.network_kit import HTTP  # network kit
from plexhints.object_kit import Callback, IndirectResponse, MediaObject, MessageContainer, MetadataItem, \
    MetadataSearchResult, PartObject, SearchResult  # object kit
from plexhints.parse_kit import HTML, JSON, Plist, RSS, XML, YAML  # parse kit
from plexhints.prefs_kit import Prefs  # prefs kit
from plexhints.proxy_kit import Proxy  # proxy kit
from plexhints.resource_kit import Resource  # resource kit
from plexhints.shortcut_kit import L, E, D, R, S  # shortcut kit
from plexhints.util_kit import String, Util  # util kit

from plexhints.constant_kit import CACHE_1MINUTE, CACHE_1HOUR, CACHE_1DAY, CACHE_1WEEK, CACHE_1MONTH  # constant kit
from plexhints.constant_kit import ClientPlatforms, Protocols, OldProtocols, ServerPlatforms, ViewTypes, \
    SummaryTextTypes, AudioCodecs, VideoCodecs, Containers, ContainerContents, \
    StreamTypes  # constant kit, more commonly used in URL services

# extra objects
from plexhints.extras_kit import BehindTheScenesObject, \
    ConcertVideoObject, \
    DeletedSceneObject, \
    FeaturetteObject, \
    InterviewObject, \
    LiveMusicVideoObject, \
    LyricMusicVideoObject, \
    MusicVideoObject, \
    OtherObject, \
    SceneOrSampleObject, \
    ShortObject, \
    TrailerObject

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

plexhints-2023.1225.152442.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plexhints-2023.1225.152442-py2-none-any.whl (74.0 kB view details)

Uploaded Python 2

File details

Details for the file plexhints-2023.1225.152442.tar.gz.

File metadata

  • Download URL: plexhints-2023.1225.152442.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for plexhints-2023.1225.152442.tar.gz
Algorithm Hash digest
SHA256 77c27e88dbc450b7a23c2e9ccd61a9a5b662773060bc0d71372bfb65799359de
MD5 6a8fde7890a78ebd773953c90bcf1fa1
BLAKE2b-256 a23b56a505e8008d00b151c23b643a586e6bc326cca0f72c0b0f3f22f53123a8

See more details on using hashes here.

File details

Details for the file plexhints-2023.1225.152442-py2-none-any.whl.

File metadata

File hashes

Hashes for plexhints-2023.1225.152442-py2-none-any.whl
Algorithm Hash digest
SHA256 9c8227ec22e36d7bcc3583dc7d9e4dbf59de8a48be5bae2b79ca6fc6a9bfc063
MD5 b7429f9223eb102f244efddf53408de7
BLAKE2b-256 d714de09142e83b67581c29eaffc7a2a5bef667abcc073d6e02a790f70ce3bed

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