prismiq 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 (66) hide show
  1. prismiq-0.1.0/.gitignore +72 -0
  2. prismiq-0.1.0/BUILD +4 -0
  3. prismiq-0.1.0/PKG-INFO +109 -0
  4. prismiq-0.1.0/README.md +71 -0
  5. prismiq-0.1.0/prismiq/__init__.py +543 -0
  6. prismiq-0.1.0/prismiq/api.py +1889 -0
  7. prismiq-0.1.0/prismiq/auth.py +108 -0
  8. prismiq-0.1.0/prismiq/cache.py +527 -0
  9. prismiq-0.1.0/prismiq/calculated_field_processor.py +231 -0
  10. prismiq-0.1.0/prismiq/calculated_fields.py +819 -0
  11. prismiq-0.1.0/prismiq/dashboard_store.py +1219 -0
  12. prismiq-0.1.0/prismiq/dashboards.py +374 -0
  13. prismiq-0.1.0/prismiq/dates.py +247 -0
  14. prismiq-0.1.0/prismiq/engine.py +1315 -0
  15. prismiq-0.1.0/prismiq/executor.py +345 -0
  16. prismiq-0.1.0/prismiq/filter_merge.py +397 -0
  17. prismiq-0.1.0/prismiq/formatting.py +298 -0
  18. prismiq-0.1.0/prismiq/logging.py +489 -0
  19. prismiq-0.1.0/prismiq/metrics.py +536 -0
  20. prismiq-0.1.0/prismiq/middleware.py +346 -0
  21. prismiq-0.1.0/prismiq/permissions.py +87 -0
  22. prismiq-0.1.0/prismiq/persistence/__init__.py +45 -0
  23. prismiq-0.1.0/prismiq/persistence/models.py +208 -0
  24. prismiq-0.1.0/prismiq/persistence/postgres_store.py +1119 -0
  25. prismiq-0.1.0/prismiq/persistence/saved_query_store.py +336 -0
  26. prismiq-0.1.0/prismiq/persistence/schema.sql +95 -0
  27. prismiq-0.1.0/prismiq/persistence/setup.py +222 -0
  28. prismiq-0.1.0/prismiq/persistence/tables.py +76 -0
  29. prismiq-0.1.0/prismiq/pins.py +72 -0
  30. prismiq-0.1.0/prismiq/py.typed +0 -0
  31. prismiq-0.1.0/prismiq/query.py +1233 -0
  32. prismiq-0.1.0/prismiq/schema.py +333 -0
  33. prismiq-0.1.0/prismiq/schema_config.py +354 -0
  34. prismiq-0.1.0/prismiq/sql_utils.py +147 -0
  35. prismiq-0.1.0/prismiq/sql_validator.py +219 -0
  36. prismiq-0.1.0/prismiq/sqlalchemy_builder.py +577 -0
  37. prismiq-0.1.0/prismiq/timeseries.py +410 -0
  38. prismiq-0.1.0/prismiq/transforms.py +471 -0
  39. prismiq-0.1.0/prismiq/trends.py +573 -0
  40. prismiq-0.1.0/prismiq/types.py +688 -0
  41. prismiq-0.1.0/pyproject.toml +144 -0
  42. prismiq-0.1.0/tests/__init__.py +1 -0
  43. prismiq-0.1.0/tests/conftest.py +112 -0
  44. prismiq-0.1.0/tests/test_api.py +637 -0
  45. prismiq-0.1.0/tests/test_cache.py +999 -0
  46. prismiq-0.1.0/tests/test_dashboard_store.py +974 -0
  47. prismiq-0.1.0/tests/test_dashboards.py +632 -0
  48. prismiq-0.1.0/tests/test_dates.py +385 -0
  49. prismiq-0.1.0/tests/test_engine.py +448 -0
  50. prismiq-0.1.0/tests/test_executor.py +381 -0
  51. prismiq-0.1.0/tests/test_filter_merge.py +715 -0
  52. prismiq-0.1.0/tests/test_formatting.py +322 -0
  53. prismiq-0.1.0/tests/test_logging.py +547 -0
  54. prismiq-0.1.0/tests/test_metrics.py +509 -0
  55. prismiq-0.1.0/tests/test_middleware.py +398 -0
  56. prismiq-0.1.0/tests/test_multi_tenancy.py +206 -0
  57. prismiq-0.1.0/tests/test_multi_tenant_schema.py +207 -0
  58. prismiq-0.1.0/tests/test_persistence_models.py +296 -0
  59. prismiq-0.1.0/tests/test_query.py +1337 -0
  60. prismiq-0.1.0/tests/test_schema.py +578 -0
  61. prismiq-0.1.0/tests/test_schema_config.py +445 -0
  62. prismiq-0.1.0/tests/test_timeseries.py +433 -0
  63. prismiq-0.1.0/tests/test_transforms.py +668 -0
  64. prismiq-0.1.0/tests/test_trends.py +510 -0
  65. prismiq-0.1.0/tests/test_types.py +548 -0
  66. prismiq-0.1.0/tests/test_validation.py +589 -0
@@ -0,0 +1,72 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+ .pytest_cache/
23
+ .mypy_cache/
24
+ .pyright/
25
+ .ruff_cache/
26
+
27
+ # Virtual environments
28
+ .venv/
29
+ venv/
30
+ ENV/
31
+ env/
32
+
33
+ # Node
34
+ node_modules/
35
+ npm-debug.log*
36
+ yarn-debug.log*
37
+ yarn-error.log*
38
+ .pnpm-debug.log*
39
+
40
+ # Build outputs
41
+ packages/react/dist/
42
+
43
+ # IDE
44
+ .idea/
45
+ .vscode/
46
+ *.swp
47
+ *.swo
48
+ *~
49
+
50
+ # OS
51
+ .DS_Store
52
+ Thumbs.db
53
+
54
+ # Environment
55
+ .env
56
+ .env.local
57
+ .env.*.local
58
+ *.env
59
+
60
+ # Claude Code local state
61
+ .claude/settings.local.json
62
+
63
+ # Test coverage
64
+ coverage/
65
+ htmlcov/
66
+ .coverage
67
+ .coverage.*
68
+
69
+ # Temporary files
70
+ *.tmp
71
+ *.temp
72
+ *.log
prismiq-0.1.0/BUILD ADDED
@@ -0,0 +1,4 @@
1
+ python_sources(
2
+ name="prismiq",
3
+ sources=["prismiq/**/*.py"],
4
+ )
prismiq-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,109 @@
1
+ Metadata-Version: 2.4
2
+ Name: prismiq
3
+ Version: 0.1.0
4
+ Summary: Open-source embedded analytics platform
5
+ Project-URL: Homepage, https://github.com/prismiq/prismiq
6
+ Project-URL: Documentation, https://prismiq.dev/docs
7
+ Project-URL: Repository, https://github.com/prismiq/prismiq
8
+ Author: Prismiq Contributors
9
+ License-Expression: MIT
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Framework :: FastAPI
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Database
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.10
21
+ Requires-Dist: asyncpg>=0.29.0
22
+ Requires-Dist: fastapi>=0.109.0
23
+ Requires-Dist: pydantic>=2.0.0
24
+ Requires-Dist: sqlalchemy>=2.0.0
25
+ Requires-Dist: sqlglot>=26.0.0
26
+ Requires-Dist: uvicorn>=0.27.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: httpx>=0.27.0; extra == 'dev'
29
+ Requires-Dist: pre-commit>=3.7.0; extra == 'dev'
30
+ Requires-Dist: pyright>=1.1.350; extra == 'dev'
31
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
32
+ Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
33
+ Requires-Dist: pytest>=8.0.0; extra == 'dev'
34
+ Requires-Dist: ruff>=0.4.0; extra == 'dev'
35
+ Provides-Extra: redis
36
+ Requires-Dist: redis>=5.0.0; extra == 'redis'
37
+ Description-Content-Type: text/markdown
38
+
39
+ # Prismiq
40
+
41
+ Open-source embedded analytics engine for Python.
42
+
43
+ ## Installation
44
+
45
+ ```bash
46
+ pip install prismiq
47
+ ```
48
+
49
+ ## Quick Start
50
+
51
+ ```python
52
+ from prismiq import PrismiqEngine
53
+
54
+ # Connect to your database
55
+ engine = await PrismiqEngine.create(
56
+ database_url="postgresql://user:pass@localhost/mydb",
57
+ exposed_tables=["customers", "orders", "products"]
58
+ )
59
+
60
+ # Get schema
61
+ schema = await engine.get_schema()
62
+
63
+ # Execute a query
64
+ result = await engine.execute({
65
+ "tables": [{"id": "t1", "name": "orders"}],
66
+ "columns": [
67
+ {"table_id": "t1", "name": "status"},
68
+ {"table_id": "t1", "name": "total", "aggregation": "sum"}
69
+ ],
70
+ "group_by": [{"table_id": "t1", "column": "status"}]
71
+ })
72
+ ```
73
+
74
+ ## Features
75
+
76
+ - **Schema introspection** - Discover tables, columns, and relationships
77
+ - **Visual query building** - Build SQL from JSON query definitions
78
+ - **Async execution** - Non-blocking database operations with asyncpg
79
+ - **Type safe** - Full type hints with Pydantic models
80
+ - **Multi-tenant support** - Schema-based isolation with Alembic integration
81
+
82
+ ## Multi-Tenant Integration
83
+
84
+ For applications with schema-based multi-tenancy, Prismiq provides SQLAlchemy declarative models and sync table creation:
85
+
86
+ ```python
87
+ from sqlalchemy import create_engine
88
+ from prismiq import ensure_tables_sync, PrismiqBase
89
+
90
+ engine = create_engine("postgresql://user:pass@localhost/db")
91
+
92
+ # Create tables in a tenant-specific schema
93
+ with engine.connect() as conn:
94
+ ensure_tables_sync(conn, schema_name="tenant_123")
95
+ conn.commit()
96
+
97
+ # For Alembic integration, access the metadata:
98
+ # PrismiqBase.metadata.tables contains all Prismiq table definitions
99
+ ```
100
+
101
+ See [Multi-Tenant Integration Guide](../../docs/multi-tenant-integration.md) for complete documentation.
102
+
103
+ ## Documentation
104
+
105
+ See the [main repository](https://github.com/prismiq/prismiq) for full documentation.
106
+
107
+ ## License
108
+
109
+ MIT
@@ -0,0 +1,71 @@
1
+ # Prismiq
2
+
3
+ Open-source embedded analytics engine for Python.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install prismiq
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ from prismiq import PrismiqEngine
15
+
16
+ # Connect to your database
17
+ engine = await PrismiqEngine.create(
18
+ database_url="postgresql://user:pass@localhost/mydb",
19
+ exposed_tables=["customers", "orders", "products"]
20
+ )
21
+
22
+ # Get schema
23
+ schema = await engine.get_schema()
24
+
25
+ # Execute a query
26
+ result = await engine.execute({
27
+ "tables": [{"id": "t1", "name": "orders"}],
28
+ "columns": [
29
+ {"table_id": "t1", "name": "status"},
30
+ {"table_id": "t1", "name": "total", "aggregation": "sum"}
31
+ ],
32
+ "group_by": [{"table_id": "t1", "column": "status"}]
33
+ })
34
+ ```
35
+
36
+ ## Features
37
+
38
+ - **Schema introspection** - Discover tables, columns, and relationships
39
+ - **Visual query building** - Build SQL from JSON query definitions
40
+ - **Async execution** - Non-blocking database operations with asyncpg
41
+ - **Type safe** - Full type hints with Pydantic models
42
+ - **Multi-tenant support** - Schema-based isolation with Alembic integration
43
+
44
+ ## Multi-Tenant Integration
45
+
46
+ For applications with schema-based multi-tenancy, Prismiq provides SQLAlchemy declarative models and sync table creation:
47
+
48
+ ```python
49
+ from sqlalchemy import create_engine
50
+ from prismiq import ensure_tables_sync, PrismiqBase
51
+
52
+ engine = create_engine("postgresql://user:pass@localhost/db")
53
+
54
+ # Create tables in a tenant-specific schema
55
+ with engine.connect() as conn:
56
+ ensure_tables_sync(conn, schema_name="tenant_123")
57
+ conn.commit()
58
+
59
+ # For Alembic integration, access the metadata:
60
+ # PrismiqBase.metadata.tables contains all Prismiq table definitions
61
+ ```
62
+
63
+ See [Multi-Tenant Integration Guide](../../docs/multi-tenant-integration.md) for complete documentation.
64
+
65
+ ## Documentation
66
+
67
+ See the [main repository](https://github.com/prismiq/prismiq) for full documentation.
68
+
69
+ ## License
70
+
71
+ MIT