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
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/Python-PowerScript.git
cd Python-PowerScript
# 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));
}
โ 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
.psto.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
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Run tests:
python test_suits/run_all_tests.py - Commit and push:
git commit -m "Add amazing feature" git push origin feature/amazing-feature
- Open a Pull Request
Development Setup
# Clone repository
git clone https://github.com/SaleemLww/Python-PowerScript.git
cd Python-PowerScript
# 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
- โญ Star this repository if you find it useful!
- ๐ Report issues on GitHub Issues
- ๐ฌ Join discussions on GitHub Discussions
- ๐ง Contact: GitHub Profile
๐ฏ 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file eitps-1.0.0b1.tar.gz.
File metadata
- Download URL: eitps-1.0.0b1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06d86fe436ebab6e03f19f7139ba05d3d046dce3843b897764a709645af135fa
|
|
| MD5 |
a578e4fb840bceb21a5436806ff5d143
|
|
| BLAKE2b-256 |
5e49390a91bda4e047415a4085f49d2e00285eeb32903983818036e1b89a8722
|
File details
Details for the file eitps-1.0.0b1-py3-none-any.whl.
File metadata
- Download URL: eitps-1.0.0b1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a219f9bccba0c4ddab8799c6861af0081e047d70edb81188e9a0979b13cfd207
|
|
| MD5 |
b8b5ed4a507247df27da066eacd8ebb2
|
|
| BLAKE2b-256 |
5fa27db48087c3db9b97a02a46e42c4ddd89db712b2d029e1be60a6e3fefb37f
|