Example Applications#

Each example is a complete script. See Installation to install labapi[dotenv,builtin-auth].

Example Matrix#

Example

Best For

Extra Packages

JSON Folder Sync

Uploading JSON files to a page and downloading JSON attachments back to disk

none

Folder Structure Download

Exporting notebook pages and entries to local files for backup or review

none

CSV Table Upload/Download

Converting CSV data to LabArchives HTML tables and back to CSV

beautifulsoup4

Getting Started#

All published examples assume:

  • Python 3.11.5+.

  • The recommended local interactive profile: labapi[dotenv,builtin-auth].

  • Run the uv run --project ... commands below from the repository root.

  • Use page paths relative to the notebook root, together with --notebook "My Notebook".

For example:

uv run --project examples/json_sync python examples/json_sync/json_sync.py upload examples/json_sync/sample_data "Experiments/2024/Data Analysis" --notebook "My Notebook"
uv run --project examples/folder_download python examples/folder_download/folder_download.py ./backup --notebook "My Notebook" --path "Experiments/2024"
uv run --project examples/csv_table python examples/csv_table/csv_table.py upload examples/csv_table/sample_data.csv "Experiments/Results" --notebook "My Notebook"

Additional Local Examples#

The repository also includes examples/model_logging and examples/notebook_logging, which have no page in these docs.