databutton 0.38.3__tar.gz → 0.38.11__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 (31) hide show
  1. {databutton-0.38.3 → databutton-0.38.11}/PKG-INFO +2 -4
  2. {databutton-0.38.3 → databutton-0.38.11}/README.md +0 -2
  3. {databutton-0.38.3 → databutton-0.38.11}/databutton/__init__.py +1 -2
  4. {databutton-0.38.3 → databutton-0.38.11}/databutton/experimental/auth/get_user.py +3 -3
  5. {databutton-0.38.3 → databutton-0.38.11}/databutton/experimental/folder/folder.py +1 -1
  6. {databutton-0.38.3 → databutton-0.38.11}/databutton/version.py +1 -1
  7. {databutton-0.38.3 → databutton-0.38.11}/pyproject.toml +3 -3
  8. databutton-0.38.3/databutton/rag/__init__.py +0 -5
  9. databutton-0.38.3/databutton/rag/chroma.py +0 -35
  10. {databutton-0.38.3 → databutton-0.38.11}/LICENSE +0 -0
  11. {databutton-0.38.3 → databutton-0.38.11}/databutton/cachetools.py +0 -0
  12. {databutton-0.38.3 → databutton-0.38.11}/databutton/experimental/__init__.py +0 -0
  13. {databutton-0.38.3 → databutton-0.38.11}/databutton/experimental/auth/__init__.py +0 -0
  14. {databutton-0.38.3 → databutton-0.38.11}/databutton/experimental/folder/__init__.py +0 -0
  15. {databutton-0.38.3 → databutton-0.38.11}/databutton/internal/__init__.py +0 -0
  16. {databutton-0.38.3 → databutton-0.38.11}/databutton/internal/auth.py +0 -0
  17. {databutton-0.38.3 → databutton-0.38.11}/databutton/internal/byteutils.py +0 -0
  18. {databutton-0.38.3 → databutton-0.38.11}/databutton/internal/dbapiclient.py +0 -0
  19. {databutton-0.38.3 → databutton-0.38.11}/databutton/internal/httpxclient.py +0 -0
  20. {databutton-0.38.3 → databutton-0.38.11}/databutton/internal/performedby.py +0 -0
  21. {databutton-0.38.3 → databutton-0.38.11}/databutton/internal/retries.py +0 -0
  22. {databutton-0.38.3 → databutton-0.38.11}/databutton/jobs/__init__.py +0 -0
  23. {databutton-0.38.3 → databutton-0.38.11}/databutton/jobs/run.py +0 -0
  24. {databutton-0.38.3 → databutton-0.38.11}/databutton/notify/__init__.py +0 -0
  25. {databutton-0.38.3 → databutton-0.38.11}/databutton/notify/email.py +0 -0
  26. {databutton-0.38.3 → databutton-0.38.11}/databutton/notify/send.py +0 -0
  27. {databutton-0.38.3 → databutton-0.38.11}/databutton/pydantic_v1/__init__.py +0 -0
  28. {databutton-0.38.3 → databutton-0.38.11}/databutton/secrets/__init__.py +0 -0
  29. {databutton-0.38.3 → databutton-0.38.11}/databutton/secrets/secrets.py +0 -0
  30. {databutton-0.38.3 → databutton-0.38.11}/databutton/storage/__init__.py +0 -0
  31. {databutton-0.38.3 → databutton-0.38.11}/databutton/storage/storage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: databutton
3
- Version: 0.38.3
3
+ Version: 0.38.11
4
4
  Summary: The CLI for databutton.com
5
5
  License: Databutton
6
6
  Author: Databutton
@@ -13,8 +13,8 @@ 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)
17
16
  Requires-Dist: cryptography (>=40.0.1,<41.0.0)
17
+ Requires-Dist: fastapi
18
18
  Requires-Dist: httpx (>=0.20.0,<1)
19
19
  Requires-Dist: pandas[feather] (>=0.25,<3)
20
20
  Requires-Dist: pydantic (>=1,<3)
@@ -89,5 +89,3 @@ To test in another package, you can simply
89
89
 
90
90
  All rights reserved.
91
91
 
92
-
93
-
@@ -65,5 +65,3 @@ To test in another package, you can simply
65
65
  ## License: Copyright (c) Databutton
66
66
 
67
67
  All rights reserved.
68
-
69
-
@@ -5,7 +5,7 @@ Create data apps
5
5
  .. moduleauthor:: Databutton <support@databutton.com>
6
6
  """
7
7
 
8
- from . import experimental, notify, pydantic_v1, rag, secrets, storage
8
+ from . import experimental, notify, pydantic_v1, secrets, storage
9
9
  from .cachetools import cache, clear_cache
10
10
  from .version import __version__
11
11
 
@@ -16,7 +16,6 @@ __all__ = [
16
16
  "storage",
17
17
  "cache",
18
18
  "clear_cache",
19
- "rag",
20
19
  "__version__",
21
20
  "experimental",
22
21
  ]
@@ -1,8 +1,8 @@
1
1
  import re
2
2
  from datetime import datetime, timedelta
3
3
 
4
+ import httpx
4
5
  import jwt
5
- import requests
6
6
  from cryptography.x509 import load_pem_x509_certificate
7
7
  from fastapi import HTTPException, Request, status
8
8
  from pydantic import BaseModel
@@ -17,11 +17,11 @@ class GooglePublicKeySet:
17
17
 
18
18
  def get_keys(self):
19
19
  # Load certs from Google
20
- response = requests.get(
20
+ response = httpx.get(
21
21
  "https://www.googleapis.com/robot/v1/metadata/x509/securetoken@system.gserviceaccount.com"
22
22
  )
23
23
 
24
- x509_certs = response.json()
24
+ x509_certs: dict = response.json()
25
25
 
26
26
  # Extract the public keys
27
27
  keys = {}
@@ -42,6 +42,6 @@ def upload(key: str, folder_path: str):
42
42
  def download(key: str, folder_path: str):
43
43
  """Download and unzip a folder from blob storage."""
44
44
  normalized_folder_path = normalize_path(folder_path)
45
- zipped_bytes = db.storage.binary.get(key, default=lambda: None)
45
+ zipped_bytes = db.storage.binary.get(key, default=None)
46
46
  if zipped_bytes is not None:
47
47
  unzip_bytes_to_folder(zipped_bytes, normalized_folder_path.as_posix())
@@ -5,4 +5,4 @@ This module contains project version information.
5
5
  .. moduleauthor:: Databutton <support@databutton.com>
6
6
  """
7
7
 
8
- __version__ = "0.38.3"
8
+ __version__ = "0.38.11"
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "databutton"
3
- version = "0.38.3"
3
+ version = "0.38.11"
4
4
  description = "The CLI for databutton.com"
5
5
  authors = ["Databutton <hi@databutton.io>"]
6
6
  license = "Databutton"
@@ -17,7 +17,7 @@ PyYAML = "^6.0"
17
17
  tenacity = "^8.0.0"
18
18
  cryptography = "^40.0.1"
19
19
  certifi = "^2022.12.7"
20
- chromadb = "^0.4.22"
20
+ fastapi = "*"
21
21
 
22
22
  [tool.poetry.group.dev.dependencies]
23
23
  mypy = "^1.2.0"
@@ -30,7 +30,7 @@ isort = "^5.12.0"
30
30
  python-semantic-release = "7.28.1"
31
31
  pytest-mock = "^3.7.0"
32
32
  pandas-stubs = "^1.5.2.221124"
33
- ruff = "^0.3.0"
33
+ ruff = "^0.4.0"
34
34
  types-pyjwt = "^1.7.1"
35
35
 
36
36
  [build-system]
@@ -1,5 +0,0 @@
1
- from .chroma import Chroma
2
-
3
- chroma = Chroma()
4
-
5
- __all__ = ["chroma"]
@@ -1,35 +0,0 @@
1
- import os
2
- import shutil
3
-
4
- import chromadb
5
-
6
- import databutton as db
7
-
8
-
9
- class Chroma:
10
- path = ".tmp/chroma/"
11
- file_path = "path/chroma.sqlite3"
12
-
13
- def __init__(self):
14
- pass
15
-
16
- def persist(self):
17
- shutil.make_archive("chroma", "zip", self.path)
18
- with open("chroma.zip", "rb") as file:
19
- db.storage.binary.put("chromadb", file.read())
20
-
21
- def client(self):
22
- # if local file doesn't exists, try to fetch it
23
- if not os.path.exists(self.file_path):
24
- try:
25
- stream = db.storage.binary.get("chromadb")
26
- with open(".tmp/chroma/chroma.zip", "wb") as file:
27
- file.write(stream)
28
- shutil.unpack_archive("chroma.zip", self.path)
29
- except FileNotFoundError:
30
- pass
31
- # Instigate the client
32
- the_client = chromadb.PersistentClient(self.path)
33
- the_client.persist = self.persist
34
-
35
- return the_client
File without changes