Coder Social home page Coder Social logo

carlossilva2 / pytasker Goto Github PK

View Code? Open in Web Editor NEW
7.0 2.0 1.0 547 KB

Run pipelines on your own computer for better automation

Home Page: https://pypi.org/project/pyTasker

License: GNU General Public License v3.0

Python 100.00%
automation python3 cli cli-utilities windows unix easy-to-use flow terminal

pytasker's Introduction

Tasker

pyTasker License Downloads Supported Versions Buy Me A Coffee

You know Ansible right? Well, this works kind of the same way, except you create tasks to automate your local computer.

How? You're in luck. Just create an InstructionSet (you can use the CLI command tasker create to get started) and let your life get easier!

Index

For more detailed information visit the Documentation

Installation

There are 2 ways of installation:

  1. Via source files available at GitHub.
  2. Using Pip
$ pip install pyTasker

Reference System

Tasker includes a reference system which allows the user to access values from a previous step and/or value, like the Input Action. References are a way to simplify the InstructionSets.

To get started with references simply use $<Step Number> or $<Step Number>.<Field Name> on a field. If no additional data is appended to the reference, like $0, the system will fallback to the key where reference was invoked.

Example:

{
    "name": "<Step Name>",
    "step": 0,
    "operation": "input",
    "question": "<Question Value>"
},
{
    "name": "<Step Name>",
    "step": 1,
    "operation": "zip",
    "target": "*",
    "rename": "$0.value",
    "!deflate": true,
    "!destination": "<Destination Path>",
    "subfolders": true
}

Key Features

For extra information use tasker -h

Copy Action

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "copy",
    "target": "<File(s) or File Type>",
    "origin": "<Location Path>",
    "destination": "<Location End Path>",
    "subfolders": false //Should Tasker also include subfolders inside main location
}

Zip Action

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "zip",
    "target": "<Location Path>",
    "rename": "<Name of Zip file>",
    "!destination": "<Name of Zip file>",
    "!deflate": false, //When Zip is created should the Folder structure be with current system Path or just the pretended folder
    "subfolders": true //Should Tasker also include subfolders inside main location
}

Delete Action

Warning: This permanently deletes the file(s) from computer

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "delete",
    "destination": "<Location to delete files>",
    "target": "<File(s) or File Type>", //Can use location + file name/type
}

Move Action

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "move",
    "origin": "<File(s) or File Type>", //Can use location + file name/type
    "destinaton": "<File(s) or File Type>", //Can use location + file name/type
    "target": "<File(s) or File Type>" //Can use location + file name/type
}

Input Action

This action stores the Answer in the value variable

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "input",
    "question": "<Question to prompt the user>"
}

Echo Action

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "input",
    "value": "<Value to output to console>"
}

Request Action

This action stores the Response in the response variable

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "request",
    "endpoint": "<URL to query>",
    "method": "<get | post | put | delete>", //Must be only 1 option
    "!body": {}, //Optional parameter
    "!headers": {} //Optional Parameter
}

Registry Action

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "registry",
    "start_key": "<classes-root | current-user | current-config | local-machine | users>",
    "key": "<path to the key>",
    "function": "<get | set | create | backup>",
    "type": "<sz | multisz | none | binary | dword | qword>",
    "value": "<data>",
    "rename": "<file name for backup>"
}

Custom Action

Allows the usage of Custom Extension when created via the tasker extension -n <Name of Extension> command

{
    "name": "<Name of Step>",
    "step": 0,
    "operation": "custom",
    "extension_name": ""
}

Step parameter is the order Tasker will pick up the tasks

Parameters starting with "!" are optional parameters

Usage

Copy Action Complex Action

Roadmap

This is a project I'm working on my free time, however I have some new Actions in mind I want to implement.

Actions in Pipeline

  • Input Action
  • Command Action
  • Encrypt Action
  • Registry Action (for Windows)

General Improvements

  • Change reference system

Support

Buy me a Coffee

pytasker's People

Contributors

carlossilva2 avatar dependabot[bot] avatar

Stargazers

Tuan Duc Tran avatar Jochen Parmentier avatar Hugo Drumond avatar Jazz avatar Fung YIP avatar Vitalii avatar Adam Smith avatar

Watchers

James Cloos avatar  avatar

Forkers

hugothomel

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.