databutton 0.36.10__tar.gz → 0.36.12__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 (27) hide show
  1. {databutton-0.36.10 → databutton-0.36.12}/PKG-INFO +3 -1
  2. {databutton-0.36.10 → databutton-0.36.12}/README.md +1 -0
  3. {databutton-0.36.10 → databutton-0.36.12}/databutton/__init__.py +2 -1
  4. databutton-0.36.12/databutton/rag/__init__.py +5 -0
  5. databutton-0.36.12/databutton/rag/chroma.py +33 -0
  6. {databutton-0.36.10 → databutton-0.36.12}/databutton/version.py +1 -1
  7. {databutton-0.36.10 → databutton-0.36.12}/pyproject.toml +3 -2
  8. {databutton-0.36.10 → databutton-0.36.12}/LICENSE +0 -0
  9. {databutton-0.36.10 → databutton-0.36.12}/databutton/cachetools.py +0 -0
  10. {databutton-0.36.10 → databutton-0.36.12}/databutton/internal/__init__.py +0 -0
  11. {databutton-0.36.10 → databutton-0.36.12}/databutton/internal/auth.py +0 -0
  12. {databutton-0.36.10 → databutton-0.36.12}/databutton/internal/byteutils.py +0 -0
  13. {databutton-0.36.10 → databutton-0.36.12}/databutton/internal/dbapiclient.py +0 -0
  14. {databutton-0.36.10 → databutton-0.36.12}/databutton/internal/headers.py +0 -0
  15. {databutton-0.36.10 → databutton-0.36.12}/databutton/internal/httpxclient.py +0 -0
  16. {databutton-0.36.10 → databutton-0.36.12}/databutton/internal/performedby.py +0 -0
  17. {databutton-0.36.10 → databutton-0.36.12}/databutton/internal/retries.py +0 -0
  18. {databutton-0.36.10 → databutton-0.36.12}/databutton/jobs/__init__.py +0 -0
  19. {databutton-0.36.10 → databutton-0.36.12}/databutton/jobs/run.py +0 -0
  20. {databutton-0.36.10 → databutton-0.36.12}/databutton/notify/__init__.py +0 -0
  21. {databutton-0.36.10 → databutton-0.36.12}/databutton/notify/email.py +0 -0
  22. {databutton-0.36.10 → databutton-0.36.12}/databutton/notify/send.py +0 -0
  23. {databutton-0.36.10 → databutton-0.36.12}/databutton/secrets/__init__.py +0 -0
  24. {databutton-0.36.10 → databutton-0.36.12}/databutton/secrets/secrets.py +0 -0
  25. {databutton-0.36.10 → databutton-0.36.12}/databutton/storage/__init__.py +0 -0
  26. {databutton-0.36.10 → databutton-0.36.12}/databutton/storage/storage.py +0 -0
  27. {databutton-0.36.10 → databutton-0.36.12}/databutton/user.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: databutton
3
- Version: 0.36.10
3
+ Version: 0.36.12
4
4
  Summary: The CLI for databutton.com
5
5
  License: Databutton
6
6
  Author: Databutton
@@ -13,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.11
13
13
  Requires-Dist: PyJWT (>=2.2.0,<3.0.0)
14
14
  Requires-Dist: PyYAML (>=6.0,<7.0)
15
15
  Requires-Dist: certifi (>=2022.12.7,<2023.0.0)
16
+ Requires-Dist: chromadb (>=0.4.22,<0.5.0)
16
17
  Requires-Dist: cryptography (>=40.0.1,<41.0.0)
17
18
  Requires-Dist: httpx (>=0.20.0,<1)
18
19
  Requires-Dist: pandas (>=0.25,<3)
@@ -29,6 +30,7 @@ Description-Content-Type: text/markdown
29
30
 
30
31
 
31
32
 
33
+
32
34
  The CLI for building and deploying databutton projects
33
35
 
34
36
  ## Getting Started
@@ -6,6 +6,7 @@
6
6
 
7
7
 
8
8
 
9
+
9
10
  The CLI for building and deploying databutton projects
10
11
 
11
12
  ## Getting Started
@@ -5,7 +5,7 @@ Create data apps
5
5
  .. moduleauthor:: Databutton <support@databutton.com>
6
6
  """
7
7
 
8
- from . import notify, secrets, storage, user
8
+ from . import notify, secrets, storage, user, rag
9
9
  from .cachetools import cache, clear_cache
10
10
  from .version import __version__
11
11
 
@@ -16,5 +16,6 @@ __all__ = [
16
16
  "storage",
17
17
  "cache",
18
18
  "clear_cache",
19
+ "rag",
19
20
  "__version__",
20
21
  ]
@@ -0,0 +1,5 @@
1
+ from .chroma import Chroma
2
+
3
+ chroma = Chroma()
4
+
5
+ __all__ = ["chroma"]
@@ -0,0 +1,33 @@
1
+ import chromadb
2
+ import os
3
+ import shutil
4
+ import databutton as db
5
+
6
+
7
+ class Chroma:
8
+ path = ".tmp/chroma/"
9
+ file_path = "path/chroma.sqlite3"
10
+
11
+ def __init__(self):
12
+ pass
13
+
14
+ def persist(self):
15
+ shutil.make_archive("chroma", "zip", self.path)
16
+ with open("chroma.zip", "rb") as file:
17
+ db.storage.binary.put("chromadb", file.read())
18
+
19
+ def client(self):
20
+ # if local file doesn't exists, try to fetch it
21
+ if not os.path.exists(self.file_path):
22
+ try:
23
+ stream = db.storage.binary.get("chromadb")
24
+ with open(".tmp/chroma/chroma.zip", "wb") as file:
25
+ file.write(stream)
26
+ shutil.unpack_archive("chroma.zip", self.path)
27
+ except FileNotFoundError:
28
+ pass
29
+ # Instigate the client
30
+ the_client = chromadb.PersistentClient(self.path)
31
+ the_client.persist = self.persist
32
+
33
+ return the_client
@@ -5,4 +5,4 @@ This module contains project version information.
5
5
  .. moduleauthor:: Databutton <support@databutton.com>
6
6
  """
7
7
 
8
- __version__ = "0.36.10"
8
+ __version__ = "0.36.12"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "databutton"
3
- version = "0.36.10"
3
+ version = "0.36.12"
4
4
  description = "The CLI for databutton.com"
5
5
  authors = ["Databutton <hi@databutton.io>"]
6
6
  license = "Databutton"
@@ -18,6 +18,7 @@ tenacity = "^8.0.0"
18
18
  cryptography = "^40.0.1"
19
19
  certifi = "^2022.12.7"
20
20
  streamlit = "^1.20.0"
21
+ chromadb = "^0.4.22"
21
22
 
22
23
  [tool.poetry.group.dev.dependencies]
23
24
  mypy = "^1.2.0"
@@ -30,7 +31,7 @@ isort = "^5.12.0"
30
31
  python-semantic-release = "7.28.1"
31
32
  pytest-mock = "^3.7.0"
32
33
  pandas-stubs = "^1.5.2.221124"
33
- ruff = "^0.1.0"
34
+ ruff = "^0.2.0"
34
35
  streamlit = "^1.21.0"
35
36
 
36
37
  [build-system]
File without changes