Files
smoothschedule/activepieces-fork/packages/pieces/community/python-code/src/index.ts
poduck f3e1b8f8bf Add Python/Ruby code pieces and fix template loading performance
- Add Python code execution piece with subprocess-based runner
- Add Ruby code execution piece with subprocess-based runner
- Fix template loading: fetch individual templates from cloud for community edition
- Add piece name aliasing for renamed pieces (piece-text-ai → piece-ai, etc.)
- Add dev pieces caching to avoid disk reads on every request (60s TTL)
- Add Python and Ruby logos to Django static files

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-20 00:18:42 -05:00

19 lines
659 B
TypeScript

import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/shared';
import { runPythonCode } from './lib/run-python-code';
// Python logo - hosted on Django backend
const PYTHON_LOGO = 'http://lvh.me:8000/static/images/python-logo.svg';
export const pythonCode = createPiece({
displayName: 'Python Code',
description: 'Execute Python code in your automations',
auth: PieceAuth.None(),
minimumSupportedRelease: '0.36.1',
logoUrl: PYTHON_LOGO,
categories: [PieceCategory.CORE, PieceCategory.DEVELOPER_TOOLS],
authors: ['smoothschedule'],
actions: [runPythonCode],
triggers: [],
});