Skip to main content

Koskript

Koskript

Koskript is a simple, embeddable, and lightweight scripting language for Python applications. It features dynamic typing, lexical scoping, closures, classes and native Python interop — letting you expose any Python function or object directly to your scripts.

See the documentation here

from koskript import KoskriptRuntime

runtime = KoskriptRuntime()
runtime.execute("""
const names = ["Ana", "Luis"]
array.each(names, (name) { print("hello " + name) })
""")

NOTE: Koskript is in early development; expect the language and API to change between releases.


Features

  • Dynamic typing.
  • Block-level lexical scoping with local declarations.
  • Namespaces (namespace Name { ... }) to group declarations.
  • Closures that capture their defining scope, including this inside methods.
  • Constants with const.
  • Classes with inheritance, visibility, static methods and constructors.
  • Standard library: core builtins plus map, array, string, bytes, math and json.
  • Module imports with per-module resolution (import "utils").
  • Configurable import search paths (runtime.add_import_path).
  • Native Python interop for functions, objects and classes.
  • if, elseif, else.
  • while, for, foreach loops with break / continue.
  • Error handling with error declarations, throw, try / catch / finally.
  • Member access and index access.
  • First-class functions and lambda expressions.
  • Wrappers with implicit return and Python-style decorators (@wrapper).
  • Arithmetic, comparison and logical operators.
  • Embeddable in any Python application.

Installation

pip install -U koskript

Or clone the repository and import it directly:

git clone https://github.com/alesis-buzz/koskript.git

Koskript requires Python 3.10+ and Lark. There is an experimental dependency-free parser behind KoskriptRuntime(native_parser_experiment=True).


Documentation

Document What it covers
Getting started Installation, first script, a complete example
Language reference Types, variables, operators, control flow, errors, functions, wrappers, namespaces, closures, modules, loops, strings, bytes
Classes Inheritance, visibility, static members, constructors, super
Standard library Core builtins and the map, array, string, bytes, math and json namespaces
Python interop Exposing Python values, callables and classes to scripts
Embedding guide KoskriptRuntime, run(), error handling and stdlib activation
Roadmap What is done, what is planned, known limitations

License

Koskript is licensed under the Mozilla Public License 2.0 (MPL-2.0). See LICENSE for the full text.

You are free to use, modify, and redistribute Koskript. However, you may not redistribute this project under a different name or claim authorship of the Koskript language.

Koskript is a trademark of Alesis.


Built with ❤️ by Alesis

Metadata

Release files for koskript 1.5.0

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

Source distribution (sdist)

Source distribution for koskript 1.5.0
File Size Uploaded Provenance Actions
koskript-1.5.0.tar.gz 78.9 kB Without provenance Details for koskript-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for koskript 1.5.0
File Interpreter ABI Platform Actions
koskript-1.5.0-py3-none-any.whl Python 3 none any Details for koskript-1.5.0-py3-none-any.whl

Total release size: 137.4 kB

Release files / koskript-1.5.0.tar.gz

Download URL koskript-1.5.0.tar.gz
Size 78.9 kB
Tags Source
SHA-256 checksum
How to use checksums
43af987897a5f4621103a093cfe1d23db4c5fef6cfd095078d13085d19f59edf
BLAKE2b-256 checksum
How to use checksums
83da41b01fda8836894a35e6895585d27355aac454d6e0f96c18efd3f246a49c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / koskript-1.5.0-py3-none-any.whl

Download URL koskript-1.5.0-py3-none-any.whl
Size 58.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb6ced9334d85ea7d2790dd70b468ef43754deccafbdf2a955d894bbbef89296
BLAKE2b-256 checksum
How to use checksums
d860bada17ce82ea190afd50ef1f3e6cf46c9506740d6db0475fe46e0cc404af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Security for koskript 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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