Skip to main content

Complete AbuLang integration for Python IDLE - All commands work natively

Project description

AbuLangModule - Complete AbuLang for Python IDLE

This module enables ALL AbuLang commands to work in Python IDLE with full syntax support.

Installation

# In Python IDLE
import sys
sys.path.append('path/to/AbuLangModule')
from AbuLangModule import *

Or install as package:

pip install -e AbuLangModule

Usage in IDLE

>>> from AbuLangModule import *
[AbuLang] Initializing AbuLang Module...
[AbuLang]  Enabled!
[AbuLang] Available commands:
  I/O: show, ask, input
  Import: libra, library
  Math: plus, minus, multi, divid, expon, modul, absof, sumup, avera
  String: strip, lower, upper, replc, findt, lengt
  System: pausi, exitp
  File: readf, write

Type 'help_abulang()' for full command list

>>> show("Hello, AbuLang!")
Hello, AbuLang!

>>> x = 10
>>> y = 5
>>> show("Sum:", plus(x, y))
Sum: 15

>>> name = ask("Your name: ")
Your name: Abu
>>> show("Hello,", name)
Hello, Abu

>>> libra("math")
[AbuLang] Imported math
>>> show(math.sqrt(16))
4.0

Available Commands

I/O Commands

  • show(...) - Display output
  • ask(prompt) - Get user input

Import Commands

  • libra(module) - Import library

Advanced Features (NEW!)

  • get_line(n, file) - Read specific line from file
  • save_as(file) - Save format buffer to file
  • switch(format) - Multi-format blocks (yaml, json, csv)
  • assign_compare(var, val, cmp) - Inverse walrus operator (=:)
  • isolate(str, list) - Filter list by string
  • local(func).var - Access local variables from functions
  • local_to_global(func, var) - Pull local variable to global
  • save_local(func, var, val) - Save local variable

See ADVANCED_FEATURES.md for complete guide!

Math Commands

  • plus(a, b) - Add numbers
  • minus(a, b) - Subtract numbers
  • multi(a, b) - Multiply numbers
  • divid(a, b) - Divide numbers
  • expon(a, b) - Power (a^b)
  • modul(a, b) - Modulo (a%b)
  • absof(x) - Absolute value
  • sumup(list) - Sum of list
  • avera(list) - Average of list

String Commands

  • strip(text) - Remove spaces
  • lower(text) - Lowercase
  • upper(text) - Uppercase
  • replc(text, old, new) - Replace text
  • findt(text, word) - Find substring
  • lengt(text) - Length

System Commands

  • pausi(seconds) - Pause/sleep
  • exitp() - Exit program

File Commands

  • readf(file) - Read file
  • write(file, text) - Write file

AbuLang Packages

AbuSmart - System Utilities

>>> libra("AbuSmart")
>>> show(smart.time())
10:30:45
>>> show(smart.date())
2024-11-15
>>> smart.system_info()
=== System Information ===
...

AbuFILES - File Operations

>>> libra("AbuFILES")
>>> data = {"name": "Abu", "score": 100}
>>> files.save_data("mydata", data)
>>> loaded = files.load_data("mydata")
>>> show(loaded)
{'name': 'Abu', 'score': 100}

AbuINSTALL - Package Manager

>>> libra("AbuINSTALL")
>>> installer.check("requests")
 requests is installed
>>> installer.list_installed()
[List of packages...]

AbuChess - Chess AI

>>> libra("AbuChess")
>>> chess.info()
=== AbuChess - Neural Chess AI ===
...
>>> chess.AIweb()  # Launch web interface

Complete Example

>>> from AbuLangModule import *
[AbuLang] Initializing AbuLang Module...
[AbuLang]  Enabled!

>>> show("=== Calculator ===")
=== Calculator ===

>>> x = ask("First number: ")
First number: 10
>>> y = ask("Second number: ")
Second number: 5

>>> x = int(x)
>>> y = int(y)

>>> show("Sum:", plus(x, y))
Sum: 15
>>> show("Difference:", minus(x, y))
Difference: 5
>>> show("Product:", multi(x, y))
Product: 50
>>> show("Division:", divid(x, y))
Division: 2.0

>>> libra("math")
[AbuLang] Imported math
>>> show("Square root of x:", math.sqrt(x))
Square root of x: 3.1622776601683795

>>> libra("AbuSmart")
>>> show("Current time:", smart.time())
Current time: 10:30:45

Help

>>> help_abulang()
[Shows complete command list]

Disable AbuLang

>>> disable_abulang()
[AbuLang] Disabled

Notes

  • In IDLE, you must use parentheses: show("text")
  • For no-parentheses syntax, use .abu files: python cli.py file.abu
  • All commands are added to Python's builtins
  • Original builtins are preserved and can be restored

Requirements

  • Python 3.8+
  • PyYAML (for commands.yaml)

Optional:

  • psutil (for battery info)
  • pyperclip (for clipboard)
  • opencv-python (for webcam)
  • python-chess, torch, flask (for AbuChess)

Made with ❤️ by Abu

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

abulang-4.2.0.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

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

abulang-4.2.0-py3-none-any.whl (15.9 kB view details)

Uploaded Python 3

File details

Details for the file abulang-4.2.0.tar.gz.

File metadata

  • Download URL: abulang-4.2.0.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for abulang-4.2.0.tar.gz
Algorithm Hash digest
SHA256 f57dc3ed82a6b3fc3b4a32dfb00a10f2583e44dade1e1b3fe3b2c7dc714b6542
MD5 07071acf623afb02366a5293fd19e720
BLAKE2b-256 fde898fccaffb71e4dd898c770fb79bc86ccd6279b1ac0dd7091d0559433f2d7

See more details on using hashes here.

File details

Details for the file abulang-4.2.0-py3-none-any.whl.

File metadata

  • Download URL: abulang-4.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for abulang-4.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9df779071a64c1ab04cd9aaaa40c9fe95d26dbc56f60507af1a92a83c6e1d92f
MD5 ca31b981ffb903068ca7f18e5465d400
BLAKE2b-256 8567128d7049323b889d4e0fa70829cd5d99012ed0ad6b798103fbbd52557c0b

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