aldict 1.0.1__tar.gz → 1.0.3__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.
- {aldict-1.0.1 → aldict-1.0.3}/PKG-INFO +10 -9
- {aldict-1.0.1 → aldict-1.0.3}/README.md +6 -6
- {aldict-1.0.1 → aldict-1.0.3}/aldict/alias_dict.py +3 -3
- {aldict-1.0.1 → aldict-1.0.3}/aldict.egg-info/PKG-INFO +10 -9
- {aldict-1.0.1 → aldict-1.0.3}/pyproject.toml +2 -2
- {aldict-1.0.1 → aldict-1.0.3}/tests/test_alias_dict.py +1 -1
- {aldict-1.0.1 → aldict-1.0.3}/LICENSE +0 -0
- {aldict-1.0.1 → aldict-1.0.3}/aldict/__init__.py +0 -0
- {aldict-1.0.1 → aldict-1.0.3}/aldict/exception.py +0 -0
- {aldict-1.0.1 → aldict-1.0.3}/aldict.egg-info/SOURCES.txt +0 -0
- {aldict-1.0.1 → aldict-1.0.3}/aldict.egg-info/dependency_links.txt +0 -0
- {aldict-1.0.1 → aldict-1.0.3}/aldict.egg-info/requires.txt +0 -0
- {aldict-1.0.1 → aldict-1.0.3}/aldict.egg-info/top_level.txt +0 -0
- {aldict-1.0.1 → aldict-1.0.3}/setup.cfg +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: aldict
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
|
|
5
5
|
Author-email: Kaloyan Ivanov <kaloyan.ivanov88@gmail.com>
|
|
6
6
|
Project-URL: repository, https://github.com/kaliv0/aldict
|
|
7
7
|
Keywords: multi-key dictionary,multidict,alias-dict
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Provides-Extra: dev
|
|
@@ -13,6 +13,7 @@ Requires-Dist: pytest>=8.3.4; extra == "dev"
|
|
|
13
13
|
Requires-Dist: ruff>=0.8.3; extra == "dev"
|
|
14
14
|
Requires-Dist: build>=1.2.2; extra == "dev"
|
|
15
15
|
Requires-Dist: twine>=6.0.1; extra == "dev"
|
|
16
|
+
Dynamic: license-file
|
|
16
17
|
|
|
17
18
|
<p align="center">
|
|
18
19
|
<img src="https://github.com/kaliv0/aldict/blob/main/assets/alter-ego.jpg?raw=true" width="250" alt="Alter Ego">
|
|
@@ -22,9 +23,10 @@ Requires-Dist: twine>=6.0.1; extra == "dev"
|
|
|
22
23
|
# Aldict
|
|
23
24
|
|
|
24
25
|
[](https://github.com/kaliv0/aldict/actions/workflows/ci.yml)
|
|
25
|
-

|
|
26
27
|
[](https://pypi.org/project/aldict/)
|
|
27
28
|
[](https://github.com/kaliv0/aldict/blob/main/LICENSE)
|
|
29
|
+
[](https://pepy.tech/projects/aldict)
|
|
28
30
|
|
|
29
31
|
Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
|
|
30
32
|
|
|
@@ -86,11 +88,10 @@ ad.add_alias("y", "Yy", "xyz")
|
|
|
86
88
|
ad.keys()
|
|
87
89
|
ad.values()
|
|
88
90
|
ad.items()
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
dict_items([('x', 10), ('y', 20), ('Xx', 10), ('Yy', 20), ('xyz', 20)])
|
|
91
|
+
|
|
92
|
+
# dict_keys(['x', 'y', 'Xx', 'Yy', 'xyz'])
|
|
93
|
+
# dict_values([10, 20])
|
|
94
|
+
# dict_items([('x', 10), ('y', 20), ('Xx', 10), ('Yy', 20), ('xyz', 20)])
|
|
94
95
|
```
|
|
95
96
|
- remove key and aliases
|
|
96
97
|
```python
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
# Aldict
|
|
7
7
|
|
|
8
8
|
[](https://github.com/kaliv0/aldict/actions/workflows/ci.yml)
|
|
9
|
-

|
|
10
10
|
[](https://pypi.org/project/aldict/)
|
|
11
11
|
[](https://github.com/kaliv0/aldict/blob/main/LICENSE)
|
|
12
|
+
[](https://pepy.tech/projects/aldict)
|
|
12
13
|
|
|
13
14
|
Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
|
|
14
15
|
|
|
@@ -70,11 +71,10 @@ ad.add_alias("y", "Yy", "xyz")
|
|
|
70
71
|
ad.keys()
|
|
71
72
|
ad.values()
|
|
72
73
|
ad.items()
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
dict_items([('x', 10), ('y', 20), ('Xx', 10), ('Yy', 20), ('xyz', 20)])
|
|
74
|
+
|
|
75
|
+
# dict_keys(['x', 'y', 'Xx', 'Yy', 'xyz'])
|
|
76
|
+
# dict_values([10, 20])
|
|
77
|
+
# dict_items([('x', 10), ('y', 20), ('Xx', 10), ('Yy', 20), ('xyz', 20)])
|
|
78
78
|
```
|
|
79
79
|
- remove key and aliases
|
|
80
80
|
```python
|
|
@@ -81,10 +81,10 @@ class AliasDict(UserDict):
|
|
|
81
81
|
def __delitem__(self, key):
|
|
82
82
|
try:
|
|
83
83
|
self.data.__delitem__(key)
|
|
84
|
+
self._alias_dict = {k: v for k, v in self._alias_dict.items() if v != key}
|
|
84
85
|
except KeyError:
|
|
85
|
-
# in case we try to delete alias
|
|
86
|
-
|
|
87
|
-
self._alias_dict = {k: v for k, v in self._alias_dict.items() if v != key}
|
|
86
|
+
# in case we try to delete alias via pop() or del
|
|
87
|
+
return self.remove_alias(key)
|
|
88
88
|
|
|
89
89
|
def __contains__(self, item):
|
|
90
90
|
return item in set(self.keys())
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: aldict
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.3
|
|
4
4
|
Summary: Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
|
|
5
5
|
Author-email: Kaloyan Ivanov <kaloyan.ivanov88@gmail.com>
|
|
6
6
|
Project-URL: repository, https://github.com/kaliv0/aldict
|
|
7
7
|
Keywords: multi-key dictionary,multidict,alias-dict
|
|
8
|
-
Requires-Python: >=3.
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
9
|
Description-Content-Type: text/markdown
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
Provides-Extra: dev
|
|
@@ -13,6 +13,7 @@ Requires-Dist: pytest>=8.3.4; extra == "dev"
|
|
|
13
13
|
Requires-Dist: ruff>=0.8.3; extra == "dev"
|
|
14
14
|
Requires-Dist: build>=1.2.2; extra == "dev"
|
|
15
15
|
Requires-Dist: twine>=6.0.1; extra == "dev"
|
|
16
|
+
Dynamic: license-file
|
|
16
17
|
|
|
17
18
|
<p align="center">
|
|
18
19
|
<img src="https://github.com/kaliv0/aldict/blob/main/assets/alter-ego.jpg?raw=true" width="250" alt="Alter Ego">
|
|
@@ -22,9 +23,10 @@ Requires-Dist: twine>=6.0.1; extra == "dev"
|
|
|
22
23
|
# Aldict
|
|
23
24
|
|
|
24
25
|
[](https://github.com/kaliv0/aldict/actions/workflows/ci.yml)
|
|
25
|
-

|
|
26
27
|
[](https://pypi.org/project/aldict/)
|
|
27
28
|
[](https://github.com/kaliv0/aldict/blob/main/LICENSE)
|
|
29
|
+
[](https://pepy.tech/projects/aldict)
|
|
28
30
|
|
|
29
31
|
Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values
|
|
30
32
|
|
|
@@ -86,11 +88,10 @@ ad.add_alias("y", "Yy", "xyz")
|
|
|
86
88
|
ad.keys()
|
|
87
89
|
ad.values()
|
|
88
90
|
ad.items()
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
dict_items([('x', 10), ('y', 20), ('Xx', 10), ('Yy', 20), ('xyz', 20)])
|
|
91
|
+
|
|
92
|
+
# dict_keys(['x', 'y', 'Xx', 'Yy', 'xyz'])
|
|
93
|
+
# dict_values([10, 20])
|
|
94
|
+
# dict_items([('x', 10), ('y', 20), ('Xx', 10), ('Yy', 20), ('xyz', 20)])
|
|
94
95
|
```
|
|
95
96
|
- remove key and aliases
|
|
96
97
|
```python
|
|
@@ -4,14 +4,14 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "aldict"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.3"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
authors = [{ name = "Kaloyan Ivanov", email = "kaloyan.ivanov88@gmail.com" }]
|
|
10
10
|
description = "Multi-key dictionary, supports adding and manipulating key-aliases pointing to shared values"
|
|
11
11
|
keywords = ["multi-key dictionary", "multidict", "alias-dict"]
|
|
12
12
|
urls = { repository = "https://github.com/kaliv0/aldict" }
|
|
13
13
|
|
|
14
|
-
requires-python = ">= 3.
|
|
14
|
+
requires-python = ">= 3.10"
|
|
15
15
|
|
|
16
16
|
[project.optional-dependencies]
|
|
17
17
|
dev = [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|