team-10/venv/Lib/site-packages/altair/examples/__init__.py
2025-08-02 02:00:33 +02:00

17 lines
558 B
Python

import os
def iter_examples():
"""Iterate over the examples in this directory.
Each item is a dict with the following keys:
- "name" : the unique name of the example
- "filename" : the full file path to the example
"""
example_dir = os.path.abspath(os.path.dirname(__file__))
for filename in os.listdir(example_dir):
name, ext = os.path.splitext(filename)
if name.startswith('_') or ext != '.py':
continue
yield {'name': name,
'filename': os.path.join(example_dir, filename)}