Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Commit 3f22d2b

Browse files
committed
Released json-duplicate-keys v2023.11.26
1 parent 941652d commit 3f22d2b

File tree

5 files changed

+40
-30
lines changed

5 files changed

+40
-30
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*
2+
!/.gitignore
3+
!/LICENSE
4+
!/MANIFEST.in
5+
!/README.md
6+
!/requirements.txt
7+
!/SECURITY.md
8+
!/setup.py
9+
!/json_duplicate_keys/
10+
!/json_duplicate_keys/__init__.py
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
2-
3-
Copyright (c) 2022 Truoc Phan
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1+
MIT License
2+
3+
Copyright (c) 2022 Truoc Phan
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include requirements.txt

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,17 @@ Flatten/ Unflatten and Load(s)/ Dump(s) JSON File/ Object with Duplicate Keys
1717
</p>
1818

1919
## Installation
20+
#### From PyPI:
2021
```console
2122
pip install json-duplicate-keys
2223
```
24+
#### From Source:
25+
```console
26+
git clone https://github.com/truocphan/json-duplicate-keys.git
27+
cd json-duplicate-keys
28+
python setup.py build
29+
python setup.py install
30+
```
2331

2432
## Basic Usage
2533
### normalize_key(`name`, `dupSign_start`="{{{", `dupSign_end`="}}}", `_isDebug_`=False)
@@ -327,4 +335,4 @@ JDKSObject.unflatten()
327335
print(JDKSObject.getObject())
328336
# OUTPUT: {'author': 'truocphan', 'version': '22.3.3', 'version{{{_2_}}}': 'latest', 'release': [{'version': 'latest'}], 'snapshot': {'author': 'truocphan', 'version': '22.3.3', 'release': [{'version': 'latest'}]}}
329337
```
330-
---
338+
---

json_duplicate_keys/__init__.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
44
def normalize_key(name, dupSign_start="{{{", dupSign_end="}}}", _isDebug_=False):
55
import re
6-
import sys
76

87
# User input data type validation
98
if type(_isDebug_) != bool: _isDebug_ = False
@@ -32,7 +31,6 @@ def normalize_key(name, dupSign_start="{{{", dupSign_end="}}}", _isDebug_=False)
3231
def loads(Jstr, dupSign_start="{{{", dupSign_end="}}}", ordered_dict=False, _isDebug_=False):
3332
import json, re
3433
from collections import OrderedDict
35-
import sys
3634

3735
# User input data type validation
3836
if type(_isDebug_) != bool: _isDebug_ = False
@@ -192,7 +190,6 @@ def getObject(self):
192190
def get(self, name, separator="||", parse_index="$", _isDebug_=False):
193191
import re
194192
from collections import OrderedDict
195-
import sys
196193

197194
# User input data type validation
198195
if type(_isDebug_) != bool: _isDebug_ = False
@@ -243,7 +240,6 @@ def get(self, name, separator="||", parse_index="$", _isDebug_=False):
243240
def set(self, name, value, separator="||", parse_index="$", dupSign_start="{{{", dupSign_end="}}}", ordered_dict=False, _isDebug_=False):
244241
import re
245242
from collections import OrderedDict
246-
import sys
247243

248244
# User input data type validation
249245
if type(_isDebug_) != bool: _isDebug_ = False
@@ -374,7 +370,6 @@ def set(self, name, value, separator="||", parse_index="$", dupSign_start="{{{",
374370
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
375371
def update(self, name, value, separator="||", parse_index="$", _isDebug_=False):
376372
import re
377-
import sys
378373

379374
# User input data type validation
380375
if type(_isDebug_) != bool: _isDebug_ = False
@@ -414,7 +409,6 @@ def update(self, name, value, separator="||", parse_index="$", _isDebug_=False):
414409
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
415410
def delete(self, name, separator="||", parse_index="$", _isDebug_=False):
416411
import re
417-
import sys
418412

419413
# User input data type validation
420414
if type(_isDebug_) != bool: _isDebug_ = False
@@ -456,7 +450,6 @@ def delete(self, name, separator="||", parse_index="$", _isDebug_=False):
456450
def dumps(self, dupSign_start="{{{", dupSign_end="}}}", _isDebug_=False, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, cls=None, indent=None, separators=None, default=None, sort_keys=False):
457451
import json, re
458452
from collections import OrderedDict
459-
import sys
460453

461454
# User input data type validation
462455
if type(_isDebug_) != bool: _isDebug_ = False
@@ -503,7 +496,6 @@ def dump(self, Jfilepath, dupSign_start="{{{", dupSign_end="}}}", _isDebug_=Fals
503496
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
504497
def flatten(self, separator="||", parse_index="$", ordered_dict=False, _isDebug_=False):
505498
from collections import OrderedDict
506-
import sys
507499

508500
# User input data type validation
509501
if type(_isDebug_) != bool: _isDebug_ = False
@@ -564,7 +556,6 @@ def __convert_Jobj_to_Jflat(Jobj, key=None):
564556
def unflatten(self, separator="||", parse_index="$", ordered_dict=False, _isDebug_=False):
565557
import re
566558
from collections import OrderedDict
567-
import sys
568559

569560
# User input data type validation
570561
if type(_isDebug_) != bool: _isDebug_ = False

0 commit comments

Comments
 (0)