Skip to main content

Typed PowerScript (TPS) - A fully structured development language that transpiles to Python

Project description

๐Ÿš€ PowerScript (TPS) Preview Version 1.0.0

Modern Typed Syntax Meets Python's Power

PyPI Version Python Version License Status

A Modern Typed Programming Language that Transpiles to Python

๐Ÿ“ฆ Install โ€ข ๐Ÿ“š Docs โ€ข ๐ŸŽฏ Quick Start โ€ข ๐Ÿ’ก Examples โ€ข ๐Ÿค Contribute

โœ… Status: v1.0.0 Beta โ€” Production-ready with comprehensive feature set, full VS Code support, and extensive testing!


๐ŸŒŸ What is PowerScript?

PowerScript (TPS โ€” Typed PowerScript) is a modern programming language that transpiles to clean Python code.
Write with JavaScript-familiar syntax, get Python's power!

// Clean, modern syntax with type safety
class NeuralNetwork {
    private model: any;

    constructor(layers: number[]) {
        this.model = this.buildModel(layers);
    }

    async train(data: any[], labels: any[]): Promise<void> {
        await this.model.fit(data, labels, {
            epochs: 10,
            batchSize: 32
        });
    }
}

๐ŸŽฏ Why PowerScript?

Feature PowerScript Python JavaScript
๐ŸŽจ Modern Syntax โœ… Clean & Familiar โŒ Verbose โœ… Modern
๐Ÿ”’ Type Safety โœ… Static + Runtime โŒ Dynamic Only โš ๏ธ Optional
๐Ÿ Python Ecosystem โœ… Full Access โœ… Native โŒ No Access
โšก Performance โœ… Python Speed โœ… Native โš ๏ธ V8 Engine
๐Ÿ› ๏ธ Tooling โœ… VS Code Ext โœ… Mature โœ… Excellent
๐Ÿ“ฆ Easy Install โœ… pip install โœ… Built-in โœ… npm install

โœจ Key Benefits

  • ๐ŸŽจ Modern Syntax โ€” Clean, familiar syntax inspired by JavaScript and modern languages
  • ๐Ÿ”’ Type Safety โ€” Static type checking with runtime validation
  • ๐Ÿš€ Python Power โ€” Full access to Python's ecosystem (NumPy, TensorFlow, Django, etc.)
  • ๐Ÿ› ๏ธ Production Ready โ€” Complete compiler toolchain with VS Code integration
  • โšก Zero Runtime โ€” Transpiles to clean Python, no runtime overhead
  • ๐ŸŽ“ Easy Learning โ€” If you know JavaScript or Python, you'll love PowerScript!

๐Ÿ“ฆ Installation

Quick Start (PyPI)

# Install TPS
pip install eitps

# Verify installation
tps --version

From Source

# Clone repository
git clone https://github.com/SaleemLww/PowerScript-EITPS.git
cd PowerScript-EITPS

# Install
pip install -e .

VS Code Extension

# Install from VSIX
code --install-extension vscode-extension/powerscript-1.0.0.vsix

๐Ÿ“š Complete Installation Guide โ†’


โšก Quick Start

Hello World

Create hello.ps:

function main(): void {
    console.log("Hello, PowerScript!");
}

Compile and run:

tps-compile hello.ps
python hello.py
# Output: Hello, PowerScript!

Complete Example

// Calculator with type safety
class Calculator {
    add(a: number, b: number): number {
        return a + b;
    }

    divide(a: number, b: number): number {
        if (b == 0) {
            console.log("Error: Division by zero");
            return 0;
        }
        return a / b;
    }
}

function main(): void {
    let calc = new Calculator();
    console.log("10 + 5 = " + calc.add(10, 5));
    console.log("10 / 5 = " + calc.divide(10, 5));
}

๐Ÿš€ 5-Minute Tutorial โ†’


โœ… Implemented Features

Core Language (Production Ready)

Type System โœ…
  • โœ… Basic types: string, number, boolean, void, any, null, undefined
  • โœ… Array types: string[], number[], etc.
  • โœ… Function types with parameters and return types
  • โœ… Union types: string | number
  • โœ… Type inference
  • โœ… Type annotations
  • โœ… Runtime type validation
Functions & Classes โœ…
  • โœ… Function declarations with types
  • โœ… Arrow functions
  • โœ… Class declarations
  • โœ… Constructor methods
  • โœ… Class properties (public/private)
  • โœ… Class methods
  • โœ… Inheritance (extends)
  • โœ… Static members
  • โœ… Access modifiers (public, private, protected)
Control Flow โœ…
  • โœ… If-else statements
  • โœ… Switch-case statements
  • โœ… For loops
  • โœ… While loops
  • โœ… Break/continue
  • โœ… Return statements
  • โœ… Ternary operators
Advanced Features โœ…
  • โœ… Async/await support
  • โœ… Promises
  • โœ… Enums
  • โœ… Interfaces (basic)
  • โœ… Abstract classes
  • โœ… Modules (import/export)
  • โœ… Destructuring (basic)

Runtime Libraries (Production Ready)

Built-in Modules โœ…
  • โœ… Console โ€” console.log(), console.error(), etc.
  • โœ… FileSystem โ€” Read/write files, directory operations
  • โœ… JSON โ€” Parse and stringify JSON
  • โœ… CSV โ€” Read and write CSV files
  • โœ… Database โ€” SQLite integration
  • โœ… GUI โ€” Basic GUI operations (tkinter wrapper)
  • โœ… Networking โ€” HTTP requests, web scraping
  • โœ… Math โ€” Mathematical utilities
  • โœ… DateTime โ€” Date and time operations

Development Tools (Production Ready)

  • โœ… tps-compile โ€” Compile .ps to .py
  • โœ… tps-run โ€” Compile and execute
  • โœ… tps-create โ€” Project scaffolding
  • โœ… tps-check โ€” Type checking
  • โœ… VS Code Extension โ€” Syntax highlighting, snippets, error detection
  • โœ… CLI Tools โ€” Complete command-line interface

๐Ÿ”„ Coming Soon

v1.1 (Q1 2026)

  • ๐Ÿ”„ Advanced generics
  • ๐Ÿ”„ Decorators
  • ๐Ÿ”„ Namespace support
  • ๐Ÿ”„ Advanced destructuring
  • ๐Ÿ”„ Spread operator
  • ๐Ÿ”„ Optional chaining (?.)
  • ๐Ÿ”„ Nullish coalescing (??)

v1.2 (Q2 2026)

  • ๐Ÿ”„ Language Server Protocol (LSP) with IntelliSense
  • ๐Ÿ”„ Code refactoring tools
  • ๐Ÿ”„ Debugger integration
  • ๐Ÿ”„ Package manager
  • ๐Ÿ”„ Build system
  • ๐Ÿ”„ Test framework

v2.0 (Q3 2026)

  • ๐Ÿ”„ Advanced type inference
  • ๐Ÿ”„ Compile-time optimizations
  • ๐Ÿ”„ Source maps
  • ๐Ÿ”„ REPL environment
  • ๐Ÿ”„ Hot reloading
  • ๐Ÿ”„ Plugin system

๐Ÿ’ผ Use Cases

1. AI & Machine Learning

import { numpy as np, tensorflow as tf } from "python";

class AIModel {
    private model: any;

    constructor() {
        this.model = tf.keras.Sequential([
            tf.keras.layers.Dense(128, activation: "relu"),
            tf.keras.layers.Dense(10, activation: "softmax")
        ]);
    }

    async train(X: any, y: any): Promise<void> {
        this.model.compile({
            optimizer: "adam",
            loss: "sparse_categorical_crossentropy"
        });
        await this.model.fit(X, y, { epochs: 10 });
    }
}

2. Data Science

import { pandas as pd, matplotlib.pyplot as plt } from "python";

class DataAnalyzer {
    analyze(csvPath: string): void {
        let df = pd.read_csv(csvPath);
        console.log("Shape:", df.shape);
        console.log("Summary:", df.describe());

        // Visualize
        df.plot(kind: "hist");
        plt.show();
    }
}

3. Web Development

import { Flask } from "python";

class WebApp {
    private app: any;

    constructor() {
        this.app = Flask(__name__);
        this.setupRoutes();
    }

    setupRoutes(): void {
        this.app.route("/")(function(): string {
            return "Hello from PowerScript!";
        });
    }

    run(): void {
        this.app.run(debug: true);
    }
}

4. GUI Applications

import { GUI } from "powerscript/runtime";

class CalculatorApp {
    private window: any;

    constructor() {
        this.window = GUI.createWindow("Calculator", 300, 200);
        this.setupUI();
    }

    setupUI(): void {
        let button = GUI.createButton(this.window, "Calculate");
        button.onClick(() => {
            console.log("Calculating...");
        });
    }
}

5. Automation

import { FileSystem } from "powerscript/runtime";

class FileOrganizer {
    organize(directory: string): void {
        let files = FileSystem.listFiles(directory);

        for (let i = 0; i < files.length; i++) {
            let file = files[i];
            if (file.endsWith(".jpg") || file.endsWith(".png")) {
                FileSystem.move(file, directory + "/images/");
            }
        }

        console.log("Organization complete!");
    }
}

๐Ÿงช Testing & Quality

Build Status

# Run all tests
cd test_suits
python run_all_tests.py

๐Ÿ“š Documentation


๐Ÿ› ๏ธ CLI Commands

Command Description Example
tps-compile Compile .ps to .py tps-compile app.ps
tps-run Compile and execute tps-run app.ps
tps-create Create new project tps-create my-app
tps-check Type check only tps-check app.ps

๐Ÿค Contributing

We welcome contributions! PowerScript is open source and community-driven.

How to Contribute

  1. Fork the repository
  2. Create a feature branch:
    git checkout -b feature/amazing-feature
    
  3. Make your changes
  4. Run tests:
    python test_suits/run_all_tests.py
    
  5. Commit and push:
    git commit -m "Add amazing feature"
    git push origin feature/amazing-feature
    
  6. Open a Pull Request

Development Setup

# Clone repository
git clone https://github.com/SaleemLww/PowerScript-EITPS.git
cd PowerScript-EITPS

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install in development mode
pip install -e ".[dev]"

# Run tests
python test_suits/run_all_tests.py

Areas for Contribution

  • ๐Ÿ› Bug Fixes
  • โœจ New Features
  • ๐Ÿ“ Documentation
  • ๐Ÿงช Tests
  • ๐ŸŽจ VS Code Extension
  • ๐ŸŒ Examples

๐Ÿ“„ License

PowerScript is released under the MIT License.
See LICENSE.txt for details.

MIT License

Copyright (c) 2024-2025 Elite India Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

๐ŸŒŸ Support


๐ŸŽฏ Roadmap

โœ… Completed (v1.0 Beta)

  • โœ… Core language
  • โœ… Type system
  • โœ… Classes & inheritance
  • โœ… Async/await
  • โœ… Runtime libs
  • โœ… CLI tools
  • โœ… VS Code extension
  • โœ… Tests

๐Ÿšง In Progress

  • ๐Ÿ”„ Generics
  • ๐Ÿ”„ LSP integration
  • ๐Ÿ”„ Package manager
  • ๐Ÿ”„ Better errors

๐Ÿ“… Future

  • ๐Ÿ”ฎ Compile-time optimizations
  • ๐Ÿ”ฎ Plugin system
  • ๐Ÿ”ฎ REPL environment
  • ๐Ÿ”ฎ Hot reloading

Built with โค๏ธ by Elite India Team

โฌ†๏ธ Back to Top

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

eitps-1.0.0b2.tar.gz (20.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eitps-1.0.0b2-py3-none-any.whl (118.2 kB view details)

Uploaded Python 3

File details

Details for the file eitps-1.0.0b2.tar.gz.

File metadata

  • Download URL: eitps-1.0.0b2.tar.gz
  • Upload date:
  • Size: 20.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for eitps-1.0.0b2.tar.gz
Algorithm Hash digest
SHA256 27e3b477d3bd8567f0b9d77f19f22a34454f7b0c123c0cc9845aa02e5a9d475e
MD5 b7a844203782265ba319ef659881341d
BLAKE2b-256 cef746161fd47dfb01444259793b5242f6aaba878217562fe6f7acb4775ef727

See more details on using hashes here.

File details

Details for the file eitps-1.0.0b2-py3-none-any.whl.

File metadata

  • Download URL: eitps-1.0.0b2-py3-none-any.whl
  • Upload date:
  • Size: 118.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for eitps-1.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 54fc68641139211bdb7897435b37f7f2cc20173dcb60fb450c37e1e9c0a87e6f
MD5 57c4905cb6994a62b6b36a606c1cc8e3
BLAKE2b-256 2016cf184a542dadea9e30480fc47629438359eddb6d47d88159959a3d2a7b9b

See more details on using hashes here.

Supported by

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