json-database 0.9.1__tar.gz → 0.10.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 (20) hide show
  1. {json_database-0.9.1 → json_database-0.10.0}/PKG-INFO +1 -1
  2. {json_database-0.9.1 → json_database-0.10.0}/json_database/hpm.py +12 -3
  3. {json_database-0.9.1 → json_database-0.10.0}/json_database/version.py +2 -2
  4. {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/PKG-INFO +1 -1
  5. {json_database-0.9.1 → json_database-0.10.0}/LICENSE +0 -0
  6. {json_database-0.9.1 → json_database-0.10.0}/README.md +0 -0
  7. {json_database-0.9.1 → json_database-0.10.0}/json_database/__init__.py +0 -0
  8. {json_database-0.9.1 → json_database-0.10.0}/json_database/crypto.py +0 -0
  9. {json_database-0.9.1 → json_database-0.10.0}/json_database/exceptions.py +0 -0
  10. {json_database-0.9.1 → json_database-0.10.0}/json_database/search.py +0 -0
  11. {json_database-0.9.1 → json_database-0.10.0}/json_database/utils.py +0 -0
  12. {json_database-0.9.1 → json_database-0.10.0}/json_database/xdg_utils.py +0 -0
  13. {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/SOURCES.txt +0 -0
  14. {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/dependency_links.txt +0 -0
  15. {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/entry_points.txt +0 -0
  16. {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/requires.txt +0 -0
  17. {json_database-0.9.1 → json_database-0.10.0}/json_database.egg-info/top_level.txt +0 -0
  18. {json_database-0.9.1 → json_database-0.10.0}/setup.cfg +0 -0
  19. {json_database-0.9.1 → json_database-0.10.0}/setup.py +0 -0
  20. {json_database-0.9.1 → json_database-0.10.0}/test/test_crypto.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json_database
3
- Version: 0.9.1
3
+ Version: 0.10.0
4
4
  Summary: searchable json database with persistence
5
5
  Home-page: https://github.com/TigreGotico/json_database
6
6
  Author: jarbasAI
@@ -1,8 +1,8 @@
1
1
  from hivemind_plugin_manager.database import Client, AbstractDB, cast2client
2
2
  from ovos_utils.log import LOG
3
3
  from ovos_utils.xdg_utils import xdg_data_home
4
- from typing import Union, Iterable, List
5
- from json_database import JsonStorageXDG
4
+ from typing import Union, Iterable, List, Optional
5
+ from json_database import JsonStorageXDG, EncryptedJsonStorageXD
6
6
  from dataclasses import dataclass
7
7
 
8
8
 
@@ -11,9 +11,18 @@ class JsonDB(AbstractDB):
11
11
  """HiveMind Database implementation using JSON files."""
12
12
  name: str = "clients"
13
13
  subfolder: str = "hivemind-core"
14
+ password: Optional[str] = None
14
15
 
15
16
  def __post_init__(self):
16
- self._db = JsonStorageXDG(self.name, subfolder=self.subfolder, xdg_folder=xdg_data_home())
17
+ if self.password:
18
+ self._db = EncryptedJsonStorageXDG(encrypt_key=self.password,
19
+ name=self.name,
20
+ subfolder=self.subfolder,
21
+ xdg_folder=xdg_data_home())
22
+ else:
23
+ self._db = JsonStorageXDG(self.name,
24
+ subfolder=self.subfolder,
25
+ xdg_folder=xdg_data_home())
17
26
  LOG.debug(f"json database path: {self._db.path}")
18
27
 
19
28
  def sync(self):
@@ -1,6 +1,6 @@
1
1
  # START_VERSION_BLOCK
2
2
  VERSION_MAJOR = 0
3
- VERSION_MINOR = 9
4
- VERSION_BUILD = 1
3
+ VERSION_MINOR = 10
4
+ VERSION_BUILD = 0
5
5
  VERSION_ALPHA = 0
6
6
  # END_VERSION_BLOCK
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: json-database
3
- Version: 0.9.1
3
+ Version: 0.10.0
4
4
  Summary: searchable json database with persistence
5
5
  Home-page: https://github.com/TigreGotico/json_database
6
6
  Author: jarbasAI
File without changes
File without changes
File without changes
File without changes