{% extends "base.html" %} {% block title %}{{ file_name }} - {{ dataset_name }} - Kirin{% endblock %} {% block breadcrumb %} {{ catalog_id }} {{ dataset_name }} {{ file_name }} {% endblock %} {% block header_title %}{{ file_name }}{% endblock %} {% block header_description %} {{ "%.1f"|format(file_size / 1024) }} KB • {% if is_binary %} Binary file ({{ content_type or "unknown type" }}) {% else %} Text preview {% if truncated %} • First 1000 lines {% endif %} {% endif %} {% endblock %} {% block content %}
from kirin import Dataset
dataset = Dataset(
root_dir="{{ catalog.root_dir }}",
name="{{ dataset_name }}"{% if catalog.aws_profile %},
aws_profile="{{ catalog.aws_profile }}"{% endif %}{% if catalog.gcs_token %},
gcs_token="{{ catalog.gcs_token }}"{% endif %}{% if catalog.gcs_project %},
gcs_project="{{ catalog.gcs_project }}"{% endif %}{% if catalog.azure_account_name %},
azure_account_name="{{ catalog.azure_account_name }}"{% endif %}{% if catalog.azure_account_key %},
azure_account_key="{{ catalog.azure_account_key }}"{% endif %}{% if catalog.azure_connection_string %},
azure_connection_string="{{ catalog.azure_connection_string }}"{% endif %}
)
{% if checkout_commit %}
# Checkout to specific commit
dataset.checkout("{{ checkout_commit }}")
{% elif current_commit %}
# Checkout to latest commit (HEAD)
dataset.checkout("{{ current_commit }}")
{% else %}
# Checkout to latest commit (HEAD)
dataset.checkout()
{% endif %}
# Access files as local paths
with dataset.local_files() as local_files:
file_path = local_files["{{ file_name }}"]
# Process file at file_path
# Note: Files are temporary and will be deleted when exiting this context
This file cannot be previewed as text. Download the file to view its contents.
File type: {{ content_type or "unknown" }}
Size: {{ "%.1f"|format(file_size / 1024) }} KB
{{ content }}