Metadata-Version: 2.4
Name: staros-lang
Version: 0.1.1
Summary: StarOS language runtime, parser, and CLI for StarOS source files.
Author: SKM
Project-URL: Homepage, https://github.com/SKM/StarOS
Project-URL: Repository, https://github.com/SKM/StarOS
Project-URL: Issues, https://github.com/SKM/StarOS/issues
Keywords: staros,language,parser,runtime,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Interpreters
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# StarOS

StarOS is a namespace-safe runtime with a real syntax and execution layer for StarOS source files.

Important: the PyPI distribution name for this project is `staros-lang`. The import package remains `staros`.

## Features

- `py.*` imports for Python modules
- `star.*` imports for StarOS modules
- `app.*` imports for local `.star` modules
- alias support
- runtime validation for import targets
- lexer + parser for StarOS source
- AST output for tooling and future execution
- interpreter for running `.star` programs

## Quick start

Install:

```bash
pip install staros-lang
```

```python
from staros import import_module, from_import, parse_source

math_mod = import_module("py.math")
sqrt = from_import("py.math", "sqrt")
program = parse_source("let answer = 40 + 2")
```

## CLI

```bash
staros import py.math
staros from py.math sqrt
staros parse example.star
staros run example.star
staros run examples/app_demo.star
```

## Publish To PyPI

The package name `staros` is already taken on PyPI, so this project is configured to publish as `staros-lang`.

Build locally:

```bash
python -m pip install --upgrade build
python -m build
```

Test local installation from the built wheel:

```bash
python -m pip install --force-reinstall dist/staros_lang-0.1.1-py3-none-any.whl
python -m staros.cli run examples/hello.star
```

If `staros` is not found on Windows after `pip install`, add this folder to `PATH`:

```text
C:\Users\<your-user>\AppData\Roaming\Python\Python314\Scripts
```

Until then, you can always run the CLI with:

```bash
python -m staros.cli run examples/hello.star
```

Publish options:

1. Manual upload:

```bash
python -m pip install --upgrade twine
python -m twine upload dist/*
```

2. GitHub Actions Trusted Publishing:
   Use `.github/workflows/publish.yml`, then configure the PyPI project to trust that workflow.

For Trusted Publishing on PyPI, configure:

- Repository owner: your GitHub owner or org
- Repository name: `StarOS`
- Workflow file: `.github/workflows/publish.yml`
- Environment: `pypi`

## Current StarOS syntax

```staros
import py.math as math
from star.web import render_page as render

const title = "Empire"
let answer = math.sqrt(40 + 2)
let flags = [true, false, not false]

fn classify(value) {
    if value > 10 {
        return "high"
    } else {
        return "low"
    }
}

print(classify(answer))
print(title)
```

## Local StarOS modules

Create a local file like `app/greetings.star`:

```staros
const empire_name = "StarOS"

fn greet(name) {
    return empire_name + " welcomes " + name
}
```

Then import it from another StarOS file:

```staros
import app.greetings as greetings
from app.greetings import greet

print(greetings.empire_name)
print(greet("Commander"))
```
