qjph 0.0.4__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.
qjph-0.0.4/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2026] [Chris 'KageKirin' Helmich]
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
21
+ SOFTWARE.
qjph-0.0.4/PKG-INFO ADDED
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.4
2
+ Name: qjph
3
+ Version: 0.0.4
4
+ Summary: Quick Json Parser Hack
5
+ Author-email: kagekirin <kagekirin@gmail.com>
6
+ Maintainer-email: kagekirin <kagekirin@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/KageKirin/py-qjph
9
+ Project-URL: Documentation, https://github.com/KageKirin/py-qjph
10
+ Project-URL: Repository, https://github.com/KageKirin/py-qjph.git
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Topic :: File Formats :: JSON
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=9.0; extra == "dev"
22
+ Requires-Dist: ruff; extra == "dev"
23
+ Dynamic: license-file
24
+
25
+ # QJPH -- Quick Json Parser Hack
26
+
27
+ **Quick Json Parser Hack** is, as the name indicates
28
+ a quick hack to have Python parse JSON as Python.
29
+
30
+ CAVEAT: This lib relies on `eval()` with a few specific globals
31
+ to parse JSON. As such, it might not be safe against code injection attacks.
32
+
33
+ ## ⚡ Usage
34
+
35
+ ```python
36
+ import qjph
37
+
38
+ from_file = qjph.load("file.json")
39
+
40
+ from_string = qjph.loads("""
41
+ {
42
+ "json": {
43
+ "data": "value"
44
+ }
45
+ }
46
+ """)
47
+ ```
48
+
49
+ ## 🔧 Building
50
+
51
+ ```shell
52
+ uv build
53
+ ```
54
+
55
+ ## 🤝 Collaborate with My Project
56
+
57
+ Please refer to the [collaboration guidelines](./COLLABORATION.md) for details.
qjph-0.0.4/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # QJPH -- Quick Json Parser Hack
2
+
3
+ **Quick Json Parser Hack** is, as the name indicates
4
+ a quick hack to have Python parse JSON as Python.
5
+
6
+ CAVEAT: This lib relies on `eval()` with a few specific globals
7
+ to parse JSON. As such, it might not be safe against code injection attacks.
8
+
9
+ ## ⚡ Usage
10
+
11
+ ```python
12
+ import qjph
13
+
14
+ from_file = qjph.load("file.json")
15
+
16
+ from_string = qjph.loads("""
17
+ {
18
+ "json": {
19
+ "data": "value"
20
+ }
21
+ }
22
+ """)
23
+ ```
24
+
25
+ ## 🔧 Building
26
+
27
+ ```shell
28
+ uv build
29
+ ```
30
+
31
+ ## 🤝 Collaborate with My Project
32
+
33
+ Please refer to the [collaboration guidelines](./COLLABORATION.md) for details.
@@ -0,0 +1,61 @@
1
+ [build-system]
2
+ requires = ["wheel", "setuptools", "versioningit", "attrs>=17.1"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "qjph"
7
+ dynamic = ["version"]
8
+ description = "Quick Json Parser Hack"
9
+ readme = "README.md"
10
+ requires-python = ">= 3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+
14
+ authors = [
15
+ {name = "kagekirin", email = "kagekirin@gmail.com"},
16
+ ]
17
+ maintainers = [
18
+ {name = "kagekirin", email = "kagekirin@gmail.com"},
19
+ ]
20
+
21
+ classifiers = [
22
+ "Programming Language :: Python :: 3",
23
+ "Operating System :: OS Independent",
24
+ "Development Status :: 3 - Alpha",
25
+ "Intended Audience :: Developers",
26
+ "Topic :: File Formats :: JSON",
27
+ "Topic :: Software Development :: Libraries",
28
+ ]
29
+
30
+
31
+ [project.urls]
32
+ Homepage = "https://github.com/KageKirin/py-qjph"
33
+ Documentation = "https://github.com/KageKirin/py-qjph"
34
+ Repository = "https://github.com/KageKirin/py-qjph.git"
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=9.0",
39
+ "ruff",
40
+ ]
41
+
42
+ [tool.pytest]
43
+ minversion = "9.0"
44
+ addopts = ["-ra", "-q"]
45
+ pythonpath = ["src"]
46
+ testpaths = [
47
+ "tests",
48
+ ]
49
+
50
+
51
+ [tool.setuptools.packages.find]
52
+ where = ["src/"]
53
+ include = ["qjph"]
54
+
55
+ [tool.versioningit.next-version]
56
+ method = "smallest"
57
+
58
+ [tool.versioningit.format]
59
+ distance = "{next_version}.dev{distance}+{vcs}{rev}"
60
+ dirty = "{base_version}+d{build_date:%Y%m%d}"
61
+ distance-dirty = "{next_version}.dev{distance}+{vcs}{rev}.d{build_date:%Y%m%d}"
qjph-0.0.4/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,21 @@
1
+ ## Quick JSON Parser hack
2
+
3
+ # namespace: qjph
4
+ from pathlib import Path
5
+
6
+
7
+ def load(filename):
8
+ return loads(Path(filename).read_text())
9
+
10
+
11
+ def loads(s):
12
+ ## quick JSON parser hack
13
+ gg = globals()
14
+ gg.update(
15
+ {
16
+ "true": True,
17
+ "false": False,
18
+ "null": None,
19
+ }
20
+ )
21
+ return eval(s, gg)
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.4
2
+ Name: qjph
3
+ Version: 0.0.4
4
+ Summary: Quick Json Parser Hack
5
+ Author-email: kagekirin <kagekirin@gmail.com>
6
+ Maintainer-email: kagekirin <kagekirin@gmail.com>
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/KageKirin/py-qjph
9
+ Project-URL: Documentation, https://github.com/KageKirin/py-qjph
10
+ Project-URL: Repository, https://github.com/KageKirin/py-qjph.git
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Topic :: File Formats :: JSON
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=9.0; extra == "dev"
22
+ Requires-Dist: ruff; extra == "dev"
23
+ Dynamic: license-file
24
+
25
+ # QJPH -- Quick Json Parser Hack
26
+
27
+ **Quick Json Parser Hack** is, as the name indicates
28
+ a quick hack to have Python parse JSON as Python.
29
+
30
+ CAVEAT: This lib relies on `eval()` with a few specific globals
31
+ to parse JSON. As such, it might not be safe against code injection attacks.
32
+
33
+ ## ⚡ Usage
34
+
35
+ ```python
36
+ import qjph
37
+
38
+ from_file = qjph.load("file.json")
39
+
40
+ from_string = qjph.loads("""
41
+ {
42
+ "json": {
43
+ "data": "value"
44
+ }
45
+ }
46
+ """)
47
+ ```
48
+
49
+ ## 🔧 Building
50
+
51
+ ```shell
52
+ uv build
53
+ ```
54
+
55
+ ## 🤝 Collaborate with My Project
56
+
57
+ Please refer to the [collaboration guidelines](./COLLABORATION.md) for details.
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ src/qjph/__init__.py
5
+ src/qjph.egg-info/PKG-INFO
6
+ src/qjph.egg-info/SOURCES.txt
7
+ src/qjph.egg-info/dependency_links.txt
8
+ src/qjph.egg-info/requires.txt
9
+ src/qjph.egg-info/top_level.txt
10
+ tests/test_qjph.py
@@ -0,0 +1,4 @@
1
+
2
+ [dev]
3
+ pytest>=9.0
4
+ ruff
@@ -0,0 +1 @@
1
+ qjph
@@ -0,0 +1,18 @@
1
+ import qjph
2
+ import pytest
3
+
4
+ def test_json():
5
+ # Example test case for qjph functionality
6
+ data = qjph.loads("""
7
+ {
8
+ "json": {
9
+ "text": "value",
10
+ "number": 42,
11
+ }
12
+ }
13
+ """)
14
+ assert data["json"]["text"] == "value"
15
+ assert data["json"]["number"] == 42
16
+
17
+ if __name__ == "__main__":
18
+ pytest.main()