Skip to main content

Personal Assistant on the command line

Project description

Yoda PA

Github CI PyPI version

Personal Assistant on the command line.

Installation

pip install yodapa

yoda --help

Configure Yoda

yoda configure

Plugins

Write your own plugin for Yoda

Simply create a class with the @yoda_plugin(name="plugin-name") decorator and add methods to it. The non-private methods will be automatically added as sub-commands to Yoda, with the command being the name you provide to the decorator.

import typer
from yodapa.plugin_manager.decorator import yoda_plugin


@yoda_plugin(name="hi")
class HiPlugin:
    """
    Hi plugin. Say hello.

    Example:
        $ yoda hi hello --name MP
        $ yoda hi hello
    """

    def hello(self, name: str = None):
        """Say hello."""
        name = name or "Padawan"
        typer.echo(f"Hello {name}!")

    def _private_method_should_not_be_added(self):
        """This method should not be added as a command."""
        raise NotImplementedError()

Development setup

# 1. Install poetry from their website: https://python-poetry.org/docs/#installation

# 2. Install dependencies and this package
poetry install

# 3. Activate the virtual environment
poetry shell

# Now you should be able to communicate with yoda
yoda --help

Testing

# Run tests when in the virtual environment
pytest

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

yodapa-0.2.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

yodapa-0.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file yodapa-0.2.0.tar.gz.

File metadata

  • Download URL: yodapa-0.2.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.20 Linux/6.8.0-1014-azure

File hashes

Hashes for yodapa-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e0db483e683b4aeb45b3811dcd487967e2a10749eccebe31a4e0a4c7459212c2
MD5 dbf46c0462ff3088ecaeb9837ac12cb5
BLAKE2b-256 ff127a830baaa36ddde3ac89b7f5a2ece3765d9c4b90d509cceec90b6a9126b4

See more details on using hashes here.

File details

Details for the file yodapa-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: yodapa-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.9.20 Linux/6.8.0-1014-azure

File hashes

Hashes for yodapa-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f4eb0c98e4ec3e1947edc04b62368bb1d22982962c8382e7c2d6087280a262c
MD5 4a8425d3394fba27852dceceeaf04dc3
BLAKE2b-256 e8f257ff9453a3628f7b77840cf737f7915dfd273f5eed2787b2689b0700147c

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