Skip to main content

Apitax combines the power of Scriptax and COmmandtax into a quick and easy to use Python package to facillitate powerful Restful API Request Scripting

Project description

Apitax

Build Instructions

Scriptax - Control Flow, Scoping, and Automation

Existing keys

  • {% <someCommand> %}
    • Inline execution
    • A command is executed during the parsing of the line and its response is returned
  • > <someCommand>
    • Command execution
    • The command is executed after line parsing and the response is ignored
  • set <someVar> = <someValue>, set <someVar> = {% <someCommand> %}
    • Sets a variable
  • {{ someVar }}
    • Injects the contents of a variable
    • Fancy stuff is possible such as: set newVar = {% {{someVar}} %}
  • {{ r: someResponseVar }}
    • Injects the response of some variable
  • import {% someCommand %}
    • Executes a command and imports the response to the current scope
  • export {% someCommand %}, export someVar
    • Imports the values to the current scope and exports them to allow a parent scope to access these values
  • name <someName>
    • Sets the reference name of the script. If this is not specified, it'll default to the file name

Coming Soon

  • {% if <someCondition> %} <someExecution>
  • {% if <someCondition> %}: <someSetOfExecutionSpanningMultipleLines> {% endif %}
  • return <someDataOrOptionallyNoData>
    • Stops the processing of the current script and gives control back to the parent script
    • The parent script, if importing this subscript, will have access to any data returned by this subscript. The returned data will be directly under the subscripts namespace in the dataStore
      • For example: {"vars": {"someSubScript":{"return": "{"this is": "the returned data"}"}}}
  • <someVariable> to <type>
    • Cast a variable to a type
    • Types: boolean, string, int, float, double, json, object
    • Type checking is not preformed and is expected of the user to know what they are trying to do
  • {% for <someNewVariable> to range(<someStart>,<someEnd>) %} <someExecution>
  • {% for <someNewVariable> to <someEnd> %} <someExecution>
  • {% for <someNewVariable> in <someExistingVariableObject> %} <someExecution>
  • {% for oneOfTheCasesListedAbove %}: <someSetOfExecutionSpanningMultipleLines> {% endfor %}
  • require
    • Provide a means for a parent script to gather all of the data it will need to run from the executing user

Tidbits

  • You can use arrays via dot notation
    • set someVar.1 = num1
    • set someVar.2 = num2
    • set someVar.{{counter}} = num3

Commandtax - Data Gathering, Manipulating, Usage

Existing

  • script <pathToSomeScript>
    • Executes the script file specified
  • custom <someCustomCommand>
    • Execute some custom command

Coming Soon

  • shell <someCommand>
    • Runs the command in the shell and returns the response from the shell
  • eval <someExpression>
    • Evaluate the provided expression and return the result

Tidbits

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

apitax-2.0.1.tar.gz (28.2 kB view hashes)

Uploaded Source

Built Distribution

apitax-2.0.1-py3-none-any.whl (40.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page