Metadata-Version: 2.5
Name: brickster
Version: 0.2.1
Summary: Install brickster.io Databricks labs into your workspace
Project-URL: Homepage, https://brickster.io
Project-URL: Source, https://github.com/pwnera/brickster
Author: pwnera
License-Expression: MIT
Keywords: databricks,delta,labs,notebooks,spark
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Education
Requires-Python: >=3.8
Provides-Extra: sdk
Requires-Dist: databricks-sdk>=0.20; extra == 'sdk'
Description-Content-Type: text/markdown

# brickster

Pulls a [brickster.io](https://brickster.io) lab's starter notebook into your Databricks workspace.

```python
%pip install brickster
dbutils.library.restartPython()

import brickster
brickster.list_labs()
brickster.install("retail-orders")
```

The notebook and the lab's data files land in `/Users/<you>/brickster/<slug>/`, and the call
renders a card with the paths and a link to open the notebook. Pass `path=` for somewhere else,
`overwrite=True` to replace what's there.

Off a cluster the same thing downloads into a local directory:

```bash
pip install brickster
brickster list
brickster install retail-orders --path ~/labs
```

## Submitting

Run the lab, then score it from the notebook you ran it in. No export, no upload.

```python
brickster.submit("retail-orders")
```

The token is yours from [brickster.io/settings](https://brickster.io/settings#token), and it can
submit labs as you and nothing else. Keep it in a secret scope, once per workspace, and no cell
ever holds it:

```
databricks secrets create-scope brickster
databricks secrets put-secret brickster token
```

Off a cluster there is no secret scope: set `BRICKSTER_TOKEN`, or pass `token="bk_..."`, which
wins over both.

Your Databricks credentials never leave the workspace. The package reads the notebook you are in
through the SDK's own notebook auth and posts that; brickster.io is never given a Databricks token
and never asks for one.

Run every cell first. `submit()` refuses a notebook with no `BRICKSTER:` lines in its outputs
rather than sending one the validator would score as every answer wrong.

Off a cluster, point it at a notebook you exported by hand:

```bash
brickster submit retail-orders --file exported.ipynb
```

Data comes along by default. `data=False` leaves it on the web instead, as a URL the starter can
read over HTTP, and on a cluster `data="/Volumes/main/default/brickster"` stages it in a Volume,
which is the path Spark wants:

```python
brickster.install("retail-orders", data="/Volumes/main/default/brickster")
```

The CLI spells the first one `--no-data`. `BRICKSTER_URL` points the package at another instance.

## Tests

```bash
python test_brickster.py
```
