> ## Documentation Index
> Fetch the complete documentation index at: https://anaconda.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Standalone asset usage

export const GCell = ({children, className}) => <div className={`grid-table-cell ${className || ""}`} role="cell">
    {children}
  </div>;

export const GTH = ({children, className}) => <div className={`grid-table-th ${className || ""}`} role="columnheader">
    {children}
  </div>;

export const GRow = ({children}) => <div className="grid-table-row" role="row">{children}</div>;

export const GBody = ({children}) => <div className="grid-table-body" role="rowgroup">{children}</div>;

export const GHead = ({children}) => <div className="grid-table-head" role="rowgroup">{children}</div>;

export const GTable = ({children, className, cols}) => <div className={`grid-table not-prose overflow-hidden rounded-2xl ${className || ""}`} style={{
  "--grid-table-cols": cols
}} role="table">
    {children}
  </div>;

Use the asset APIs outside a flow, such as in admin scripts, CI cleanup jobs, or notebooks.

Use `Asset` directly outside flow context (deployments, notebooks, scripts):

```python theme={null}
from obproject.assets import Asset

asset = Asset(
    project="fraud-detection",
    branch="main",
    read_only=True  # for read-only access
)

ref = asset.consume_model_asset("fraud_classifier")
```

<GTable cols="16% 10% 74%">
  <GHead>
    <GRow>
      <GTH>Parameter</GTH>
      <GTH>Type</GTH>
      <GTH>Description</GTH>
    </GRow>
  </GHead>

  <GBody>
    <GRow>
      <GCell>`project`</GCell>
      <GCell>str</GCell>
      <GCell>Project name</GCell>
    </GRow>

    <GRow>
      <GCell>`branch`</GCell>
      <GCell>str</GCell>
      <GCell>Branch name</GCell>
    </GRow>

    <GRow>
      <GCell>`entity_ref`</GCell>
      <GCell>dict</GCell>
      <GCell>Pass for writes outside a flow; e.g. `{"entity_kind": "user", "entity_id": "cleanup-script"}`. The default resolves from `current.pathspec`, which is `None` outside a Metaflow run and is rejected by the backend.</GCell>
    </GRow>

    <GRow>
      <GCell>`read_only`</GCell>
      <GCell>bool</GCell>
      <GCell>Set `True` for read-only access (skips entity tracking)</GCell>
    </GRow>
  </GBody>
</GTable>

When `read_only=True`:

* Registration methods are no-ops
* Consume methods use GET (no lineage tracking) instead of PUT
* Delete methods raise `RuntimeError`

For writes from a standalone script (register, consume, delete), pass an explicit `entity_ref`—`current.pathspec` isn't available outside a flow.

### Cleanup scripts

Writable standalone clients are the right path for admin or CI cleanup. The script constructs an `Asset` with an explicit user-entity ref, then loops over names to delete:

```python theme={null}
from obproject.assets import Asset

asset = Asset(
    project="my-project",
    branch="main",
    entity_ref={"entity_kind": "user", "entity_id": "cleanup-script"},
)
for name in ("obsolete_dataset", "old_features"):
    result = asset.delete_data_asset(name)
    print(f"{name}: catalog={result.catalog_deleted} metadata={result.metadata_updated}")
```

Each call removes the asset from both the catalog and the flowproject metadata. `DeleteResult` lets the script render meaningful progress (for example, `already absent` vs `metadata only (catalog already absent)` vs `deleted (catalog+metadata)`). Reruns are safe—names that are already gone return `DeleteResult(False, False)`.
