GithubHelp home page GithubHelp logo

eringiglio / scriptabit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dc23/scriptabit

0.0 2.0 0.0 365 KB

Python scripting for Habitica

License: Apache License 2.0

Makefile 1.22% Python 98.54% Shell 0.24%

scriptabit's Introduction

Readme

Python scripting and scenarios for Habitica.

https://travis-ci.org/DC23/scriptabit.svg?branch=master Documentation Status

Note that apart from bugs, I don't use the GitHub issue list for planning. Task and feature planning is carried out in a private Trello board. Access can be provided on request.

Installation

To install the latest release from PyPI:

pip install scriptabit

If you already have scriptabit installed, then upgrade with:

pip install --upgrade scriptabit

Habitica Credentials

You require an authentication credentials file in your home directory containing your Habitica API Key and User ID. The file should have a typical ini file structure, with the following section:

[habitica]
userid =
apikey =

Additional sections can be added, and the section name to use can be supplied as a command-line argument.

If you do not already have a .auth.cfg file, a default will be created when you first run scriptabit. You can then fill in your account values.

Note that your API key is effectively a password to your Habitica account. You should make sure the .auth.cfg file is protected, and never share the key with others. On Linux and related systems, you can set the permissions as follows:

chmod 600 .auth.cfg

Trello Credentials

If you wish to use the Trello plugin, you will need to add your Trello credentials to the .auth.cfg file as follows:

[trello]
apikey =
apisecret =
token =
tokensecret =

Your API key and API secret can be obtained here.

Your authorisation token and token secret will be obtained through an interactive process when you first run the trello plugin. You must first save your API key and API secret to the .auth.cfg file before you will be able to obtain the token and tokensecret.

Usage

scriptabit is a command-line application. Help on the available commands can be obtained by running:

$ scriptabit --help

Operations include:

  • -sud: Show user data.
  • -hp n: Set the user health to n
  • -mp n: Set the user's mana points to n
  • -xp n: Set experience points to n
  • -gp n: Set gold to n
  • -ls: List available plugins.

After running scriptabit at least once, configuration files will be created in ~/.config/scriptabit/. These can be edited to change the default options. You can revert to the installation defaults by deleting the files (they will be recreated on the next run).

See the :ref:`detailed-usage` section for detailed instructions on specific functionality.

Finally, most of the built-in plugins define a convenience command-line application name:

  • sb-banking is a shortcut for scriptabit --run banking
  • sb-csv is a shortcut for scriptabit --run csv_tasks
  • sb-health is a shortcut for scriptabit --run health_effects
  • sb-pets is a shortcut for scriptabit --run pet_care
  • sb-trello is a shortcut for scriptabit --run trello

When using the shortcuts, all other command-line arguments are the same as when running scriptabit.

Writing Plugins

User plugins should be placed into the scriptabit_plugins directory. This will be created in your home directory the first time scriptabit runs. Due to an initialisation order issue, this directory location cannot be specified on the command line (the plugin directory needs to be located before processing command line arguments so that plugins get a chance to add additional arguments). If the SCRIPTABIT_USER_PLUGIN_DIR environment variable is defined, then this location will be used instead of the default location.

Note that plugin data files may also be written to the user plugin directory

All plugins should subclass the IPlugin class. Refer to the API documentation for details of the available methods.

Also refer to the API documentation (and the view source option) for the sample plugin which can be used as a template for new plugins.

scriptabit's People

Contributors

dc23 avatar

Watchers

James Cloos avatar Erin Giglio avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.