Skip to main content

ArgumentTasks

This library helps you to call easily defined tasks for your project, all you need to do is create a file for your tasks and a yml with their description.

Example

  1. Let's say you want to create a task for your project that welcomes people to your app, in this case, 'ArgumentTasks lib'. To do that you need to import Interface class from the library and instantiate it as follows:
from argument_tasks import Interface
from example_data import methods

SOURCE_YML_FILE = open("example_data/tasks.yml", "r")

Interface(SOURCE_YML_FILE, methods).run()

As you can see, we have defined a folder example_data that contains a yml file where the tasks are defined, and a methods file where the task's code is defined. Finally, the output for the code above is the text the hello_arg method from the methods file is printing.

Hello from ArgumentTasks lib!

Now, the methods defined are normal functions that must contain the parameter **kwargs. Bellow is the methods file code imported in the example.

def hello_arg(**kwargs):
    print("Hello from ArgumentTasks lib!")

There's also a necessary yml file in the example called tasks.yml where the tasks are defined. Below is the file code used in the example.

hello:
  action: hello_arg
  values: []

As you can see the file has a certain structure, here is an example of it.

<command_name: str>:
    action: <method_name: str>
    values:
        -
            name: <arg_name: str>
            type: <arg_type: python_class>
            required: <whether_arg_is_required: bool>
            description: <arg_description: str>

Cheers 👍

Release files for argument-tasks 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argument-tasks 0.1
File Size Uploaded
argument-tasks-0.1.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for argument-tasks 0.1
File Interpreter ABI Platform
argument_tasks-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.3 kB

Release files / argument-tasks-0.1.tar.gz

Download URL argument-tasks-0.1.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e07125b7ffc62cc4c0292c47346d815e12c99fa79cd410efcedbdc2a1cd0d3f1
BLAKE2b-256 checksum
How to use checksums
528f5ea099a620884ecf3b7087b6846947d6f46d3e2b7cfcb274f3b24e50dae7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9

Release files / argument_tasks-0.1-py3-none-any.whl

Download URL argument_tasks-0.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db7fefa7e220a3870186ffb5722cc550b912f924fa4e6a94a69642463303c3e4
BLAKE2b-256 checksum
How to use checksums
77df8dd60cc4594b453364ecd1ef70016cd20884e0364bf6d7465ef24b8558b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.9

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page