quillsql 0.6__tar.gz → 2.2.2__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 (33) hide show
  1. quillsql-2.2.2/PKG-INFO +69 -0
  2. quillsql-2.2.2/README.md +46 -0
  3. quillsql-2.2.2/quillsql/__init__.py +5 -0
  4. quillsql-2.2.2/quillsql/assets/__init__.py +3 -0
  5. quillsql-2.2.2/quillsql/assets/pgtypes.py +697 -0
  6. quillsql-2.2.2/quillsql/core.py +538 -0
  7. quillsql-2.2.2/quillsql/db/__init__.py +3 -0
  8. quillsql-2.2.2/quillsql/db/bigquery.py +148 -0
  9. quillsql-2.2.2/quillsql/db/cached_connection.py +66 -0
  10. quillsql-2.2.2/quillsql/db/db_helper.py +61 -0
  11. quillsql-2.2.2/quillsql/db/postgres.py +127 -0
  12. quillsql-2.2.2/quillsql/error.py +5 -0
  13. quillsql-2.2.2/quillsql/utils/__init__.py +4 -0
  14. quillsql-2.2.2/quillsql/utils/filters.py +180 -0
  15. quillsql-2.2.2/quillsql/utils/pivot_template.py +485 -0
  16. quillsql-2.2.2/quillsql/utils/run_query_processes.py +20 -0
  17. quillsql-2.2.2/quillsql/utils/schema_conversion.py +9 -0
  18. quillsql-2.2.2/quillsql/utils/tenants.py +60 -0
  19. quillsql-2.2.2/quillsql.egg-info/PKG-INFO +69 -0
  20. quillsql-2.2.2/quillsql.egg-info/SOURCES.txt +23 -0
  21. quillsql-2.2.2/quillsql.egg-info/requires.txt +7 -0
  22. {quillsql-0.6 → quillsql-2.2.2}/setup.py +11 -3
  23. quillsql-0.6/LICENSE +0 -21
  24. quillsql-0.6/PKG-INFO +0 -11
  25. quillsql-0.6/README.md +0 -1
  26. quillsql-0.6/quillsql/__init__.py +0 -3
  27. quillsql-0.6/quillsql/core.py +0 -170
  28. quillsql-0.6/quillsql.egg-info/PKG-INFO +0 -11
  29. quillsql-0.6/quillsql.egg-info/SOURCES.txt +0 -10
  30. quillsql-0.6/quillsql.egg-info/requires.txt +0 -2
  31. {quillsql-0.6 → quillsql-2.2.2}/quillsql.egg-info/dependency_links.txt +0 -0
  32. {quillsql-0.6 → quillsql-2.2.2}/quillsql.egg-info/top_level.txt +0 -0
  33. {quillsql-0.6 → quillsql-2.2.2}/setup.cfg +0 -0
@@ -0,0 +1,69 @@
1
+ Metadata-Version: 2.4
2
+ Name: quillsql
3
+ Version: 2.2.2
4
+ Summary: Quill SDK for Python.
5
+ Home-page: https://github.com/quill-sql/quill-python
6
+ Author: Quill
7
+ Author-email: shawn@quill.co
8
+ Description-Content-Type: text/markdown
9
+ Requires-Dist: psycopg2-binary
10
+ Requires-Dist: requests
11
+ Requires-Dist: redis
12
+ Requires-Dist: python-dotenv
13
+ Requires-Dist: pytest
14
+ Requires-Dist: google-cloud-bigquery
15
+ Requires-Dist: google-auth
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: requires-dist
22
+ Dynamic: summary
23
+
24
+ # Quill Python SDK
25
+
26
+ ## Quickstart
27
+
28
+ First, install the quillsql package by running:
29
+
30
+ ```bash
31
+ $ pip install quillsql
32
+ ```
33
+
34
+ Then, add a `/quill` endpoint to your existing python server. For example, if
35
+ you were running a FASTAPI app, you would just add the endpoint like this:
36
+
37
+ ```python
38
+ from quillsql import Quill
39
+
40
+ quill = Quill(
41
+ private_key=os.getenv("QULL_PRIVATE_KEY"),
42
+ database_connection_string=os.getenv("POSTGRES_READ"),
43
+ database_type="postgresql"
44
+ )
45
+
46
+ security = HTTPBearer()
47
+
48
+ async def authenticate_jwt(token: str = Depends(security)):
49
+ # Your JWT validation logic here
50
+ # Return user object or raise HTTPException
51
+ user = validate_jwt_token(token.credentials)
52
+ return user
53
+
54
+ @app.post("/quill")
55
+ async def quill_post(data: Request, user: dict = Depends(authenticate_jwt)):
56
+ # assuming user fetched via auth middleware has an userId
57
+ user_id = user["user_id"]
58
+ body = await data.json()
59
+ metadata = body.get("metadata")
60
+
61
+ result = quill.query(
62
+ tenants=[{"tenantField": "user_id", "tenantIds": [user_id]}],
63
+ metadata=metadata
64
+ )
65
+ return result
66
+ ```
67
+
68
+ Then you can run your app like normally. Pass in this route to our react library
69
+ on the frontend and you all set!
@@ -0,0 +1,46 @@
1
+ # Quill Python SDK
2
+
3
+ ## Quickstart
4
+
5
+ First, install the quillsql package by running:
6
+
7
+ ```bash
8
+ $ pip install quillsql
9
+ ```
10
+
11
+ Then, add a `/quill` endpoint to your existing python server. For example, if
12
+ you were running a FASTAPI app, you would just add the endpoint like this:
13
+
14
+ ```python
15
+ from quillsql import Quill
16
+
17
+ quill = Quill(
18
+ private_key=os.getenv("QULL_PRIVATE_KEY"),
19
+ database_connection_string=os.getenv("POSTGRES_READ"),
20
+ database_type="postgresql"
21
+ )
22
+
23
+ security = HTTPBearer()
24
+
25
+ async def authenticate_jwt(token: str = Depends(security)):
26
+ # Your JWT validation logic here
27
+ # Return user object or raise HTTPException
28
+ user = validate_jwt_token(token.credentials)
29
+ return user
30
+
31
+ @app.post("/quill")
32
+ async def quill_post(data: Request, user: dict = Depends(authenticate_jwt)):
33
+ # assuming user fetched via auth middleware has an userId
34
+ user_id = user["user_id"]
35
+ body = await data.json()
36
+ metadata = body.get("metadata")
37
+
38
+ result = quill.query(
39
+ tenants=[{"tenantField": "user_id", "tenantIds": [user_id]}],
40
+ metadata=metadata
41
+ )
42
+ return result
43
+ ```
44
+
45
+ Then you can run your app like normally. Pass in this route to our react library
46
+ on the frontend and you all set!
@@ -0,0 +1,5 @@
1
+ # __init__.py
2
+
3
+ from .core import Quill
4
+ from .error import PgQueryError
5
+ from .utils import Filter, FilterType, FieldType, StringOperator, DateOperator, NumberOperator, NullOperator
@@ -0,0 +1,3 @@
1
+ # __init__.py
2
+
3
+ from .pgtypes import PG_TYPES