---------------------------------------------------------------------- This is the API documentation for the gdtest_nav_icons library. ---------------------------------------------------------------------- ## Classes Core classes Pipeline(name: str) An ordered sequence of analysis stages. Construct a pipeline from callables, then run data through each stage in sequence. Args: name: Human-readable pipeline identifier. Attributes: name: Pipeline name. stages: Ordered list of stage callables. Examples: >>> p = Pipeline("demo") >>> p.add_stage(lambda x: [v * 2 for v in x]) >>> p.run([1, 2, 3]) [2, 4, 6] BarChart(title: 'str' = 'Chart', width: 'int' = 40) A horizontal bar chart renderer. Args: title: Chart title displayed above the bars. width: Maximum bar width in characters. Attributes: title: Chart title. width: Bar width cap. data: Mapping of labels to values. LineChart(title: 'str' = 'Line', height: 'int' = 10) A simple line chart renderer. Args: title: Chart title. height: Vertical resolution in rows. Attributes: title: Chart title. height: Row count for rendering. series: Stored data series. ## Functions Public functions analyze(data: list[float]) -> dict[str, float] Run a basic statistical analysis on numeric data. Args: data: A list of numeric values to analyze. Returns: A dict with keys ``mean``, ``min``, ``max``, and ``count``. Examples: >>> analyze([1.0, 2.0, 3.0]) {'mean': 2.0, 'min': 1.0, 'max': 3.0, 'count': 3} summarize(data: list[float], label: str = 'result') -> str Produce a one-line summary string for a dataset. Args: data: Numeric values. label: Human-readable label for the summary. Returns: A formatted summary string. transform(data: list[float], *, scale: float = 1.0, offset: float = 0.0) -> list[float] Apply a linear transform to every element. Args: data: Input values. scale: Multiplicative factor. offset: Additive constant applied after scaling. Returns: A new list of transformed values. plot(x: 'list[float]', y: 'list[float]', *, kind: 'str' = 'scatter') -> 'str' Produce a quick text-based plot. Args: x: X-axis values. y: Y-axis values. kind: Plot type — ``"scatter"`` or ``"line"``. Returns: A string representation of the plot. Raises: ValueError: If ``x`` and ``y`` have different lengths. load_csv(path: 'str', *, delimiter: 'str' = ',', header: 'bool' = True) -> 'list[dict]' Load a CSV file into a list of row dicts. Args: path: File path to read. delimiter: Column separator character. header: Whether the first row contains column names. Returns: A list of dicts, one per data row. save_csv(data: 'list[dict]', path: 'str', *, delimiter: 'str' = ',') -> 'None' Save a list of row dicts to a CSV file. Args: data: Rows to write. path: Destination file path. delimiter: Column separator character. export_json(data: 'list[dict]', path: 'str', *, indent: 'int' = 2) -> 'None' Export data as a formatted JSON file. Args: data: Data to serialize. path: Destination file path. indent: Number of spaces for pretty-printing. ---------------------------------------------------------------------- This is the User Guide documentation for the package. ---------------------------------------------------------------------- # Getting Started Welcome to **NavIcons Demo** — a data-analysis toolkit that showcases Lucide navigation icons in every corner of the site. ## Installation ```bash pip install gdtest-nav-icons ``` ## Quick Example ```python from gdtest_nav_icons import analyze result = analyze([10, 20, 30, 40]) print(result) # {'mean': 25.0, 'min': 10, 'max': 40, 'count': 4} ``` ## What's Next? - Learn about [Configuration](configuration.qmd) options - Explore the [Visualization](visualization.qmd) guide - Dive into [Advanced Topics](advanced-topics.qmd) # Configuration Configure NavIcons Demo through Python or YAML. ## Pipeline Setup ```python from gdtest_nav_icons import Pipeline, transform pipe = Pipeline("preprocess") pipe.add_stage(lambda data: transform(data, scale=2.0)) pipe.add_stage(lambda data: transform(data, offset=-1.0)) result = pipe.run([1.0, 2.0, 3.0]) ``` ## CSV Options Use `load_csv` with custom delimiters: ```python from gdtest_nav_icons import load_csv data = load_csv("data.tsv", delimiter="\t") ``` # Visualization Create quick text-based charts for terminal output. ## Bar Charts ```python from gdtest_nav_icons import BarChart chart = BarChart("Sales by Region") chart.add("North", 120) chart.add("South", 85) chart.add("East", 200) chart.add("West", 150) print(chart.render()) ``` ## Line Charts ```python from gdtest_nav_icons import LineChart lc = LineChart("Temperature") lc.add_series([20, 22, 19, 25, 28, 26]) print(lc.render()) ``` ## Quick Plots ```python from gdtest_nav_icons import plot output = plot([1, 2, 3, 4], [10, 20, 15, 30], kind="line") print(output) ``` # Advanced Topics ## Custom Pipeline Stages Build complex analysis workflows by chaining stages: ```python from gdtest_nav_icons import Pipeline, analyze, summarize pipe = Pipeline("full-analysis") pipe.add_stage(lambda d: [x for x in d if x > 0]) # filter pipe.add_stage(lambda d: [x ** 0.5 for x in d]) # sqrt clean_data = pipe.run([-1, 4, 9, -2, 16, 25]) print(analyze(clean_data)) ``` ## Exporting Results ```python from gdtest_nav_icons import export_json results = [{"metric": "accuracy", "value": 0.95}] export_json(results, "output.json", indent=4) ``` ## Summary Reports ```python from gdtest_nav_icons import summarize print(summarize([88, 92, 79, 95, 100], label="Exam scores")) ```