# gilbertossoares/exportdataapipowerbirs architecture

> Architecture diagram of the GitHub repository gilbertossoares/exportdataapipowerbirs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gilbertossoares/exportdataapipowerbirs
- Repository: https://github.com/gilbertossoares/exportdataapipowerbirs

## Overview

##### Project type and purpose
- This is a small command-line utility written in Python to export data from a Power BI Report Server (PBIRS) via its REST API (API 2.0).
- Its primary function is to fetch metadata and data for Reports, DataSources, and Policies from PBIRS and write them out as CSV files.

##### File structure
- Top‐level files:
- queryApi.py – the main script
- requirements.txt – declares Python dependencies (e.g., requests, possibly pandas or csv)
- readme.MD – high-level description and configuration instructions
- sample/ – a folder containing sample CSV outputs (datasources.csv, policies.csv, reports.csv)
- No subdirectories for “frontend” or “backend” – it’s purely a single‐component utility.

##### README for additional insights
- The README confirms the script uses PBIRS API 2.0 endpoints to export three resource types.
- Configuration is limited to setting a base URL variable within the script.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Exporter Component"
        Exporter["Data Exporter"]:::python
        Config["Configuration & Documentation"]:::docs
        Deps["Dependencies Declaration"]:::docs
    end

    PowerBI["Power BI Report Server\n(REST API)"]:::api

    subgraph "File System Storage"
        SampleDir["sample/"]:::storage
        DS["datasources.csv"]:::storage
        PS["policies.csv"]:::storage
        RS["reports.csv"]:::storage
    end

    Exporter -->|"GET /api/v2.0/Reports"| PowerBI
    Exporter -->|"GET /api/v2.0/Datasources"| PowerBI
    Exporter -->|"GET /api/v2.0/Policies"| PowerBI
    PowerBI -->|"JSON responses"| Exporter
    Exporter -->|"Write CSV files"| SampleDir
    SampleDir --> DS
    SampleDir --> PS
    SampleDir --> RS
    Config -.-> Exporter
    Deps -.-> Exporter

    click Exporter "https://github.com/gilbertossoares/exportdataapipowerbirs/blob/main/queryApi.py"
    click Config "https://github.com/gilbertossoares/exportdataapipowerbirs/blob/main/readme.MD"
    click Deps "https://github.com/gilbertossoares/exportdataapipowerbirs/blob/main/requirements.txt"
    click SampleDir "https://github.com/gilbertossoares/exportdataapipowerbirs/tree/main/sample/"
    click DS "https://github.com/gilbertossoares/exportdataapipowerbirs/blob/main/sample/datasources.csv"
    click PS "https://github.com/gilbertossoares/exportdataapipowerbirs/blob/main/sample/policies.csv"
    click RS "https://github.com/gilbertossoares/exportdataapipowerbirs/blob/main/sample/reports.csv"

    classDef python fill:#CEF,stroke:#036,stroke-width:2px;
    classDef api fill:#CFC,stroke:#093,stroke-width:2px;
    classDef storage fill:#FFEB99,stroke:#B97A00,stroke-width:2px;
    classDef docs fill:#E0E0E0,stroke:#888,stroke-width:2px;
```
