Skip to main content

Yapton

Yapton is a small educational programming language that lets kids not only learn Python faster but also write Python-style programs with slang-inspired keywords. A Yapton file (.yap) is translated to Python in memory and then run with the normal Python runtime. It is intended as a friendly bridge to Python, not as a replacement for it.

What this project does

Yapton keeps ordinary Python syntax, data types, loops, expressions, and standard-library imports. It adds the following alternative words:

Yapton Python meaning
yap(...) print(...)
spill(...) input(...), converting number-looking input to int or float
vibe name(): def name():
fanumtax math import math
optionC elif
otherwise else
W / L True / False

For example:

fanumtax math

vibe greet(name):
    yap("Welcome,", name)

name = spill("What is your name? ")
greet(name)

Project roles

The codebase has three clear responsibilities:

Part Role
src/yapton/__init__.py The Yapton language engine. It translates Yapton keywords into Python tokens, provides spill, runs .yap files, and prints the slang reference.
src/yapton/cli.py The command-line interface. It accepts yap program.yap and yap --slang-help, then calls the language engine.
pyproject.toml The package configuration. It declares the Python requirement and installs the yap command.
sample1.yap to sample7.yap Example Yapton programs, ordered from small language demonstrations to larger projects.
yap.bat The Windows launcher. It runs python -m yapton.cli, so it never depends on a copied, moved, or stale virtual environment.

Requirements

  • Python 3.10 or newer
  • PowerShell, Command Prompt, or another terminal
  • Git, only if you want to publish the project on GitHub
  • Download and use library of Yapton straight from

Check that Python is available:

py --version

If py is not found, install Python from python.org and make sure the installer option to add Python to PATH is enabled.

Run it locally (Windows / PowerShell)

Open PowerShell in this project folder, then create a fresh virtual environment and install Yapton in editable mode:

cd "C:\path\to\Yapton"
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e .

Run an example:

yap sample2.yap

Or run the larger example:

yap sample5.yap

See the built-in language reference at any time:

yap --slang-help

If PowerShell blocks activation

Activation is optional. Use the environment's Python directly instead:

.\.venv\Scripts\python.exe -m pip install -e .
.\.venv\Scripts\yap.exe sample2.yap

Run a new program

  1. Create a file ending in .yap, such as hello.yap.
  2. Add Yapton/Python code.
  3. Run yap hello.yap while the environment is active.

Indentation and colons work exactly like Python. Regular Python can be mixed with the Yapton keywords shown above.

Sample guide

File Demonstrates
sample1.yap Functions, loops, lists, conditions, and Yapton booleans.
sample2.yap Adding two numbers entered by the user.
sample3.yap Subtracting two numbers entered by the user.
sample4.yap Checking whether a number is positive or negative.
sample5.yap A menu-driven student score tracker using Yapton imports.
sample6.yap The same student tracker, showing that regular Python import also works.
sample7.yap A first-person 3D maze. Install its extra dependency first with python -m pip install ursina.

Why yap works reliably in this folder

Windows chooses yap.bat in the current folder before an installed yap command. This project launcher deliberately uses python -m yapton.cli instead of a hard-coded path to venv\\Scripts\\python.exe. That means it uses the same Python installation that installed Yapton and will not break merely because a virtual-environment folder was moved, deleted, or created on another computer.

Contributing

When adding a slang keyword, update both NAME_MAP and print_slang_help() in src/yapton/__init__.py, then add or update a .yap example that demonstrates it. Before committing, run an example and yap --slang-help to confirm the command still works.

Current status

Yapton is an early educational prototype. Because programs ultimately execute as Python, only run .yap files you trust.

Metadata

Release files for Yapton 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for Yapton 0.1.3
File Size Uploaded
yapton-0.1.3.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for Yapton 0.1.3
File Interpreter ABI Platform
yapton-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / yapton-0.1.3.tar.gz

Download URL yapton-0.1.3.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
021a4c1efd30e0ccc0f14fff7fbef0842aac9ce44523d5b035b7cfb8372d6caf
BLAKE2b-256 checksum
How to use checksums
96776da98ef4af24d0ef6b64d4a7f249084c275417bf8d986dddc8e5d61b2a70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / yapton-0.1.3-py3-none-any.whl

Download URL yapton-0.1.3-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b9c596fe4d56582d88beb30ee5a23949654e5d2662196c8f4dd2a3f2cbef86fd
BLAKE2b-256 checksum
How to use checksums
915b65b7fe746df4660f4d8ef84b3b72b783b30b97f13f38bf64549e5b3fcd0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page