scruby 2.3.3__py3-none-any.whl → 2.3.5__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.
scruby/utils.py CHANGED
@@ -19,12 +19,10 @@ class Utils:
19
19
  dotenv_path: Path | str = ".env",
20
20
  ) -> str | None:
21
21
  """Get value by key from .env file."""
22
- assert len(key) > 0, "`get_from_env` => `key` must not be the empty string."
22
+ assert len(key) > 0, "Utils - `get_from_env` => `key` must not be the empty string."
23
23
 
24
24
  value: str | None = None
25
-
26
- if isinstance(dotenv_path, str):
27
- dotenv_path = Path(dotenv_path)
25
+ dotenv_path = Path(dotenv_path)
28
26
 
29
27
  if dotenv_path.exists():
30
28
  env_dict: dict[str, str | None] = dotenv_values(dotenv_path)
@@ -39,12 +37,10 @@ class Utils:
39
37
  dotenv_path: Path | str = ".env",
40
38
  ) -> str | None:
41
39
  """Add key-value to .env file."""
42
- assert len(key) > 0, "`add_to_env` => `key` must not be the empty string."
43
- assert len(value) > 0, "`add_to_env` => `value` must not be the empty string."
40
+ assert len(key) > 0, "Utils - `add_to_env` => `key` must not be the empty string."
41
+ assert len(value) > 0, "Utils - `add_to_env` => `value` must not be the empty string."
44
42
 
45
- if isinstance(dotenv_path, str):
46
- assert len(dotenv_path) > 0, "`add_to_env` => `dotenv_path` must not be the empty string."
47
- dotenv_path = Path(dotenv_path)
43
+ dotenv_path = Path(dotenv_path)
48
44
 
49
45
  if dotenv_path.exists():
50
46
  env_dict: dict[str, str | None] = dotenv_values(dotenv_path)
@@ -67,11 +63,11 @@ class Utils:
67
63
  def db_collection_list(db_root: Path | str) -> list[str] | None:
68
64
  """Get a list of collections from a database directory."""
69
65
  if isinstance(db_root, str):
70
- assert len(db_root) > 0, "`add_to_env` => `dotenv_path` must not be the empty string."
71
- db_root = Path(db_root)
66
+ assert len(db_root) > 0, "Utils - `db_collection_list` => `db_root` must not be the empty string."
72
67
 
68
+ db_dir_path = Path(db_root)
73
69
  directory_names: list[str] | None = None
74
- if db_root.exists():
75
- all_entries = Path.iterdir(db_root)
70
+ if db_dir_path.exists():
71
+ all_entries = Path.iterdir(db_dir_path)
76
72
  directory_names = [entry.name for entry in all_entries if entry.name != ".env.meta"] or None
77
73
  return directory_names
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scruby
3
- Version: 2.3.3
3
+ Version: 2.3.5
4
4
  Summary: Asynchronous library for building and managing a hybrid database, by scheme of key-value.
5
5
  Project-URL: Bug Tracker, https://github.com/kebasyaty/scruby/issues
6
6
  Project-URL: Changelog, https://github.com/kebasyaty/scruby/blob/v2/CHANGELOG.md
@@ -41,9 +41,9 @@ Description-Content-Type: text/markdown
41
41
  <p align="center">
42
42
  <a href="https://github.com/kebasyaty/scruby">
43
43
  <img
44
- height="80"
44
+ width="100%"
45
45
  alt="Logo"
46
- src="https://raw.githubusercontent.com/kebasyaty/scruby/v2/assets/logo.svg">
46
+ src="https://raw.githubusercontent.com/kebasyaty/scruby/v2/assets/logo.jpg">
47
47
  </a>
48
48
  </p>
49
49
  <p>
@@ -94,7 +94,7 @@ Description-Content-Type: text/markdown
94
94
  <br>
95
95
  6 = 256 branches in collection -> Docs: ~256000+, RAM: ~4G+, CPU: ~2+ (for small projects).
96
96
  <br>
97
- 5 = 4096 branches in collection -> Docs: ~4096000+, RAM: ~6G+, CPU: ~3+ (for large projects).
97
+ 5 = 4096 branches in collection -> Docs: ~4096000+, RAM: ~6G+, CPU: ~4+ (for large projects).
98
98
  <br>
99
99
  0 = 4294967296 branches in collection -> Docs: ~4,294967296×10¹²+, RAM: ~2G+, CPU: ~2+ (access only by keys).
100
100
  <br>
@@ -7,7 +7,7 @@ scruby/errors.py,sha256=lTWiHzyO5Es9Nkf7quODJjONGn6ifcL95qlpA4epQQM,1386
7
7
  scruby/meta.py,sha256=dfr8q3TWhVcEl-lZuH5yd9rbO9vAPBhXBO3VYCNcOWo,1283
8
8
  scruby/model.py,sha256=1infUd1G-zxj5Z93mNOp1Wi2anD6TKDgu5Y0KEVcH2k,292
9
9
  scruby/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- scruby/utils.py,sha256=fCBBrp-tgRKh4bukjWRUQhkOsNCxGN4lbXcymBqCsbE,2587
10
+ scruby/utils.py,sha256=l-UNz_DEuYEx6vS8ExgFGzbueQ6RwencClZQUr3VReo,2437
11
11
  scruby/mixins/__init__.py,sha256=nT79e80zXliuTGhR9CFosI2-3PQUCKwXbR7wPiFwgrU,669
12
12
  scruby/mixins/collection.py,sha256=3Gn9zIT-WnSCBd-IgpE9tobRlW675YX__qaWoUOWIJM,1758
13
13
  scruby/mixins/count.py,sha256=CGpyOpsG25uC5utI2ByNxq2iTbJocj6w5tXrC1_cP40,2561
@@ -16,8 +16,8 @@ scruby/mixins/delete.py,sha256=InKVIud_ZYx9-CchUz_IygQDXMynNi4jQ0HKYeHC_R8,4328
16
16
  scruby/mixins/find.py,sha256=oEZRE6RqIBdwvNr8iSYyod8hI6ibi_egJP0pyXmJiss,9169
17
17
  scruby/mixins/keys.py,sha256=MvBy_8fQGROaQATK2qse2V8wR-xodPQG0KKZ2PK_t9U,10790
18
18
  scruby/mixins/update.py,sha256=TyxvxB-gNijlfzTmhwrq0ydvu0C3R-RihW5h5tJ96bM,4964
19
- scruby-2.3.3.dist-info/METADATA,sha256=cbgz5lMrrCu5nbgYLfi4OqpJOBtULVS2bDPWqI5NdwU,13430
20
- scruby-2.3.3.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
21
- scruby-2.3.3.dist-info/licenses/GPL-3.0-LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
22
- scruby-2.3.3.dist-info/licenses/MIT-LICENSE,sha256=mS0Wz0yGNB63gEcWEnuIb_lldDYV0sjRaO-o_GL6CWE,1074
23
- scruby-2.3.3.dist-info/RECORD,,
19
+ scruby-2.3.5.dist-info/METADATA,sha256=eiu-i8ExH0czoWqbB7dGIwl00atZat8f62PNUSM5fJc,13431
20
+ scruby-2.3.5.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
21
+ scruby-2.3.5.dist-info/licenses/GPL-3.0-LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
22
+ scruby-2.3.5.dist-info/licenses/MIT-LICENSE,sha256=mS0Wz0yGNB63gEcWEnuIb_lldDYV0sjRaO-o_GL6CWE,1074
23
+ scruby-2.3.5.dist-info/RECORD,,
File without changes