databutton 0.36.10__py3-none-any.whl → 0.36.12__py3-none-any.whl

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.
databutton/__init__.py CHANGED
@@ -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
databutton/version.py CHANGED
@@ -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
  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
@@ -1,4 +1,4 @@
1
- databutton/__init__.py,sha256=Dfi2yshPIb5991i4FJ0Ly-FRDqPQKVu5cYAU3dyPT3o,354
1
+ databutton/__init__.py,sha256=VTlMJ0fUvTLKj5hsVjaf1wwlKMv72QVg_bUsQwUQpyI,370
2
2
  databutton/cachetools.py,sha256=soq0BDkE_YNaybBx-fI4pJ1x8k9KuotZ0f_OuZCCI9k,3554
3
3
  databutton/internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  databutton/internal/auth.py,sha256=sQTtdyyWHcoDN7iUHFMqoj1Okk4NFeiWMoNnaFnHg5c,3205
@@ -13,13 +13,15 @@ databutton/jobs/run.py,sha256=Td0BSiIrYKiymDKVf8w5MT3C5uiwzeulYNJUGcxQk2k,632
13
13
  databutton/notify/__init__.py,sha256=p6x5D_8q-EXQHS4TuK7_Dli_PdBRPowrQjKOA1_TaVk,386
14
14
  databutton/notify/email.py,sha256=Yq7UD7D_g2epeIPchLIQXXcq61rZqqIzSfRxggK-sXg,12349
15
15
  databutton/notify/send.py,sha256=cj-TG0jwolEXwJJVxeBxwpfg_it03KoImUn30qAbbQE,749
16
+ databutton/rag/__init__.py,sha256=O_QGqsZGxDLE-HXoC7E3nwB1MuQwNpL0kTm21Y7an_k,68
17
+ databutton/rag/chroma.py,sha256=bBYEHMgV6EL0hWZyaDzAvfkSkhM_s5qicREZhsXJ-7U,956
16
18
  databutton/secrets/__init__.py,sha256=sI0okrfRBs2l5tcLTrKc9uUfPVVRMM9D7WED8p226tI,128
17
19
  databutton/secrets/secrets.py,sha256=pehXsD09iKTxHaNQJ6awvIHXgRXBJrf4Xhrc11ZUeOk,3427
18
20
  databutton/storage/__init__.py,sha256=7ZNd4eQQ7lYYIe1MqCuFbFF1aAVCuj2c_zmJfaPVlDY,252
19
21
  databutton/storage/storage.py,sha256=2qsszaYaagKUU08aDr6psexpHQlQP4i3TswdkijUZEY,20355
20
22
  databutton/user.py,sha256=QWyWV_G_bnfIJ9js2itOwBk4zqXgBUF9h8lf5mygef8,503
21
- databutton/version.py,sha256=uTcTwwqqzot55dsnp7e-vadYt9q5cASpLG9u4UOYVz4,176
22
- databutton-0.36.10.dist-info/LICENSE,sha256=c7h4pcVZapFEmqWoRTRv_S1P_aibrtDobqmlR-QtMUk,45
23
- databutton-0.36.10.dist-info/METADATA,sha256=4H-h9E241j4p69nbAeq4SP38etA2_PimKryK6kRkW_I,2753
24
- databutton-0.36.10.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
25
- databutton-0.36.10.dist-info/RECORD,,
23
+ databutton/version.py,sha256=h3tpMa_35SMqh9w2wb4wegJIcuJ4zv-YyQbRGvCbXb8,176
24
+ databutton-0.36.12.dist-info/LICENSE,sha256=c7h4pcVZapFEmqWoRTRv_S1P_aibrtDobqmlR-QtMUk,45
25
+ databutton-0.36.12.dist-info/METADATA,sha256=4oy8Bp7JhBCycCFCGgSkw_qk09KVKFenvp-JkV-QSqU,2796
26
+ databutton-0.36.12.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
27
+ databutton-0.36.12.dist-info/RECORD,,