Metadata-Version: 2.4
Name: fscss
Version: 0.1.0
Summary: Python wrapper for FSCSS (Figured Shorthand CSS) using the vendored Node compiler
Author: Omonire
License: MIT
Project-URL: Homepage, https://github.com/omonire/fscss-py
Project-URL: Repository, https://github.com/omonire/fscss-py
Project-URL: Issues, https://github.com/omonire/fscss-py/issues
Keywords: fscss,css,preprocessor,figsh,xfscss
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Dynamic: license-file

# fscss (Python)

Python wrapper for [FSCSS](https://fscss.devtem.org/) (Figured Shorthand CSS). Engineered by [Omonire](https://github.com/omonire). This package vendors the official FSCSS Node.js compiler (`xfscss`) and runs it via Node.js.

## Requirements

- Python >= 3.7
- Node.js >= 14 (installed and available in `PATH` as `node` or `nodejs`)

## Installation

```bash
pip install fscss
```

Or install from source:

```bash
pip install -e .
```

## Usage

### CLI

Same as the Node CLI:

```bash
fscss input.fscss output.css
```

Or just:

```bash
fscss input.fscss  # outputs input.css
```

### Python API

```python
import fscss

# Compile file
fscss.compile_file("style.fscss", "style.css")

# Compile string
css = fscss.compile_string("@c: red; body{ c: @c; }")
print(css)

# Also available as compile()
fscss.compile("style.fscss", "style.css")
```

### Flask integration (example)

```python
from flask import Flask, send_from_directory
import fscss
from pathlib import Path

app = Flask(__name__)

# Compile .fscss on startup
static = Path(app.static_folder)
fscss.compile_file(static / "style.fscss", static / "style.css")

if __name__ == "__main__":
    app.run(debug=True)
```

## Notes

- Node.js is not bundled. It must be installed on the system.
- Relative imports in `.fscss` files work the same as the original compiler.
- This keeps full compatibility with the upstream FSCSS compiler.
