askill
python-skill

python-skillSafety 88Repository

Execute Python code for calculations, data processing, and automation. Access to math, json, datetime, collections, and more.

0 stars
1.2k downloads
Updated 2/13/2026

Package Files

Loading files...
SKILL.md

Python Code Execution Tool

Execute Python code for calculations, data processing, and automation tasks.

How It Works

This skill provides instructions for the Python Executor tool node. Connect the Python Executor node to Zeenie's input-tools handle to enable Python code execution.

python_code Tool

Execute Python code and return results.

Schema Fields

FieldTypeRequiredDescription
codestringYesPython code to execute

Available Libraries

LibraryDescription
mathMathematical functions (sqrt, pow, sin, cos, etc.)
jsonJSON encoding/decoding
datetimeDate and time manipulation
timedeltaTime duration calculations
reRegular expressions
randomRandom number generation
CounterCount hashable objects
defaultdictDictionary with default values

Built-in Variables

VariableDescription
input_dataData from connected workflow nodes (dict)
outputSet this to return a result

Output Methods

  1. Set output variable: Returns structured data to the workflow
  2. Use print(): Captured as console output

Examples

Basic calculation:

{
  "code": "result = 25 * 4 + 10\nprint(f'Result: {result}')\noutput = result"
}

Calculate tip:

{
  "code": "bill = 85.50\ntip_percent = 15\ntip = bill * (tip_percent / 100)\ntotal = bill + tip\nprint(f'Tip: ${tip:.2f}')\nprint(f'Total: ${total:.2f}')\noutput = {'tip': tip, 'total': total}"
}

Generate random numbers:

{
  "code": "import random\nnumbers = [random.randint(1, 100) for _ in range(5)]\nprint(f'Random numbers: {numbers}')\noutput = numbers"
}

Date calculations:

{
  "code": "from datetime import datetime, timedelta\ntoday = datetime.now()\nfuture = today + timedelta(days=30)\nresult = future.strftime('%Y-%m-%d')\nprint(f'30 days from now: {result}')\noutput = result"
}

Process data:

{
  "code": "data = input_data.get('numbers', [1, 2, 3, 4, 5])\ntotal = sum(data)\naverage = total / len(data)\nprint(f'Total: {total}, Average: {average}')\noutput = {'total': total, 'average': average}"
}

Parse JSON:

{
  "code": "import json\njson_str = '{\"name\": \"John\", \"age\": 30}'\ndata = json.loads(json_str)\nprint(f'Name: {data[\"name\"]}')\noutput = data"
}

Count items:

{
  "code": "from collections import Counter\nitems = ['apple', 'banana', 'apple', 'cherry', 'banana', 'apple']\ncounts = dict(Counter(items))\nprint(f'Counts: {counts}')\noutput = counts"
}

Text processing:

{
  "code": "import re\ntext = 'Contact: john@example.com or jane@test.org'\nemails = re.findall(r'\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Z|a-z]{2,}\\b', text)\nprint(f'Found emails: {emails}')\noutput = emails"
}

Response Format

Success:

{
  "success": true,
  "result": {"tip": 12.825, "total": 98.325},
  "output": "Tip: $12.83\nTotal: $98.33"
}

Error:

{
  "error": "name 'undefined_var' is not defined"
}

Use Cases

Use CaseApproach
Math calculationsUse math library functions
Date/time operationsUse datetime and timedelta
Data analysisUse list comprehensions, sum, len
Random generationUse random library
Text parsingUse re regular expressions
JSON manipulationUse json.loads() and json.dumps()
CountingUse Counter from collections

Guidelines

  1. Always set output: This returns data to the workflow
  2. Use print() for debugging: Output is captured and returned
  3. Keep code focused: One task per execution
  4. Handle errors: Use try/except for robust code
  5. No network access: Use http-skill for web requests
  6. No file system access: Restricted to safe operations
  7. Timeout: Default 30 seconds max execution time

Security Restrictions

  • No network/socket operations
  • No file system access outside designated areas
  • No subprocess/shell commands
  • Limited execution time (30 seconds)
  • Sandboxed environment

Setup Requirements

  1. Connect the Python Executor node to Zeenie's input-tools handle
  2. Python must be installed on the server

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

88/100Analyzed 2/19/2026

High-quality technical skill document with comprehensive Python code execution documentation. Contains detailed tool schema, 8 working examples, clear security restrictions, and setup instructions. Well-structured with tables, metadata, and clear sections. Minor deduction for being embedded in a project-specific path, but content is broadly applicable. Strong bonus for having use cases, structured examples, tags, icon, and high-density technical reference.

88
92
75
95
90

Metadata

Licenseunknown
Version-
Updated2/13/2026
Publishertrohitg

Tags

apigithub-actionssecuritytesting