pybi-ray 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. pybi_ray-0.1.0/LICENSE +25 -0
  2. pybi_ray-0.1.0/MANIFEST.in +2 -0
  3. pybi_ray-0.1.0/PKG-INFO +286 -0
  4. pybi_ray-0.1.0/README.md +168 -0
  5. pybi_ray-0.1.0/pyproject.toml +90 -0
  6. pybi_ray-0.1.0/setup.cfg +4 -0
  7. pybi_ray-0.1.0/src/pybi/__init__.py +36 -0
  8. pybi_ray-0.1.0/src/pybi/__main__.py +5 -0
  9. pybi_ray-0.1.0/src/pybi/cli.py +66 -0
  10. pybi_ray-0.1.0/src/pybi/connectors/__init__.py +10 -0
  11. pybi_ray-0.1.0/src/pybi/connectors/base.py +112 -0
  12. pybi_ray-0.1.0/src/pybi/connectors/catalog.py +645 -0
  13. pybi_ray-0.1.0/src/pybi/connectors/engines.py +1013 -0
  14. pybi_ray-0.1.0/src/pybi/connectors/files.py +226 -0
  15. pybi_ray-0.1.0/src/pybi/exporters.py +102 -0
  16. pybi_ray-0.1.0/src/pybi/project.py +285 -0
  17. pybi_ray-0.1.0/src/pybi/sample.py +196 -0
  18. pybi_ray-0.1.0/src/pybi/server.py +583 -0
  19. pybi_ray-0.1.0/src/pybi/static/app.css +357 -0
  20. pybi_ray-0.1.0/src/pybi/static/app.js +1370 -0
  21. pybi_ray-0.1.0/src/pybi/static/d3.LICENSE.txt +13 -0
  22. pybi_ray-0.1.0/src/pybi/static/d3.min.js +2 -0
  23. pybi_ray-0.1.0/src/pybi/static/engine.js +1040 -0
  24. pybi_ray-0.1.0/src/pybi/static/favicon.svg +1 -0
  25. pybi_ray-0.1.0/src/pybi/static/index.html +45 -0
  26. pybi_ray-0.1.0/src/pybi/static/runtime.js +218 -0
  27. pybi_ray-0.1.0/src/pybi/static/viewer.html +31 -0
  28. pybi_ray-0.1.0/src/pybi/static/viewer.js +59 -0
  29. pybi_ray-0.1.0/src/pybi/static/visuals.js +799 -0
  30. pybi_ray-0.1.0/src/pybi/transform.py +359 -0
  31. pybi_ray-0.1.0/src/pybi_ray.egg-info/PKG-INFO +286 -0
  32. pybi_ray-0.1.0/src/pybi_ray.egg-info/SOURCES.txt +36 -0
  33. pybi_ray-0.1.0/src/pybi_ray.egg-info/dependency_links.txt +1 -0
  34. pybi_ray-0.1.0/src/pybi_ray.egg-info/entry_points.txt +2 -0
  35. pybi_ray-0.1.0/src/pybi_ray.egg-info/requires.txt +105 -0
  36. pybi_ray-0.1.0/src/pybi_ray.egg-info/top_level.txt +1 -0
  37. pybi_ray-0.1.0/tests/test_connectors.py +297 -0
  38. pybi_ray-0.1.0/tests/test_pybi.py +78 -0
pybi_ray-0.1.0/LICENSE ADDED
@@ -0,0 +1,25 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Muhammad Rafay Shaikh
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---------------------------------------------------------------------------
24
+ This package bundles d3 (src/pybi/static/d3.min.js), ISC License,
25
+ Copyright 2010-2023 Mike Bostock. See src/pybi/static/d3.LICENSE.txt.
@@ -0,0 +1,2 @@
1
+ include README.md LICENSE
2
+ recursive-include src/pybi/static *
@@ -0,0 +1,286 @@
1
+ Metadata-Version: 2.4
2
+ Name: pybi-ray
3
+ Version: 0.1.0
4
+ Summary: Open-source business intelligence studio in Python - a Power BI style app: data modeling, DAX-style measures, interactive dashboards, sharing and exports.
5
+ Author: Muhammad Rafay Shaikh
6
+ Maintainer: Muhammad Rafay Shaikh
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/rafay183/pybi
9
+ Project-URL: Source, https://github.com/rafay183/pybi
10
+ Project-URL: Issues, https://github.com/rafay183/pybi/issues
11
+ Project-URL: Changelog, https://github.com/rafay183/pybi/blob/main/CHANGELOG.md
12
+ Project-URL: Documentation, https://github.com/rafay183/pybi#readme
13
+ Keywords: business intelligence,bi,dashboard,power bi,dax,analytics,data visualization,reporting,pandas
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Environment :: Web Environment
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: Financial and Insurance Industry
18
+ Classifier: Intended Audience :: Science/Research
19
+ Classifier: License :: OSI Approved :: MIT License
20
+ Classifier: Operating System :: OS Independent
21
+ Classifier: Programming Language :: Python :: 3
22
+ Classifier: Programming Language :: JavaScript
23
+ Classifier: Topic :: Office/Business
24
+ Classifier: Topic :: Scientific/Engineering :: Visualization
25
+ Classifier: Topic :: Database :: Front-Ends
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: pandas>=1.5
30
+ Requires-Dist: flask>=2.2
31
+ Requires-Dist: openpyxl>=3.0
32
+ Requires-Dist: python-pptx>=0.6.21
33
+ Requires-Dist: Pillow>=9.0
34
+ Requires-Dist: requests>=2.25
35
+ Requires-Dist: lxml>=4.9
36
+ Requires-Dist: pyyaml>=6.0
37
+ Provides-Extra: parquet
38
+ Requires-Dist: pyarrow>=10; extra == "parquet"
39
+ Provides-Extra: files
40
+ Requires-Dist: pyarrow>=10; extra == "files"
41
+ Requires-Dist: xlrd; extra == "files"
42
+ Requires-Dist: pyxlsb; extra == "files"
43
+ Requires-Dist: odfpy; extra == "files"
44
+ Requires-Dist: fastavro; extra == "files"
45
+ Requires-Dist: pyreadstat; extra == "files"
46
+ Requires-Dist: tables; extra == "files"
47
+ Requires-Dist: pyyaml; extra == "files"
48
+ Requires-Dist: pdfplumber; extra == "files"
49
+ Provides-Extra: sql
50
+ Requires-Dist: sqlalchemy>=2.0; extra == "sql"
51
+ Provides-Extra: postgres
52
+ Requires-Dist: sqlalchemy>=2.0; extra == "postgres"
53
+ Requires-Dist: psycopg2-binary; extra == "postgres"
54
+ Provides-Extra: mysql
55
+ Requires-Dist: sqlalchemy>=2.0; extra == "mysql"
56
+ Requires-Dist: pymysql; extra == "mysql"
57
+ Provides-Extra: sqlserver
58
+ Requires-Dist: sqlalchemy>=2.0; extra == "sqlserver"
59
+ Requires-Dist: pymssql; extra == "sqlserver"
60
+ Provides-Extra: oracle
61
+ Requires-Dist: sqlalchemy>=2.0; extra == "oracle"
62
+ Requires-Dist: oracledb; extra == "oracle"
63
+ Provides-Extra: snowflake
64
+ Requires-Dist: snowflake-sqlalchemy; extra == "snowflake"
65
+ Provides-Extra: bigquery
66
+ Requires-Dist: sqlalchemy-bigquery; extra == "bigquery"
67
+ Provides-Extra: databricks
68
+ Requires-Dist: databricks-sqlalchemy; extra == "databricks"
69
+ Provides-Extra: duckdb
70
+ Requires-Dist: duckdb; extra == "duckdb"
71
+ Provides-Extra: odbc
72
+ Requires-Dist: pyodbc; extra == "odbc"
73
+ Provides-Extra: nosql
74
+ Requires-Dist: pymongo; extra == "nosql"
75
+ Requires-Dist: redis; extra == "nosql"
76
+ Requires-Dist: boto3; extra == "nosql"
77
+ Provides-Extra: cloud
78
+ Requires-Dist: fsspec; extra == "cloud"
79
+ Requires-Dist: s3fs; extra == "cloud"
80
+ Requires-Dist: gcsfs; extra == "cloud"
81
+ Requires-Dist: adlfs; extra == "cloud"
82
+ Requires-Dist: paramiko; extra == "cloud"
83
+ Provides-Extra: finance
84
+ Requires-Dist: yfinance; extra == "finance"
85
+ Provides-Extra: all
86
+ Requires-Dist: pyarrow>=10; extra == "all"
87
+ Requires-Dist: xlrd; extra == "all"
88
+ Requires-Dist: pyxlsb; extra == "all"
89
+ Requires-Dist: odfpy; extra == "all"
90
+ Requires-Dist: fastavro; extra == "all"
91
+ Requires-Dist: pyreadstat; extra == "all"
92
+ Requires-Dist: pyyaml; extra == "all"
93
+ Requires-Dist: pdfplumber; extra == "all"
94
+ Requires-Dist: sqlalchemy>=2.0; extra == "all"
95
+ Requires-Dist: psycopg2-binary; extra == "all"
96
+ Requires-Dist: pymysql; extra == "all"
97
+ Requires-Dist: pymssql; extra == "all"
98
+ Requires-Dist: oracledb; extra == "all"
99
+ Requires-Dist: duckdb; extra == "all"
100
+ Requires-Dist: pymongo; extra == "all"
101
+ Requires-Dist: redis; extra == "all"
102
+ Requires-Dist: boto3; extra == "all"
103
+ Requires-Dist: fsspec; extra == "all"
104
+ Requires-Dist: s3fs; extra == "all"
105
+ Requires-Dist: gcsfs; extra == "all"
106
+ Requires-Dist: adlfs; extra == "all"
107
+ Requires-Dist: paramiko; extra == "all"
108
+ Requires-Dist: yfinance; extra == "all"
109
+ Provides-Extra: dev
110
+ Requires-Dist: pytest>=7; extra == "dev"
111
+ Requires-Dist: ruff>=0.6; extra == "dev"
112
+ Requires-Dist: build; extra == "dev"
113
+ Requires-Dist: twine; extra == "dev"
114
+ Requires-Dist: reportlab; extra == "dev"
115
+ Requires-Dist: pdfplumber; extra == "dev"
116
+ Requires-Dist: odfpy; extra == "dev"
117
+ Dynamic: license-file
118
+
119
+ # PyBI — Business Intelligence in Python
120
+
121
+ [![PyPI](https://img.shields.io/pypi/v/pybi-ray.svg)](https://pypi.org/project/pybi-ray/) [![CI](https://github.com/rafay183/pybi/actions/workflows/ci.yml/badge.svg)](https://github.com/rafay183/pybi/actions/workflows/ci.yml) [![Python](https://img.shields.io/pypi/pyversions/pybi-ray.svg)](https://pypi.org/project/pybi-ray/) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
122
+
123
+ > Install name: **`pybi-ray`** · command: **`pybi`** · import: **`import pybi`**
124
+
125
+ **PyBI** is an open-source, Power BI–style business intelligence studio that you install with `pip` and run on your own computer. Connect data, shape it with a visual query editor, build a star-schema model, write DAX-style measures, design interactive dashboards, share a live link on your network, and export to PNG, PowerPoint, PDF or a self-contained interactive HTML file.
126
+
127
+ ```bash
128
+ pip install pybi-ray
129
+ pybi run # opens PyBI Studio at http://127.0.0.1:8050
130
+ pybi demo # opens with a ready-made 3-page sales dashboard
131
+ ```
132
+
133
+ Created by **Muhammad Rafay Shaikh, from Pakistan**.
134
+
135
+ ![PyBI Studio with the demo dashboard](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/dashboard.png)
136
+
137
+ <details><summary><b>More screenshots</b></summary>
138
+
139
+ | Get data (214 connectors) | Navigator & preview |
140
+ |---|---|
141
+ | ![Get data](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/get-data.png) | ![Navigator](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/navigator.png) |
142
+ | **Query editor** | **Model view** |
143
+ | ![Query editor](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/query-editor.png) | ![Model view](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/model-view.png) |
144
+
145
+ </details>
146
+
147
+ ---
148
+
149
+ ## Features
150
+
151
+ | Area | What you get |
152
+ |---|---|
153
+ | **Get data** | **214 connectors**: files (Excel, CSV, JSON, XML, Parquet, PDF tables, SAS/SPSS/Stata…), 50 databases (SQL Server, PostgreSQL, MySQL, Oracle, Snowflake, BigQuery, Databricks…), NoSQL, cloud storage (S3, Azure, GCS, SFTP), 70+ SaaS apps (Salesforce, HubSpot, Stripe, Shopify, Jira, Notion…), public data (World Bank, FRED, Eurostat…), REST/GraphQL/OData/Python — with preview, navigator and refresh |
154
+ | **Query editor** (Power Query style) | Applied steps with live preview and column quality bars: choose/remove columns, promote headers, change type, filter rows, replace values, fill up/down, remove duplicates/blanks, keep top rows, custom column, conditional column, split column, text formatting, date parts, round, group by, unpivot, merge queries, append queries, plus a JSON advanced editor |
155
+ | **Model view** | Drag-and-drop relationships, many-to-one with single or **both** cross-filter direction, active/inactive, autodetect, one-click date table |
156
+ | **DAX-style formulas** | Measures and calculated columns with `VAR … RETURN`, `CALCULATE`, `FILTER`, `ALL`, `ALLEXCEPT`, `ALLSELECTED`, `REMOVEFILTERS`, `KEEPFILTERS`, `VALUES`, `SELECTEDVALUE`, `RELATED`, `RELATEDTABLE`, `LOOKUPVALUE`, iterators (`SUMX`, `AVERAGEX`, `RANKX`, `TOPN`, `CONCATENATEX`), time intelligence (`TOTALYTD`, `DATESYTD`, `SAMEPERIODLASTYEAR`, `DATEADD`, `PARALLELPERIOD`, `PREVIOUSMONTH`, `DATESBETWEEN`, …), logic, math, text and date functions |
157
+ | **Visuals (25)** | Clustered / stacked / 100% column and bar, line, area, stacked area, line & column combo, waterfall, ribbon, scatter / bubble, pie, donut, treemap, funnel, gauge, card, multi-row card, KPI, table (with data bars), matrix (expand/collapse, subtotals), slicers (list, dropdown, tiles, range), text box, smart narrative |
158
+ | **Interactivity** | Cross-filtering by clicking any chart (Ctrl+click for multi-select), slicers (optionally synced across pages), visual / page / report filters (basic, advanced, range), tooltips, focus mode, export data behind a visual |
159
+ | **Report design** | Drag, resize, snap & alignment guides, pages, page sizes, 6 themes (including dark), per-visual formatting, undo/redo, copy/paste, keyboard nudging |
160
+ | **Smart features** | **Ask your data** (type "top 5 products by profit as bar"), **Auto dashboard** (builds a full insight page from your model), **Smart narrative** (auto-written summary) |
161
+ | **Share** | Live, read-only network link (`/view`) for anyone on your Wi-Fi/LAN that refreshes as you edit; editing stays on your machine |
162
+ | **Export** | PNG (page or all pages), PowerPoint `.pptx`, PDF, **interactive HTML** (one offline file with data, slicers and cross-filtering), `.pybi` project file, CSV/Excel of any table |
163
+
164
+ ## Connectors (214)
165
+
166
+ Open **Get data** to search the catalog. Each connector shows a form, a live preview, and (for databases, workbooks, folders, buckets) a **Navigator** to pick tables. Loaded sources remember how they were connected, so **Refresh** re-pulls fresh data while keeping your query steps. Passwords and tokens are stored only on your computer in `~/.pybi/credentials.json` — never inside `.pybi` files.
167
+
168
+ Connectors marked † need an extra driver (`pip install …` — PyBI tells you the exact command).
169
+
170
+ **File (23)** — Text / CSV, Tab-separated (TSV), Fixed-width text, Excel workbook, Excel 97-2003 (.xls) †, Excel binary (.xlsb) †, OpenDocument spreadsheet †, JSON, JSON Lines / NDJSON, XML, HTML file, Parquet †, Feather / Arrow IPC †, ORC †, Avro †, SAS (.sas7bdat / .xpt), SPSS (.sav) †, Stata (.dta), HDF5 †, YAML, PDF tables, ZIP archive, Folder (combine files)
171
+
172
+ **Database (50)** — SQLite database, PostgreSQL †, TimescaleDB †, Greenplum †, YugabyteDB †, Supabase (Postgres) †, Neon (serverless Postgres) †, Google Cloud SQL for PostgreSQL †, Amazon Aurora / RDS PostgreSQL †, Azure Database for PostgreSQL †, Google AlloyDB †, MySQL †, MariaDB †, PlanetScale †, TiDB †, Google Cloud SQL for MySQL †, Amazon Aurora / RDS MySQL †, Azure Database for MySQL †, Microsoft SQL Server †, Azure SQL Database †, Azure Synapse Analytics (SQL) †, Microsoft Fabric Warehouse (SQL endpoint) †, Oracle Database †, IBM Db2 †, SAP HANA †, Teradata †, Vertica †, CockroachDB †, SingleStore †, Exasol †, Firebird †, ClickHouse †, Trino †, Presto †, Apache Hive †, Spark SQL (Thrift server) †, Apache Impala †, Apache Druid †, Apache Pinot †, Dremio †, Snowflake †, Amazon Redshift †, Google BigQuery †, Amazon Athena †, Databricks SQL †, DuckDB †, MotherDuck †, Microsoft Access †, ODBC (any driver) †, Other SQL database (SQLAlchemy URL) †
173
+
174
+ **Web & online files (10)** — Web page tables, Wikipedia tables, File from URL, Google Sheets (shared link), Google Drive file, OneDrive / SharePoint file link, Dropbox file, GitHub file, Hugging Face dataset file, RSS feed
175
+
176
+ **Public data (20)** — Our World in Data, World Bank indicators, FRED economic data, CoinGecko crypto markets, CoinGecko price history, Open-Meteo weather history, REST Countries, Exchange rates (ECB), Alpha Vantage stocks, Yahoo Finance †, US Census Bureau, Socrata open data (SODA), CKAN open data (data.gov…), Eurostat, OECD data (SDMX), IMF DataMapper, USGS earthquakes, NASA POWER climate, Kaggle dataset †, Hacker News top stories
177
+
178
+ **NoSQL & search (16)** — MongoDB †, Amazon DocumentDB †, Elasticsearch, OpenSearch, Apache Solr, Apache CouchDB, InfluxDB 2.x / Cloud, Prometheus, Redis †, Apache Cassandra / ScyllaDB †, Amazon DynamoDB †, Google Firestore †, Firebase Realtime Database, Azure Cosmos DB (NoSQL) †, Neo4j (Cypher), Supabase (REST API)
179
+
180
+ **Cloud storage (13)** — Amazon S3 †, MinIO †, Cloudflare R2 †, Wasabi †, DigitalOcean Spaces †, Backblaze B2 (S3 API) †, Google Cloud Storage †, Azure Blob Storage †, Azure Data Lake Storage Gen2 †, SFTP †, FTP / FTPS, WebDAV / Nextcloud †, Hadoop HDFS †
181
+
182
+ **Generic & developer (4)** — REST API (any JSON / CSV API), GraphQL API, OData feed, Python script
183
+
184
+ **Developer tools (8)** — GitHub, GitLab, Bitbucket Cloud, Azure DevOps, Linear, Sentry, Datadog metrics, Grafana (dashboards list)
185
+
186
+ **Project & productivity (12)** — Jira Cloud, Confluence Cloud, Trello, Asana, ClickUp, monday.com, Notion database, Airtable, Smartsheet, Coda, Baserow, Slack
187
+
188
+ **Support & ITSM (9)** — PagerDuty, Zendesk Support, Freshdesk, Freshservice, Intercom, ServiceNow, Help Scout, Okta users, Twilio messages
189
+
190
+ **CRM & sales (9)** — Salesforce (SOQL), HubSpot, Pipedrive, Zoho CRM, Freshsales, Close CRM, Copper CRM, Dynamics 365 / Dataverse, ActiveCampaign
191
+
192
+ **Finance & payments (8)** — Stripe, PayPal transactions, Square, Xero, QuickBooks Online, Chargebee, Paddle Billing, Lemon Squeezy
193
+
194
+ **Marketing & analytics (12)** — Google Analytics 4, YouTube channel videos, Meta (Facebook) Ads insights, Mailchimp, Klaviyo, SendGrid stats, Brevo (Sendinblue), Typeform responses, SurveyMonkey, Jotform, Eventbrite, Calendly
195
+
196
+ **E-commerce & CMS (8)** — Webflow CMS, Shopify, WooCommerce, BigCommerce, WordPress, Contentful, Strapi, Gumroad sales
197
+
198
+ **HR & time tracking (5)** — BambooHR, Greenhouse, Harvest, Toggl Track, Clockify
199
+
200
+ **Microsoft & Google (7)** — Microsoft Graph (any endpoint), SharePoint Online list, Dynamics 365 Business Central, Microsoft Planner tasks, Google Sheets (API), Google Calendar, Google Search Console
201
+
202
+
203
+ Missing something? Four universal connectors reach almost anything: **REST API** (auth + 6 pagination styles + nested JSON flattening), **GraphQL**, **ODBC / SQLAlchemy URL**, and **Python script**.
204
+
205
+ > SaaS connectors use the vendor's public REST API with a token you provide (PyBI does not run OAuth sign-in flows yet). They were built from each vendor's API documentation and tested against a mock API, not against live accounts — if a vendor changes an endpoint, override it under *Advanced options* (endpoint, records path, query parameters) and please open an issue.
206
+
207
+ Install drivers in bulk with extras, e.g. `pip install "pybi-ray[postgres,mysql,cloud]"` or `pip install "pybi-ray[all]"`.
208
+
209
+ ## Usage
210
+
211
+ ```bash
212
+ pybi run # start the studio (network view link enabled)
213
+ pybi run sales.xlsx # start with a data file loaded
214
+ pybi run my_report.pybi # open a saved project
215
+ pybi run --private # only this computer can connect
216
+ pybi run --port 9000 --no-browser
217
+ pybi demo # demo dataset + dashboard
218
+ pybi export my_report.pybi -o dashboard.html # headless export to interactive HTML
219
+ python -m pybi run # same as `pybi run`
220
+ ```
221
+
222
+ From Python or Jupyter:
223
+
224
+ ```python
225
+ import pandas as pd
226
+ import pybi
227
+
228
+ sales = pd.read_csv("sales.csv")
229
+ products = pd.read_excel("products.xlsx")
230
+ pybi.run(Sales=sales, Products=products) # opens the studio with these tables
231
+ ```
232
+
233
+ ### Example measures
234
+
235
+ ```text
236
+ Total Revenue = SUM(Sales[Revenue])
237
+ Profit Margin = DIVIDE([Profit], [Total Revenue])
238
+ Revenue LY = CALCULATE([Total Revenue], SAMEPERIODLASTYEAR('Calendar'[Date]))
239
+ Revenue YTD = TOTALYTD([Total Revenue], 'Calendar'[Date])
240
+ % of Total = DIVIDE([Total Revenue], CALCULATE([Total Revenue], ALLSELECTED(Sales)))
241
+ Product Rank = RANKX(ALL(Products), [Total Revenue])
242
+ Big Orders = CALCULATE([Orders], Sales[Quantity] >= 3)
243
+ ```
244
+
245
+ Calculated column:
246
+
247
+ ```text
248
+ Sales[Cost] = Sales[Quantity] * RELATED(Products[UnitCost])
249
+ ```
250
+
251
+ ## How it works
252
+
253
+ * **Python** (Flask + pandas) serves the studio, loads and transforms data (query steps are replayable and stored in the project), saves `.pybi` projects (a zip of raw data, steps and the report definition), and builds PPTX/PDF/HTML exports.
254
+ * The **analytics engine** (filter context, relationships, the DAX-style language) and the **d3-based visuals** run in the browser, so the studio, the network view and exported HTML files behave identically.
255
+ * An autosave of the current project is kept in `~/.pybi/autosave.pybi`.
256
+
257
+ ## Security notes
258
+
259
+ * The studio binds to all network interfaces so the `/view` link works on your LAN. Requests from **other computers can only view** (`/view`, read-only data); all editing APIs are restricted to the local machine. Use `--private` to disable network access completely.
260
+ * The custom-column step in the query editor evaluates pandas expressions. Only open `.pybi` files from people you trust.
261
+
262
+ ## Limitations (v0.1)
263
+
264
+ PyBI is not a Microsoft product and does not open `.pbix` files. Data is held in memory, which works well up to a few million rows depending on your machine. Not every DAX function is implemented; unsupported functions show a clear error in the formula editor.
265
+
266
+ ## Contributing
267
+
268
+ PyBI is built in the open and contributions are very welcome — connectors tested with real accounts, visuals, DAX functions, docs and translations.
269
+
270
+ * Read **[CONTRIBUTING.md](CONTRIBUTING.md)** for setup, project structure and how to add connectors/visuals.
271
+ * Look for issues labelled **good first issue**.
272
+ * Questions and ideas: **[Discussions](https://github.com/rafay183/pybi/discussions)**.
273
+
274
+ ```bash
275
+ git clone https://github.com/rafay183/pybi
276
+ cd pybi
277
+ pip install -e ".[dev]"
278
+ pytest -q
279
+ pybi demo
280
+ ```
281
+
282
+ Maintainers: release steps are in [docs/PUBLISHING.md](docs/PUBLISHING.md). See also [CHANGELOG.md](CHANGELOG.md) and [SECURITY.md](SECURITY.md).
283
+
284
+ ## License
285
+
286
+ MIT © Muhammad Rafay Shaikh. Bundles [d3](https://d3js.org) (ISC license, © Mike Bostock).
@@ -0,0 +1,168 @@
1
+ # PyBI — Business Intelligence in Python
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/pybi-ray.svg)](https://pypi.org/project/pybi-ray/) [![CI](https://github.com/rafay183/pybi/actions/workflows/ci.yml/badge.svg)](https://github.com/rafay183/pybi/actions/workflows/ci.yml) [![Python](https://img.shields.io/pypi/pyversions/pybi-ray.svg)](https://pypi.org/project/pybi-ray/) [![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE) [![PRs welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
4
+
5
+ > Install name: **`pybi-ray`** · command: **`pybi`** · import: **`import pybi`**
6
+
7
+ **PyBI** is an open-source, Power BI–style business intelligence studio that you install with `pip` and run on your own computer. Connect data, shape it with a visual query editor, build a star-schema model, write DAX-style measures, design interactive dashboards, share a live link on your network, and export to PNG, PowerPoint, PDF or a self-contained interactive HTML file.
8
+
9
+ ```bash
10
+ pip install pybi-ray
11
+ pybi run # opens PyBI Studio at http://127.0.0.1:8050
12
+ pybi demo # opens with a ready-made 3-page sales dashboard
13
+ ```
14
+
15
+ Created by **Muhammad Rafay Shaikh, from Pakistan**.
16
+
17
+ ![PyBI Studio with the demo dashboard](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/dashboard.png)
18
+
19
+ <details><summary><b>More screenshots</b></summary>
20
+
21
+ | Get data (214 connectors) | Navigator & preview |
22
+ |---|---|
23
+ | ![Get data](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/get-data.png) | ![Navigator](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/navigator.png) |
24
+ | **Query editor** | **Model view** |
25
+ | ![Query editor](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/query-editor.png) | ![Model view](https://raw.githubusercontent.com/rafay183/pybi/main/docs/images/model-view.png) |
26
+
27
+ </details>
28
+
29
+ ---
30
+
31
+ ## Features
32
+
33
+ | Area | What you get |
34
+ |---|---|
35
+ | **Get data** | **214 connectors**: files (Excel, CSV, JSON, XML, Parquet, PDF tables, SAS/SPSS/Stata…), 50 databases (SQL Server, PostgreSQL, MySQL, Oracle, Snowflake, BigQuery, Databricks…), NoSQL, cloud storage (S3, Azure, GCS, SFTP), 70+ SaaS apps (Salesforce, HubSpot, Stripe, Shopify, Jira, Notion…), public data (World Bank, FRED, Eurostat…), REST/GraphQL/OData/Python — with preview, navigator and refresh |
36
+ | **Query editor** (Power Query style) | Applied steps with live preview and column quality bars: choose/remove columns, promote headers, change type, filter rows, replace values, fill up/down, remove duplicates/blanks, keep top rows, custom column, conditional column, split column, text formatting, date parts, round, group by, unpivot, merge queries, append queries, plus a JSON advanced editor |
37
+ | **Model view** | Drag-and-drop relationships, many-to-one with single or **both** cross-filter direction, active/inactive, autodetect, one-click date table |
38
+ | **DAX-style formulas** | Measures and calculated columns with `VAR … RETURN`, `CALCULATE`, `FILTER`, `ALL`, `ALLEXCEPT`, `ALLSELECTED`, `REMOVEFILTERS`, `KEEPFILTERS`, `VALUES`, `SELECTEDVALUE`, `RELATED`, `RELATEDTABLE`, `LOOKUPVALUE`, iterators (`SUMX`, `AVERAGEX`, `RANKX`, `TOPN`, `CONCATENATEX`), time intelligence (`TOTALYTD`, `DATESYTD`, `SAMEPERIODLASTYEAR`, `DATEADD`, `PARALLELPERIOD`, `PREVIOUSMONTH`, `DATESBETWEEN`, …), logic, math, text and date functions |
39
+ | **Visuals (25)** | Clustered / stacked / 100% column and bar, line, area, stacked area, line & column combo, waterfall, ribbon, scatter / bubble, pie, donut, treemap, funnel, gauge, card, multi-row card, KPI, table (with data bars), matrix (expand/collapse, subtotals), slicers (list, dropdown, tiles, range), text box, smart narrative |
40
+ | **Interactivity** | Cross-filtering by clicking any chart (Ctrl+click for multi-select), slicers (optionally synced across pages), visual / page / report filters (basic, advanced, range), tooltips, focus mode, export data behind a visual |
41
+ | **Report design** | Drag, resize, snap & alignment guides, pages, page sizes, 6 themes (including dark), per-visual formatting, undo/redo, copy/paste, keyboard nudging |
42
+ | **Smart features** | **Ask your data** (type "top 5 products by profit as bar"), **Auto dashboard** (builds a full insight page from your model), **Smart narrative** (auto-written summary) |
43
+ | **Share** | Live, read-only network link (`/view`) for anyone on your Wi-Fi/LAN that refreshes as you edit; editing stays on your machine |
44
+ | **Export** | PNG (page or all pages), PowerPoint `.pptx`, PDF, **interactive HTML** (one offline file with data, slicers and cross-filtering), `.pybi` project file, CSV/Excel of any table |
45
+
46
+ ## Connectors (214)
47
+
48
+ Open **Get data** to search the catalog. Each connector shows a form, a live preview, and (for databases, workbooks, folders, buckets) a **Navigator** to pick tables. Loaded sources remember how they were connected, so **Refresh** re-pulls fresh data while keeping your query steps. Passwords and tokens are stored only on your computer in `~/.pybi/credentials.json` — never inside `.pybi` files.
49
+
50
+ Connectors marked † need an extra driver (`pip install …` — PyBI tells you the exact command).
51
+
52
+ **File (23)** — Text / CSV, Tab-separated (TSV), Fixed-width text, Excel workbook, Excel 97-2003 (.xls) †, Excel binary (.xlsb) †, OpenDocument spreadsheet †, JSON, JSON Lines / NDJSON, XML, HTML file, Parquet †, Feather / Arrow IPC †, ORC †, Avro †, SAS (.sas7bdat / .xpt), SPSS (.sav) †, Stata (.dta), HDF5 †, YAML, PDF tables, ZIP archive, Folder (combine files)
53
+
54
+ **Database (50)** — SQLite database, PostgreSQL †, TimescaleDB †, Greenplum †, YugabyteDB †, Supabase (Postgres) †, Neon (serverless Postgres) †, Google Cloud SQL for PostgreSQL †, Amazon Aurora / RDS PostgreSQL †, Azure Database for PostgreSQL †, Google AlloyDB †, MySQL †, MariaDB †, PlanetScale †, TiDB †, Google Cloud SQL for MySQL †, Amazon Aurora / RDS MySQL †, Azure Database for MySQL †, Microsoft SQL Server †, Azure SQL Database †, Azure Synapse Analytics (SQL) †, Microsoft Fabric Warehouse (SQL endpoint) †, Oracle Database †, IBM Db2 †, SAP HANA †, Teradata †, Vertica †, CockroachDB †, SingleStore †, Exasol †, Firebird †, ClickHouse †, Trino †, Presto †, Apache Hive †, Spark SQL (Thrift server) †, Apache Impala †, Apache Druid †, Apache Pinot †, Dremio †, Snowflake †, Amazon Redshift †, Google BigQuery †, Amazon Athena †, Databricks SQL †, DuckDB †, MotherDuck †, Microsoft Access †, ODBC (any driver) †, Other SQL database (SQLAlchemy URL) †
55
+
56
+ **Web & online files (10)** — Web page tables, Wikipedia tables, File from URL, Google Sheets (shared link), Google Drive file, OneDrive / SharePoint file link, Dropbox file, GitHub file, Hugging Face dataset file, RSS feed
57
+
58
+ **Public data (20)** — Our World in Data, World Bank indicators, FRED economic data, CoinGecko crypto markets, CoinGecko price history, Open-Meteo weather history, REST Countries, Exchange rates (ECB), Alpha Vantage stocks, Yahoo Finance †, US Census Bureau, Socrata open data (SODA), CKAN open data (data.gov…), Eurostat, OECD data (SDMX), IMF DataMapper, USGS earthquakes, NASA POWER climate, Kaggle dataset †, Hacker News top stories
59
+
60
+ **NoSQL & search (16)** — MongoDB †, Amazon DocumentDB †, Elasticsearch, OpenSearch, Apache Solr, Apache CouchDB, InfluxDB 2.x / Cloud, Prometheus, Redis †, Apache Cassandra / ScyllaDB †, Amazon DynamoDB †, Google Firestore †, Firebase Realtime Database, Azure Cosmos DB (NoSQL) †, Neo4j (Cypher), Supabase (REST API)
61
+
62
+ **Cloud storage (13)** — Amazon S3 †, MinIO †, Cloudflare R2 †, Wasabi †, DigitalOcean Spaces †, Backblaze B2 (S3 API) †, Google Cloud Storage †, Azure Blob Storage †, Azure Data Lake Storage Gen2 †, SFTP †, FTP / FTPS, WebDAV / Nextcloud †, Hadoop HDFS †
63
+
64
+ **Generic & developer (4)** — REST API (any JSON / CSV API), GraphQL API, OData feed, Python script
65
+
66
+ **Developer tools (8)** — GitHub, GitLab, Bitbucket Cloud, Azure DevOps, Linear, Sentry, Datadog metrics, Grafana (dashboards list)
67
+
68
+ **Project & productivity (12)** — Jira Cloud, Confluence Cloud, Trello, Asana, ClickUp, monday.com, Notion database, Airtable, Smartsheet, Coda, Baserow, Slack
69
+
70
+ **Support & ITSM (9)** — PagerDuty, Zendesk Support, Freshdesk, Freshservice, Intercom, ServiceNow, Help Scout, Okta users, Twilio messages
71
+
72
+ **CRM & sales (9)** — Salesforce (SOQL), HubSpot, Pipedrive, Zoho CRM, Freshsales, Close CRM, Copper CRM, Dynamics 365 / Dataverse, ActiveCampaign
73
+
74
+ **Finance & payments (8)** — Stripe, PayPal transactions, Square, Xero, QuickBooks Online, Chargebee, Paddle Billing, Lemon Squeezy
75
+
76
+ **Marketing & analytics (12)** — Google Analytics 4, YouTube channel videos, Meta (Facebook) Ads insights, Mailchimp, Klaviyo, SendGrid stats, Brevo (Sendinblue), Typeform responses, SurveyMonkey, Jotform, Eventbrite, Calendly
77
+
78
+ **E-commerce & CMS (8)** — Webflow CMS, Shopify, WooCommerce, BigCommerce, WordPress, Contentful, Strapi, Gumroad sales
79
+
80
+ **HR & time tracking (5)** — BambooHR, Greenhouse, Harvest, Toggl Track, Clockify
81
+
82
+ **Microsoft & Google (7)** — Microsoft Graph (any endpoint), SharePoint Online list, Dynamics 365 Business Central, Microsoft Planner tasks, Google Sheets (API), Google Calendar, Google Search Console
83
+
84
+
85
+ Missing something? Four universal connectors reach almost anything: **REST API** (auth + 6 pagination styles + nested JSON flattening), **GraphQL**, **ODBC / SQLAlchemy URL**, and **Python script**.
86
+
87
+ > SaaS connectors use the vendor's public REST API with a token you provide (PyBI does not run OAuth sign-in flows yet). They were built from each vendor's API documentation and tested against a mock API, not against live accounts — if a vendor changes an endpoint, override it under *Advanced options* (endpoint, records path, query parameters) and please open an issue.
88
+
89
+ Install drivers in bulk with extras, e.g. `pip install "pybi-ray[postgres,mysql,cloud]"` or `pip install "pybi-ray[all]"`.
90
+
91
+ ## Usage
92
+
93
+ ```bash
94
+ pybi run # start the studio (network view link enabled)
95
+ pybi run sales.xlsx # start with a data file loaded
96
+ pybi run my_report.pybi # open a saved project
97
+ pybi run --private # only this computer can connect
98
+ pybi run --port 9000 --no-browser
99
+ pybi demo # demo dataset + dashboard
100
+ pybi export my_report.pybi -o dashboard.html # headless export to interactive HTML
101
+ python -m pybi run # same as `pybi run`
102
+ ```
103
+
104
+ From Python or Jupyter:
105
+
106
+ ```python
107
+ import pandas as pd
108
+ import pybi
109
+
110
+ sales = pd.read_csv("sales.csv")
111
+ products = pd.read_excel("products.xlsx")
112
+ pybi.run(Sales=sales, Products=products) # opens the studio with these tables
113
+ ```
114
+
115
+ ### Example measures
116
+
117
+ ```text
118
+ Total Revenue = SUM(Sales[Revenue])
119
+ Profit Margin = DIVIDE([Profit], [Total Revenue])
120
+ Revenue LY = CALCULATE([Total Revenue], SAMEPERIODLASTYEAR('Calendar'[Date]))
121
+ Revenue YTD = TOTALYTD([Total Revenue], 'Calendar'[Date])
122
+ % of Total = DIVIDE([Total Revenue], CALCULATE([Total Revenue], ALLSELECTED(Sales)))
123
+ Product Rank = RANKX(ALL(Products), [Total Revenue])
124
+ Big Orders = CALCULATE([Orders], Sales[Quantity] >= 3)
125
+ ```
126
+
127
+ Calculated column:
128
+
129
+ ```text
130
+ Sales[Cost] = Sales[Quantity] * RELATED(Products[UnitCost])
131
+ ```
132
+
133
+ ## How it works
134
+
135
+ * **Python** (Flask + pandas) serves the studio, loads and transforms data (query steps are replayable and stored in the project), saves `.pybi` projects (a zip of raw data, steps and the report definition), and builds PPTX/PDF/HTML exports.
136
+ * The **analytics engine** (filter context, relationships, the DAX-style language) and the **d3-based visuals** run in the browser, so the studio, the network view and exported HTML files behave identically.
137
+ * An autosave of the current project is kept in `~/.pybi/autosave.pybi`.
138
+
139
+ ## Security notes
140
+
141
+ * The studio binds to all network interfaces so the `/view` link works on your LAN. Requests from **other computers can only view** (`/view`, read-only data); all editing APIs are restricted to the local machine. Use `--private` to disable network access completely.
142
+ * The custom-column step in the query editor evaluates pandas expressions. Only open `.pybi` files from people you trust.
143
+
144
+ ## Limitations (v0.1)
145
+
146
+ PyBI is not a Microsoft product and does not open `.pbix` files. Data is held in memory, which works well up to a few million rows depending on your machine. Not every DAX function is implemented; unsupported functions show a clear error in the formula editor.
147
+
148
+ ## Contributing
149
+
150
+ PyBI is built in the open and contributions are very welcome — connectors tested with real accounts, visuals, DAX functions, docs and translations.
151
+
152
+ * Read **[CONTRIBUTING.md](CONTRIBUTING.md)** for setup, project structure and how to add connectors/visuals.
153
+ * Look for issues labelled **good first issue**.
154
+ * Questions and ideas: **[Discussions](https://github.com/rafay183/pybi/discussions)**.
155
+
156
+ ```bash
157
+ git clone https://github.com/rafay183/pybi
158
+ cd pybi
159
+ pip install -e ".[dev]"
160
+ pytest -q
161
+ pybi demo
162
+ ```
163
+
164
+ Maintainers: release steps are in [docs/PUBLISHING.md](docs/PUBLISHING.md). See also [CHANGELOG.md](CHANGELOG.md) and [SECURITY.md](SECURITY.md).
165
+
166
+ ## License
167
+
168
+ MIT © Muhammad Rafay Shaikh. Bundles [d3](https://d3js.org) (ISC license, © Mike Bostock).
@@ -0,0 +1,90 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "pybi-ray"
7
+ version = "0.1.0"
8
+ description = "Open-source business intelligence studio in Python - a Power BI style app: data modeling, DAX-style measures, interactive dashboards, sharing and exports."
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "Muhammad Rafay Shaikh" }]
13
+ maintainers = [{ name = "Muhammad Rafay Shaikh" }]
14
+ keywords = ["business intelligence", "bi", "dashboard", "power bi", "dax", "analytics", "data visualization", "reporting", "pandas"]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Environment :: Web Environment",
18
+ "Intended Audience :: Developers",
19
+ "Intended Audience :: Financial and Insurance Industry",
20
+ "Intended Audience :: Science/Research",
21
+ "License :: OSI Approved :: MIT License",
22
+ "Operating System :: OS Independent",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: JavaScript",
25
+ "Topic :: Office/Business",
26
+ "Topic :: Scientific/Engineering :: Visualization",
27
+ "Topic :: Database :: Front-Ends",
28
+ ]
29
+ dependencies = [
30
+ "pandas>=1.5",
31
+ "flask>=2.2",
32
+ "openpyxl>=3.0",
33
+ "python-pptx>=0.6.21",
34
+ "Pillow>=9.0",
35
+ "requests>=2.25",
36
+ "lxml>=4.9",
37
+ "pyyaml>=6.0",
38
+ ]
39
+
40
+ [project.optional-dependencies]
41
+ parquet = ["pyarrow>=10"]
42
+ files = ["pyarrow>=10", "xlrd", "pyxlsb", "odfpy", "fastavro", "pyreadstat", "tables", "pyyaml", "pdfplumber"]
43
+ sql = ["sqlalchemy>=2.0"]
44
+ postgres = ["sqlalchemy>=2.0", "psycopg2-binary"]
45
+ mysql = ["sqlalchemy>=2.0", "pymysql"]
46
+ sqlserver = ["sqlalchemy>=2.0", "pymssql"]
47
+ oracle = ["sqlalchemy>=2.0", "oracledb"]
48
+ snowflake = ["snowflake-sqlalchemy"]
49
+ bigquery = ["sqlalchemy-bigquery"]
50
+ databricks = ["databricks-sqlalchemy"]
51
+ duckdb = ["duckdb"]
52
+ odbc = ["pyodbc"]
53
+ nosql = ["pymongo", "redis", "boto3"]
54
+ cloud = ["fsspec", "s3fs", "gcsfs", "adlfs", "paramiko"]
55
+ finance = ["yfinance"]
56
+ all = ["pyarrow>=10", "xlrd", "pyxlsb", "odfpy", "fastavro", "pyreadstat", "pyyaml", "pdfplumber", "sqlalchemy>=2.0", "psycopg2-binary",
57
+ "pymysql", "pymssql", "oracledb", "duckdb", "pymongo", "redis", "boto3", "fsspec", "s3fs", "gcsfs", "adlfs", "paramiko", "yfinance"]
58
+ dev = ["pytest>=7", "ruff>=0.6", "build", "twine", "reportlab", "pdfplumber", "odfpy"]
59
+
60
+ [project.urls]
61
+ Homepage = "https://github.com/rafay183/pybi"
62
+ Source = "https://github.com/rafay183/pybi"
63
+ Issues = "https://github.com/rafay183/pybi/issues"
64
+ Changelog = "https://github.com/rafay183/pybi/blob/main/CHANGELOG.md"
65
+ Documentation = "https://github.com/rafay183/pybi#readme"
66
+
67
+ [project.scripts]
68
+ pybi = "pybi.cli:main"
69
+
70
+ [tool.setuptools.packages.find]
71
+ where = ["src"]
72
+ include = ["pybi*"]
73
+
74
+ [tool.setuptools.package-data]
75
+ pybi = ["static/*"]
76
+
77
+ [tool.ruff]
78
+ line-length = 160
79
+ target-version = "py310"
80
+ extend-exclude = ["src/pybi/static"]
81
+
82
+ [tool.ruff.lint]
83
+ select = ["E", "F", "W", "I", "B"]
84
+ ignore = ["E501", "E731", "B008", "B904", "E741", "B905"]
85
+
86
+ [tool.ruff.lint.per-file-ignores]
87
+ "src/pybi/connectors/catalog.py" = ["E241"]
88
+
89
+ [tool.pytest.ini_options]
90
+ testpaths = ["tests"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,36 @@
1
+ """PyBI — an open-source, Python-powered business intelligence studio.
2
+
3
+ pip install pybi-ray
4
+ pybi run
5
+
6
+ Author: Muhammad Rafay Shaikh, from Pakistan.
7
+ """
8
+ from __future__ import annotations
9
+
10
+ __version__ = "0.1.0"
11
+ __author__ = "Muhammad Rafay Shaikh"
12
+
13
+ from typing import Any
14
+
15
+
16
+ def run(project: str | None = None, port: int = 8050, open_browser: bool = True,
17
+ private: bool = False, demo: bool = False, **dataframes: Any) -> None:
18
+ """Start the PyBI studio.
19
+
20
+ Pass pandas DataFrames as keyword arguments to load them as tables::
21
+
22
+ import pybi
23
+ pybi.run(Sales=df_sales, Products=df_products)
24
+ """
25
+ from .server import serve
26
+
27
+ serve(project=project, host="127.0.0.1" if private else "0.0.0.0", port=port, open_browser=open_browser,
28
+ dataframes=dataframes or None, sample=demo)
29
+
30
+
31
+ def show(**dataframes: Any) -> None:
32
+ """Alias of :func:`run` for notebooks and scripts: ``pybi.show(Sales=df)``."""
33
+ run(**dataframes)
34
+
35
+
36
+ __all__ = ["run", "show", "__version__"]
@@ -0,0 +1,5 @@
1
+ import sys
2
+
3
+ from .cli import main
4
+
5
+ sys.exit(main())