Skip to main content

NEXUS: A Custom Domain-Specific Scripting Language (DSL) for local automation

Project description

NEXUS: A Custom Domain-Specific Scripting Language (DSL)

NEXUS is an elegant, cross-platform, domain-specific scripting language engineered entirely in Python. It abstracts complex localized operating system tasks, directory architectures, cryptographic transformations, and core machine telemetry workflows into a highly readable, human-centric syntax layout.

Developed as a breakthrough milestone during the First-Year curriculum at Lovely Professional University (LPU), Jalandhar, this framework implements a modular token parsing architecture that lets you automate system scripts natively.


🚀 Installation & Setup

Install the stable release of the NEXUS engine directly from PyPI using pip:

pip install nexus-dsl

External Dependencies

NEXUS requires a few lightweight libraries to power its native notification toaster, text layout engines, and hardware audio modules:

pip install colorama plyer pyttsx3

💻 Python Integration API

The project architecture is decoupled across three main structural modules:

  • main.py: File validator, reader loop, and core runtime entry point.
  • function_passer.py: Syntax token interpreter, router loop, and input parameter slicer.
  • function_executors.py: Core execution engine handling files, systems, memory state, and data parsing.

You can easily load and run .nxs automation scripts straight from your standard Python files.

from nexus import nexus

# Simply trigger the core engine loop by providing your script path
nexus.nexus("main.nxs")

📖 Keyword Reference Manual & Syntax Specs

NEXUS statement expressions read line-by-line. Comments must begin with a # token. Any multi-word string parameters containing spaces must be cleanly wrapped inside typographic double quotes (”...”).

1. Variables & Memory Engine (New)

  • Set [variable_name] = [value]
    Declares or overwrites a dynamic variable inside runtime memory. It supports variable-to-variable assignments and automatically casts literals.
    • String Literal: Wrapped in double quotes (”b”). Skips lookups and saves as a raw string text asset.
    • Numeric/Boolean Literal: Unquoted strings like 5, 12.4, or True automatically evaluate into proper data types (int, float, bool).
    • Variable Reference: Unquoted words check memory state. If the variable name exists, its assigned value is copied. If it doesn't exist, it displays a missing definition error and exits.
    • Syntax: Set a = ”b” | Set x = 5 | Set y = x

2. Console Operations & Core Logging

  • Show [expression / variable]
    Strips enclosing quote markers from strings, converts numbers, checks variable memory references, and prints the result cleanly to the console.
    Syntax: Show ”Hello, World!” or Show a
  • Wait [seconds]
    Pauses the script execution stream for an integer or floating-point duration. Generates a high-contrast red error message if the parameter value is non-numeric.
    Syntax: Wait 1.5
  • Speak [string / variable]
    Hooks directly into your machine's hardware sound drivers to speak a line of text or variable value out loud natively using offline speech synthesis.
    Syntax: Speak ”Automation sequence initiated”
  • Notify ”[Title]” ”[Message]”
    Uses a token slice delimiter to push a real, native desktop notification toast banner into the system screen space. Requires both parameters to be wrapped in double quotes.
    Syntax: Notify ”NEXUS Core” ”Task Completed Successfully”

3. File & Storage Operations

  • Create [filename]
    Safely generates an empty file inside your active working workspace folder if it doesn't already exist.
    Syntax: Create log.txt
  • Write [filename] [string]
    Completely overwrites a file with a fresh text payload, wiping any trailing historical characters out of the file buffer.
    Syntax: Write log.txt ”Initial Payload”
  • MuteWrite [filename] [Line / NewLine] [string]
    Appends text data onto the end of a file. Use Line to paste characters on the active row, or NewLine to prefix a line break.
    Syntax: MuteWrite log.txt NewLine ”Appended system note.”
  • Truncate [filename]
    Instantly clears and zeroes out all data content inside a document without dropping the file pointer from your storage.
    Syntax: Truncate log.txt
  • Delete [filename]
    Hard-drops and permanently removes a targeted file path from your computer disk storage.
    Syntax: Delete obsolete.txt
  • Rename [old_filename] [new_filename]
    Modifies the naming characteristics of a target file path in-place.
    Syntax: Rename records.txt old_records.txt
  • Copy [source_path] [destination_path]
    Clones a localized file into a fresh directory lane safely.
    Syntax: Copy data.txt backup_data.txt
  • Move [filename] [directory_folder]
    Relocates an asset file out of your active workspace directory and paths it into a target folder directory.
    Syntax: Move log.txt BackupsFolder
  • SizeOf [unit] [filename]
    Uses match-case pattern mapping to calculate file weights into human-readable scales including bytes, kb, mb, gb, tb, pb, and eb.
    Syntax: SizeOf mb archive.zip
  • Backup [filename]
    Creates an automated timestamped duplicate copy of the target file for recovery purposes (e.g., data_20260624_161022.txt).
    Syntax: Backup data.txt

4. Directory Management

  • MakeDir [base_directory] [new_folder_name]
    Joins variables securely to deploy a new nested workspace directory folder.
    Syntax: MakeDir . ”BackupsFolder”
  • DelDir [directory_path]
    Flashes an engine warning prompt asking for explicit terminal confirmation (yes/no) before wiping a directory.
    Syntax: DelDir BackupsFolder

5. Application Control & Cryptography

  • Run [command]
    Asynchronously spawns independent system application processes or command lines without freezing your main interpreter loop.
    Syntax: Run notepad.exe
  • Open [filename]
    Launches a text document natively inside the operating system's standard text editor (Notepad).
    Syntax: Open hello.txt
  • Browse [URL]
    Triggers your default web browser tool to spin open and target a live web URL natively.
    Syntax: Browse https://lpu.in
  • Progress [seconds]
    Renders an active graphical loading progress tracking bar loop ([fifififi......]) directly across the terminal row workspace console over X seconds.
    Syntax: Progress 5
  • Compress [folder_or_file_path]
    Packages an independent text file into a .zip file archive, or directories using standard system zip-archive frameworks.
    Syntax: Compress ”MyProjectFolder”
  • Extract [source_archive.zip] [destination_folder]
    Extracts compressed zip archives directly into a targeted folder destination directory path.
    Syntax: Extract archive.zip ExtractedFiles
  • SystemInfo
    Pulls operational machine configurations, including kernel type, operating system version, processor architecture, and host network identity node parameters.
    Syntax: SystemInfo
  • Encrypt [filename]
    Recursively strips newline markers, processes file lines through a custom hashing substitution module, and overwrites with the scrambled hash text payload.
    Syntax: Encrypt secrets.txt
  • Decrypt [filename]
    Reverses encrypted files back into natural readable text using an advanced forward lookup reverse hashing transformation module.
    Syntax: Decrypt secrets.txt

🛠️ Example Automation Script (main.nxs)

# Boot diagnostic evaluation sequences
SystemInfo
Wait 1

# Variable manipulation
Set target_file = ”telemetry.txt”
Set delay_timer = 2

# Manage files dynamically using dynamic variable parameters
Create telemetry.txt
Write telemetry.txt ”NEXUS Automation Runtime Engine”
MuteWrite telemetry.txt NewLine ”LPU Automated System Script Engine Baseline”

# Output results and notify desktop environment
Show target_file
Wait delay_timer
Encrypt telemetry.txt
Speak ”Process framework executed cleanly”
Notify ”NEXUS Status” ”Automation routine finished structural processing.”

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

nexus_dsl-1.0.7.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

nexus_dsl-1.0.7-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file nexus_dsl-1.0.7.tar.gz.

File metadata

  • Download URL: nexus_dsl-1.0.7.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for nexus_dsl-1.0.7.tar.gz
Algorithm Hash digest
SHA256 9e47d2f8335713db1edf47244fa2bb390fefa5df243968d9e1b564871cdb707a
MD5 ba49ad041a40145682ce62a250f1aec7
BLAKE2b-256 7e6b6651964fba2c5df68c195888690a3276ae9aaa3be969d5c67596b8ac5219

See more details on using hashes here.

File details

Details for the file nexus_dsl-1.0.7-py3-none-any.whl.

File metadata

  • Download URL: nexus_dsl-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for nexus_dsl-1.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c0ca7816a8978b84946a14934420c83f0134d6b8e771a432b3698eaa8610dc39
MD5 327f7a5bc965c47afba73a0ded66003e
BLAKE2b-256 c3dc18eff6e19f56475d179c2a277bf25dfd5b3596793f5c9e1825e4ca85fc47

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