petpooja-databricks 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 (30) hide show
  1. petpooja_databricks-0.1.0/LICENSE +21 -0
  2. petpooja_databricks-0.1.0/MANIFEST.in +6 -0
  3. petpooja_databricks-0.1.0/PKG-INFO +125 -0
  4. petpooja_databricks-0.1.0/README.md +110 -0
  5. petpooja_databricks-0.1.0/petpooja/__init__.py +61 -0
  6. petpooja_databricks-0.1.0/petpooja/app/app.yaml +24 -0
  7. petpooja_databricks-0.1.0/petpooja/app/backend/__init__.py +0 -0
  8. petpooja_databricks-0.1.0/petpooja/app/backend/main.py +587 -0
  9. petpooja_databricks-0.1.0/petpooja/app/backend/requirements.txt +7 -0
  10. petpooja_databricks-0.1.0/petpooja/app/backend/static/assets/index-CYr4qtSy.css +1 -0
  11. petpooja_databricks-0.1.0/petpooja/app/backend/static/assets/index-CokmBhA4.js +212 -0
  12. petpooja_databricks-0.1.0/petpooja/app/backend/static/index.html +20 -0
  13. petpooja_databricks-0.1.0/petpooja/app/requirements.txt +9 -0
  14. petpooja_databricks-0.1.0/petpooja/conf/petpooja.json +59 -0
  15. petpooja_databricks-0.1.0/petpooja/data/menu_items.parquet +0 -0
  16. petpooja_databricks-0.1.0/petpooja/data/order_items.parquet +0 -0
  17. petpooja_databricks-0.1.0/petpooja/data/orders.parquet +0 -0
  18. petpooja_databricks-0.1.0/petpooja/data/outlets.parquet +0 -0
  19. petpooja_databricks-0.1.0/petpooja/data/staff.parquet +0 -0
  20. petpooja_databricks-0.1.0/petpooja/data/wastage.parquet +0 -0
  21. petpooja_databricks-0.1.0/petpooja/installer.py +657 -0
  22. petpooja_databricks-0.1.0/petpooja/sql/lakebase_schema.sql +12 -0
  23. petpooja_databricks-0.1.0/petpooja/sql/setup.sql +22 -0
  24. petpooja_databricks-0.1.0/petpooja_databricks.egg-info/PKG-INFO +125 -0
  25. petpooja_databricks-0.1.0/petpooja_databricks.egg-info/SOURCES.txt +28 -0
  26. petpooja_databricks-0.1.0/petpooja_databricks.egg-info/dependency_links.txt +1 -0
  27. petpooja_databricks-0.1.0/petpooja_databricks.egg-info/requires.txt +2 -0
  28. petpooja_databricks-0.1.0/petpooja_databricks.egg-info/top_level.txt +1 -0
  29. petpooja_databricks-0.1.0/pyproject.toml +45 -0
  30. petpooja_databricks-0.1.0/setup.cfg +4 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anuj Lathi
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.
@@ -0,0 +1,6 @@
1
+ include README.md LICENSE
2
+ recursive-include petpooja/conf *.json
3
+ recursive-include petpooja/sql *.sql
4
+ recursive-include petpooja/data *.parquet
5
+ recursive-include petpooja/app *.yaml *.txt *.json *.py
6
+ recursive-include petpooja/app/backend/static *
@@ -0,0 +1,125 @@
1
+ Metadata-Version: 2.4
2
+ Name: petpooja-databricks
3
+ Version: 0.1.0
4
+ Summary: One-line installer for the GIVA Databricks demo (AI jewelry commerce: data + Vector Search + Genie + AI/BI dashboard + Lakebase + FastAPI app + paused background jobs).
5
+ Author: Anuj Lathi
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/anuj1303/petpooja-databricks
8
+ Keywords: databricks,genie,ai-bi,vector-search,lakebase,apps,retail,demo,dbdemos
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: databricks-sdk>=0.33.0
13
+ Requires-Dist: psycopg2-binary>=2.9.9
14
+ Dynamic: license-file
15
+
16
+ # šŸ’Ž Petpooja — one-line Databricks demo installer
17
+
18
+ `petpooja` packages the entire **Petpooja** AI jewelry-commerce demo into a
19
+ single `pip`-installable package, Ć  la [dbdemos](https://www.dbdemos.ai/). One call
20
+ provisions the whole stack into your workspace from pre-baked real data.
21
+
22
+ ```python
23
+ %pip install petpooja-databricks
24
+ dbutils.library.restartPython()
25
+
26
+ import petpooja
27
+ petpooja.install('petpooja', catalog='my_catalog')
28
+ ```
29
+
30
+ Locally with a CLI profile:
31
+
32
+ ```bash
33
+ pip install petpooja-databricks
34
+ python -c "import petpooja; petpooja.install('petpooja', profile='AnujLathi', catalog='anuj_vm_workspace_catalog')"
35
+ ```
36
+
37
+ ## What gets installed
38
+
39
+ | # | Asset | Detail |
40
+ |---|-------|--------|
41
+ | 1 | **UC data layer** | schema + volume, `enriched_jewelry_products` (~236 LLM-enriched products) + `jewelry_embeddings` + ~236 product images |
42
+ | 2 | **Vector Search** | `petpooja-vs` endpoint + `jewelry_embeddings_index` (DELTA_SYNC, 1024-dim) for semantic & image search |
43
+ | 3 | **Genie Space** | natural-language analytics over the product catalog |
44
+ | 4 | **AI/BI dashboard** | catalog & sales analytics, published |
45
+ | 5 | **Lakebase (Postgres)** | `petpooja-orders` instance + `petpooja` db: orders, users, nudges, live metal prices, dynamic product prices — **seeded with data** |
46
+ | 6 | **App** | React + FastAPI storefront + admin analytics (Databricks App) |
47
+ | 7 | **Background jobs** | **Metals Refresh** + **Nudge Emails** — created **PAUSED** (stopped, not triggered) |
48
+
49
+ ### āø The two pipelines are installed PAUSED
50
+
51
+ Per design, the **Metals Refresh Pipeline** and **Nudge Emails Pipeline** jobs are
52
+ created with their schedule `pause_status = PAUSED`. They will **not** run on a
53
+ trigger. The demo works out of the box because metal prices and product prices are
54
+ **seeded** into Lakebase. When you want a live refresh, either:
55
+
56
+ - trigger them manually from the **admin app** (Run now), or
57
+ - unpause the schedule in the Jobs UI.
58
+
59
+ > The two job notebooks read Service-Principal credentials and (for emails) Gmail
60
+ > OAuth from a Databricks secret scope `petpooja`. These secrets are **not**
61
+ > created by the installer — set them before unpausing if you want the jobs to run.
62
+
63
+ ## Options
64
+
65
+ ```python
66
+ petpooja.install(
67
+ 'petpooja',
68
+ catalog='my_catalog', # required on non-Free-Edition workspaces
69
+ schema='petpooja', # default
70
+ warehouse_id=None, # default: first running/available
71
+ install_app=True,
72
+ install_lakebase=True, # provision Lakebase + seed
73
+ install_jobs=True, # create the two PAUSED jobs
74
+ install_vector_search=True,
75
+ profile='AnujLathi', # only when running locally
76
+ )
77
+ ```
78
+
79
+ ## Rebuilding the package data (maintainers)
80
+
81
+ The packaged `data/`, `dashboards/` and Lakebase schema are exported from the live
82
+ reference build. To refresh them:
83
+
84
+ ```bash
85
+ python scripts/export_live_assets.py --profile AnujLathi \
86
+ --catalog anuj_vm_workspace_catalog --schema caratlane_jewelry
87
+ python -m build # produces dist/petpooja-*.whl
88
+ ```
89
+
90
+ ## Installing the package
91
+
92
+ Until it's on PyPI, install the wheel straight from a GitHub Release:
93
+
94
+ ```bash
95
+ pip install https://github.com/anuj1303/petpooja-demo/releases/download/v0.1.0/petpooja-0.1.0-py3-none-any.whl
96
+ ```
97
+
98
+ or build-and-install from source:
99
+
100
+ ```bash
101
+ pip install "git+https://github.com/anuj1303/petpooja-demo.git"
102
+ ```
103
+
104
+ ## Publishing to PyPI (maintainers)
105
+
106
+ The `Publish petpooja-databricks to PyPI` GitHub Action publishes via **trusted publishing**
107
+ (OIDC — no API tokens). One-time setup, then a one-click publish:
108
+
109
+ 1. On https://pypi.org → your account → **Publishing** → **Add a pending publisher**:
110
+ - PyPI Project Name: `petpooja`
111
+ - Owner: `anuj1303`
112
+ - Repository name: `petpooja-demo`
113
+ - Workflow name: `publish.yml`
114
+ - Environment: *(leave blank)*
115
+ 2. In the repo: **Actions → Publish petpooja-databricks to PyPI → Run workflow**.
116
+
117
+ > Note: the wheel is ~88 MB (the 11.5M-row `nudge_emails` seed is most of it).
118
+ > That's under PyPI's 100 MB per-file limit but large — the GitHub Release wheel
119
+ > above is the recommended distribution for most users.
120
+
121
+ ## Reference build
122
+
123
+ - Workspace: AWS FE VM (`fe-vm-anuj-vm-workspace`)
124
+ - Source catalog/schema: `anuj_vm_workspace_catalog.caratlane_jewelry`
125
+ - App: `tanishq-jewelry-demo` (UI name **Petpooja**)
@@ -0,0 +1,110 @@
1
+ # šŸ’Ž Petpooja — one-line Databricks demo installer
2
+
3
+ `petpooja` packages the entire **Petpooja** AI jewelry-commerce demo into a
4
+ single `pip`-installable package, Ć  la [dbdemos](https://www.dbdemos.ai/). One call
5
+ provisions the whole stack into your workspace from pre-baked real data.
6
+
7
+ ```python
8
+ %pip install petpooja-databricks
9
+ dbutils.library.restartPython()
10
+
11
+ import petpooja
12
+ petpooja.install('petpooja', catalog='my_catalog')
13
+ ```
14
+
15
+ Locally with a CLI profile:
16
+
17
+ ```bash
18
+ pip install petpooja-databricks
19
+ python -c "import petpooja; petpooja.install('petpooja', profile='AnujLathi', catalog='anuj_vm_workspace_catalog')"
20
+ ```
21
+
22
+ ## What gets installed
23
+
24
+ | # | Asset | Detail |
25
+ |---|-------|--------|
26
+ | 1 | **UC data layer** | schema + volume, `enriched_jewelry_products` (~236 LLM-enriched products) + `jewelry_embeddings` + ~236 product images |
27
+ | 2 | **Vector Search** | `petpooja-vs` endpoint + `jewelry_embeddings_index` (DELTA_SYNC, 1024-dim) for semantic & image search |
28
+ | 3 | **Genie Space** | natural-language analytics over the product catalog |
29
+ | 4 | **AI/BI dashboard** | catalog & sales analytics, published |
30
+ | 5 | **Lakebase (Postgres)** | `petpooja-orders` instance + `petpooja` db: orders, users, nudges, live metal prices, dynamic product prices — **seeded with data** |
31
+ | 6 | **App** | React + FastAPI storefront + admin analytics (Databricks App) |
32
+ | 7 | **Background jobs** | **Metals Refresh** + **Nudge Emails** — created **PAUSED** (stopped, not triggered) |
33
+
34
+ ### āø The two pipelines are installed PAUSED
35
+
36
+ Per design, the **Metals Refresh Pipeline** and **Nudge Emails Pipeline** jobs are
37
+ created with their schedule `pause_status = PAUSED`. They will **not** run on a
38
+ trigger. The demo works out of the box because metal prices and product prices are
39
+ **seeded** into Lakebase. When you want a live refresh, either:
40
+
41
+ - trigger them manually from the **admin app** (Run now), or
42
+ - unpause the schedule in the Jobs UI.
43
+
44
+ > The two job notebooks read Service-Principal credentials and (for emails) Gmail
45
+ > OAuth from a Databricks secret scope `petpooja`. These secrets are **not**
46
+ > created by the installer — set them before unpausing if you want the jobs to run.
47
+
48
+ ## Options
49
+
50
+ ```python
51
+ petpooja.install(
52
+ 'petpooja',
53
+ catalog='my_catalog', # required on non-Free-Edition workspaces
54
+ schema='petpooja', # default
55
+ warehouse_id=None, # default: first running/available
56
+ install_app=True,
57
+ install_lakebase=True, # provision Lakebase + seed
58
+ install_jobs=True, # create the two PAUSED jobs
59
+ install_vector_search=True,
60
+ profile='AnujLathi', # only when running locally
61
+ )
62
+ ```
63
+
64
+ ## Rebuilding the package data (maintainers)
65
+
66
+ The packaged `data/`, `dashboards/` and Lakebase schema are exported from the live
67
+ reference build. To refresh them:
68
+
69
+ ```bash
70
+ python scripts/export_live_assets.py --profile AnujLathi \
71
+ --catalog anuj_vm_workspace_catalog --schema caratlane_jewelry
72
+ python -m build # produces dist/petpooja-*.whl
73
+ ```
74
+
75
+ ## Installing the package
76
+
77
+ Until it's on PyPI, install the wheel straight from a GitHub Release:
78
+
79
+ ```bash
80
+ pip install https://github.com/anuj1303/petpooja-demo/releases/download/v0.1.0/petpooja-0.1.0-py3-none-any.whl
81
+ ```
82
+
83
+ or build-and-install from source:
84
+
85
+ ```bash
86
+ pip install "git+https://github.com/anuj1303/petpooja-demo.git"
87
+ ```
88
+
89
+ ## Publishing to PyPI (maintainers)
90
+
91
+ The `Publish petpooja-databricks to PyPI` GitHub Action publishes via **trusted publishing**
92
+ (OIDC — no API tokens). One-time setup, then a one-click publish:
93
+
94
+ 1. On https://pypi.org → your account → **Publishing** → **Add a pending publisher**:
95
+ - PyPI Project Name: `petpooja`
96
+ - Owner: `anuj1303`
97
+ - Repository name: `petpooja-demo`
98
+ - Workflow name: `publish.yml`
99
+ - Environment: *(leave blank)*
100
+ 2. In the repo: **Actions → Publish petpooja-databricks to PyPI → Run workflow**.
101
+
102
+ > Note: the wheel is ~88 MB (the 11.5M-row `nudge_emails` seed is most of it).
103
+ > That's under PyPI's 100 MB per-file limit but large — the GitHub Release wheel
104
+ > above is the recommended distribution for most users.
105
+
106
+ ## Reference build
107
+
108
+ - Workspace: AWS FE VM (`fe-vm-anuj-vm-workspace`)
109
+ - Source catalog/schema: `anuj_vm_workspace_catalog.caratlane_jewelry`
110
+ - App: `tanishq-jewelry-demo` (UI name **Petpooja**)
@@ -0,0 +1,61 @@
1
+ """
2
+ petpooja — one-line installer for the Petpooja Databricks demo.
3
+
4
+ Petpooja is an end-to-end AI jewelry-commerce demo. One call provisions:
5
+
6
+ 1. Unity Catalog data layer (catalog/schema/volume, ~236 enriched products + images)
7
+ 2. Vector Search index (semantic + image search, 1024-dim)
8
+ 3. Genie Space (NL -> SQL over the product catalog)
9
+ 4. AI/BI dashboard (sales / catalog analytics, published)
10
+ 5. Lakebase (Postgres) (orders, users, nudges, live metal prices, dynamic product prices) + seed data
11
+ 6. FastAPI + React app (storefront + admin analytics)
12
+ 7. Two background jobs (Metals Refresh + Nudge Emails) — installed PAUSED (stopped, not triggered)
13
+
14
+ Usage (inside a Databricks notebook):
15
+
16
+ %pip install petpooja-databricks
17
+ dbutils.library.restartPython()
18
+
19
+ import petpooja
20
+ petpooja.help()
21
+ petpooja.install('petpooja', catalog='my_catalog')
22
+
23
+ Locally (with a Databricks CLI profile):
24
+
25
+ petpooja.install('petpooja', profile='DEFAULT', catalog='main')
26
+ """
27
+ import json
28
+ from importlib import resources
29
+
30
+ from .installer import install, Installer # noqa: F401
31
+
32
+ __version__ = "0.1.0"
33
+ __all__ = ["install", "list_demos", "help", "Installer", "__version__"]
34
+
35
+
36
+ def list_demos():
37
+ """Print the demos bundled in this package."""
38
+ conf_dir = resources.files("petpooja").joinpath("conf")
39
+ print("\nšŸ’Ž Available Petpooja demos:\n")
40
+ for entry in conf_dir.iterdir():
41
+ if entry.name.endswith(".json"):
42
+ c = json.loads(entry.read_text(encoding="utf-8"))
43
+ print(f" • {c['name']:<14} {c['title']}")
44
+ print(f" {c['description'][:120]}…\n")
45
+ print("Install with: petpooja.install('petpooja', catalog='<your_catalog>')\n")
46
+
47
+
48
+ def help():
49
+ """Print quick-start help."""
50
+ print(__doc__)
51
+ print("Options for install():")
52
+ print(" demo demo name (default 'petpooja')")
53
+ print(" catalog target UC catalog (default 'main')")
54
+ print(" schema target UC schema (default 'petpooja')")
55
+ print(" warehouse_id SQL warehouse to use (default: first running/available)")
56
+ print(" install_app also deploy the FastAPI app (default True)")
57
+ print(" install_lakebase provision Lakebase + seed data (default True)")
58
+ print(" install_jobs create the two PAUSED background jobs (default True)")
59
+ print(" profile Databricks CLI profile (only needed when running locally)")
60
+ print(" overwrite reinstall over existing assets (default False)\n")
61
+ print("Note: the Metals Refresh and Nudge Emails jobs are always created PAUSED.\n")
@@ -0,0 +1,24 @@
1
+ command: ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "8000"]
2
+
3
+ env:
4
+ - name: PP_CATALOG
5
+ value: "{{CATALOG}}"
6
+ - name: PP_SCHEMA
7
+ value: "{{SCHEMA}}"
8
+ - name: DATABRICKS_WAREHOUSE_ID
9
+ valueFrom: "sql-warehouse"
10
+ - name: LAKEBASE_HOST
11
+ value: "{{LAKEBASE_HOST}}"
12
+ - name: LAKEBASE_DB
13
+ value: "{{LAKEBASE_DATABASE}}"
14
+
15
+ resources:
16
+ - name: sql-warehouse
17
+ sql_warehouse:
18
+ id: "{{WAREHOUSE_ID}}"
19
+ permission: "CAN_USE"
20
+ - name: petpooja-ops-db
21
+ database:
22
+ instance_name: "{{LAKEBASE_INSTANCE}}"
23
+ database_name: "{{LAKEBASE_DATABASE}}"
24
+ permission: "CAN_CONNECT_AND_CREATE"