syncraft 0.1.5__tar.gz → 0.1.8__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.

Potentially problematic release.


This version of syncraft might be problematic. Click here for more details.

syncraft-0.1.8/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 afmkt
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.
@@ -1,13 +1,17 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: syncraft
3
- Version: 0.1.5
3
+ Version: 0.1.8
4
4
  Summary: Parser combinator library
5
- Author-email: michael <afmkt1020@proton.me>
6
- Requires-Python: >=3.12
5
+ Author-email: Michael Afmokt <michael@esacca.com>
6
+ License-Expression: MIT
7
+ Keywords: parser,combinator,sql,sqlite,generator,printer
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
7
11
  Requires-Dist: rich>=14.1.0
8
12
  Requires-Dist: rstr>=3.2.2
9
13
  Requires-Dist: sqlglot>=27.7.0
10
- Description-Content-Type: text/markdown
14
+ Dynamic: license-file
11
15
 
12
16
  # Syncraft
13
17
 
@@ -0,0 +1,23 @@
1
+ [project]
2
+ name = "syncraft"
3
+ version = "0.1.8"
4
+ description = "Parser combinator library"
5
+ license = "MIT"
6
+ license-files = ["LICENSE"]
7
+ readme = "README.md"
8
+ authors = [{name = "Michael Afmokt", email = "michael@esacca.com"}]
9
+ keywords = ["parser", "combinator", "sql", "sqlite", "generator", 'printer']
10
+ requires-python = ">=3.9"
11
+ dependencies = [
12
+ "rich>=14.1.0",
13
+ "rstr>=3.2.2",
14
+ "sqlglot>=27.7.0",
15
+ ]
16
+
17
+
18
+ [dependency-groups]
19
+ dev = [
20
+ "pytest>=8.4.1",
21
+ ]
22
+
23
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,36 @@
1
+ Metadata-Version: 2.4
2
+ Name: syncraft
3
+ Version: 0.1.8
4
+ Summary: Parser combinator library
5
+ Author-email: Michael Afmokt <michael@esacca.com>
6
+ License-Expression: MIT
7
+ Keywords: parser,combinator,sql,sqlite,generator,printer
8
+ Requires-Python: >=3.9
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: rich>=14.1.0
12
+ Requires-Dist: rstr>=3.2.2
13
+ Requires-Dist: sqlglot>=27.7.0
14
+ Dynamic: license-file
15
+
16
+ # Syncraft
17
+
18
+ Syncraft is a parser/generator combinator library with full round-trip support:
19
+
20
+ - Parse source code into AST or dataclasses
21
+ - Generate source code from dataclasses
22
+ - Bidirectional transformations via lenses
23
+ - Convenience combinators: `all`, `first`, `last`, `named`
24
+ - SQLite syntax support included
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install syncraft
30
+ ```
31
+
32
+
33
+ ## TODO
34
+ - [ ] Test Walker.get/set for bidirectional mapping between source code and data class
35
+ - [ ] Annotate sqlite3 grammar with named nodes and data classes
36
+ - [ ]
@@ -0,0 +1,17 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ syncraft/__init__.py
5
+ syncraft/algebra.py
6
+ syncraft/cmd.py
7
+ syncraft/diagnostic.py
8
+ syncraft/dsl.py
9
+ syncraft/generator.py
10
+ syncraft/parser.py
11
+ syncraft/py.typed
12
+ syncraft/sqlite3.py
13
+ syncraft.egg-info/PKG-INFO
14
+ syncraft.egg-info/SOURCES.txt
15
+ syncraft.egg-info/dependency_links.txt
16
+ syncraft.egg-info/requires.txt
17
+ syncraft.egg-info/top_level.txt
@@ -0,0 +1,3 @@
1
+ rich>=14.1.0
2
+ rstr>=3.2.2
3
+ sqlglot>=27.7.0
@@ -0,0 +1 @@
1
+ syncraft
@@ -1,43 +0,0 @@
1
- name: Publish to PyPI
2
-
3
- on:
4
- push:
5
- tags:
6
- - "v*.*.*" # Trigger on version tags, e.g. v0.1.0
7
-
8
- jobs:
9
- build-and-publish:
10
- name: Build and publish to PyPI
11
- runs-on: ubuntu-latest
12
-
13
- steps:
14
- - name: Checkout repository
15
- uses: actions/checkout@v4
16
-
17
- - name: Set up Python
18
- uses: actions/setup-python@v5
19
- with:
20
- python-version: "3.12"
21
-
22
- - name: Install uv
23
- run: pip install uv
24
-
25
- - name: Install build backend
26
- run: pip install hatchling
27
-
28
- - name: Build package
29
- run: uv build
30
-
31
- - name: Publish to PyPI
32
- uses: pypa/gh-action-pypi-publish@release/v1
33
- with:
34
- user: __token__
35
- password: ${{ secrets.PYPI_API_TOKEN }}
36
-
37
- - name: Publish to TestPyPI
38
- if: startsWith(github.ref, 'refs/tags/') && contains(github.ref, '-')
39
- uses: pypa/gh-action-pypi-publish@release/v1
40
- with:
41
- user: __token__
42
- password: ${{ secrets.TEST_PYPI_API_TOKEN }}
43
- repository-url: https://test.pypi.org/legacy/
syncraft-0.1.5/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- # Python-generated files
2
- __pycache__/
3
- *.py[oc]
4
- build/
5
- dist/
6
- wheels/
7
- *.egg-info
8
- .token
9
- # Virtual environments
10
- .venv
@@ -1 +0,0 @@
1
- 3.12
@@ -1,27 +0,0 @@
1
- [project]
2
- name = "syncraft"
3
- version = "0.1.5"
4
- description = "Parser combinator library"
5
- readme = "README.md"
6
- authors = [
7
- { name = "michael", email = "afmkt1020@proton.me" }
8
- ]
9
- requires-python = ">=3.12"
10
- dependencies = [
11
- "rich>=14.1.0",
12
- "rstr>=3.2.2",
13
- "sqlglot>=27.7.0",
14
- ]
15
-
16
- [build-system]
17
- requires = ["hatchling"]
18
- build-backend = "hatchling.build"
19
-
20
- [dependency-groups]
21
- dev = [
22
- "pytest>=8.4.1",
23
- ]
24
-
25
- [tool.hatch.version]
26
- path = "pyproject.toml"
27
-
@@ -1,59 +0,0 @@
1
- #!/bin/bash
2
- set -e
3
-
4
- BUMP=${1:-patch}
5
-
6
- # Read current version robustly
7
- CURRENT_VERSION=$(sed -nE 's/^[[:space:]]*version[[:space:]]*=[[:space:]]*"([0-9]+)\.([0-9]+)\.([0-9]+)".*/\1.\2.\3/p' pyproject.toml)
8
-
9
- if [ -z "$CURRENT_VERSION" ]; then
10
- echo "Error: Could not find current version in pyproject.toml"
11
- exit 1
12
- fi
13
-
14
- echo "Current version: $CURRENT_VERSION"
15
-
16
- IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
17
-
18
- case "$BUMP" in
19
- major)
20
- ((MAJOR+=1))
21
- MINOR=0
22
- PATCH=0
23
- ;;
24
- minor)
25
- ((MINOR+=1))
26
- PATCH=0
27
- ;;
28
- patch)
29
- ((PATCH+=1))
30
- ;;
31
- *)
32
- echo "Unknown bump type: $BUMP. Use major, minor, or patch."
33
- exit 1
34
- ;;
35
- esac
36
-
37
- NEW_VERSION="$MAJOR.$MINOR.$PATCH"
38
- echo "New version: $NEW_VERSION"
39
-
40
- # Update pyproject.toml in place
41
- sed -i.bak -E "s/^([[:space:]]*version[[:space:]]*=[[:space:]]*\")[0-9]+\.[0-9]+\.[0-9]+(\".*)/\1$NEW_VERSION\2/" pyproject.toml
42
- rm pyproject.toml.bak
43
-
44
- echo "Version updated in pyproject.toml"
45
-
46
- # Ask for commit message
47
- read -p "Enter commit message [default: Bump version to $NEW_VERSION]: " COMMIT_MSG
48
- COMMIT_MSG=${COMMIT_MSG:-"Bump version to $NEW_VERSION"}
49
-
50
- # Commit and tag
51
- git add pyproject.toml
52
- git commit -m "$COMMIT_MSG"
53
- git tag "v$NEW_VERSION"
54
-
55
- # Push commit and tag
56
- git push origin main
57
- git push origin "v$NEW_VERSION"
58
-
59
- echo "Release $NEW_VERSION committed, tagged, and pushed."
syncraft-0.1.5/uv.lock DELETED
@@ -1,141 +0,0 @@
1
- version = 1
2
- revision = 2
3
- requires-python = ">=3.12"
4
-
5
- [[package]]
6
- name = "colorama"
7
- version = "0.4.6"
8
- source = { registry = "https://pypi.org/simple" }
9
- sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" }
10
- wheels = [
11
- { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
12
- ]
13
-
14
- [[package]]
15
- name = "iniconfig"
16
- version = "2.1.0"
17
- source = { registry = "https://pypi.org/simple" }
18
- sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793, upload-time = "2025-03-19T20:09:59.721Z" }
19
- wheels = [
20
- { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" },
21
- ]
22
-
23
- [[package]]
24
- name = "markdown-it-py"
25
- version = "4.0.0"
26
- source = { registry = "https://pypi.org/simple" }
27
- dependencies = [
28
- { name = "mdurl" },
29
- ]
30
- sdist = { url = "https://files.pythonhosted.org/packages/5b/f5/4ec618ed16cc4f8fb3b701563655a69816155e79e24a17b651541804721d/markdown_it_py-4.0.0.tar.gz", hash = "sha256:cb0a2b4aa34f932c007117b194e945bd74e0ec24133ceb5bac59009cda1cb9f3", size = 73070, upload-time = "2025-08-11T12:57:52.854Z" }
31
- wheels = [
32
- { url = "https://files.pythonhosted.org/packages/94/54/e7d793b573f298e1c9013b8c4dade17d481164aa517d1d7148619c2cedbf/markdown_it_py-4.0.0-py3-none-any.whl", hash = "sha256:87327c59b172c5011896038353a81343b6754500a08cd7a4973bb48c6d578147", size = 87321, upload-time = "2025-08-11T12:57:51.923Z" },
33
- ]
34
-
35
- [[package]]
36
- name = "mdurl"
37
- version = "0.1.2"
38
- source = { registry = "https://pypi.org/simple" }
39
- sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }
40
- wheels = [
41
- { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },
42
- ]
43
-
44
- [[package]]
45
- name = "packaging"
46
- version = "25.0"
47
- source = { registry = "https://pypi.org/simple" }
48
- sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" }
49
- wheels = [
50
- { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" },
51
- ]
52
-
53
- [[package]]
54
- name = "pluggy"
55
- version = "1.6.0"
56
- source = { registry = "https://pypi.org/simple" }
57
- sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" }
58
- wheels = [
59
- { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" },
60
- ]
61
-
62
- [[package]]
63
- name = "pygments"
64
- version = "2.19.2"
65
- source = { registry = "https://pypi.org/simple" }
66
- sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" }
67
- wheels = [
68
- { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" },
69
- ]
70
-
71
- [[package]]
72
- name = "pytest"
73
- version = "8.4.1"
74
- source = { registry = "https://pypi.org/simple" }
75
- dependencies = [
76
- { name = "colorama", marker = "sys_platform == 'win32'" },
77
- { name = "iniconfig" },
78
- { name = "packaging" },
79
- { name = "pluggy" },
80
- { name = "pygments" },
81
- ]
82
- sdist = { url = "https://files.pythonhosted.org/packages/08/ba/45911d754e8eba3d5a841a5ce61a65a685ff1798421ac054f85aa8747dfb/pytest-8.4.1.tar.gz", hash = "sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c", size = 1517714, upload-time = "2025-06-18T05:48:06.109Z" }
83
- wheels = [
84
- { url = "https://files.pythonhosted.org/packages/29/16/c8a903f4c4dffe7a12843191437d7cd8e32751d5de349d45d3fe69544e87/pytest-8.4.1-py3-none-any.whl", hash = "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", size = 365474, upload-time = "2025-06-18T05:48:03.955Z" },
85
- ]
86
-
87
- [[package]]
88
- name = "rich"
89
- version = "14.1.0"
90
- source = { registry = "https://pypi.org/simple" }
91
- dependencies = [
92
- { name = "markdown-it-py" },
93
- { name = "pygments" },
94
- ]
95
- sdist = { url = "https://files.pythonhosted.org/packages/fe/75/af448d8e52bf1d8fa6a9d089ca6c07ff4453d86c65c145d0a300bb073b9b/rich-14.1.0.tar.gz", hash = "sha256:e497a48b844b0320d45007cdebfeaeed8db2a4f4bcf49f15e455cfc4af11eaa8", size = 224441, upload-time = "2025-07-25T07:32:58.125Z" }
96
- wheels = [
97
- { url = "https://files.pythonhosted.org/packages/e3/30/3c4d035596d3cf444529e0b2953ad0466f6049528a879d27534700580395/rich-14.1.0-py3-none-any.whl", hash = "sha256:536f5f1785986d6dbdea3c75205c473f970777b4a0d6c6dd1b696aa05a3fa04f", size = 243368, upload-time = "2025-07-25T07:32:56.73Z" },
98
- ]
99
-
100
- [[package]]
101
- name = "rstr"
102
- version = "3.2.2"
103
- source = { registry = "https://pypi.org/simple" }
104
- sdist = { url = "https://files.pythonhosted.org/packages/9f/80/d7449656d45a776b7a443ce3af4eb97c4debe416a1a80f60311c7cfd02ff/rstr-3.2.2.tar.gz", hash = "sha256:c4a564d4dfb4472d931d145c43d1cf1ad78c24592142e7755b8866179eeac012", size = 13560, upload-time = "2023-10-11T20:07:57.422Z" }
105
- wheels = [
106
- { url = "https://files.pythonhosted.org/packages/c8/8c/a0f14f2fcdd846839c478048032b2fc93293deaa936ff6751f27dcf50995/rstr-3.2.2-py3-none-any.whl", hash = "sha256:f39195d38da1748331eeec52f1276e71eb6295e7949beea91a5e9af2340d7b3b", size = 10030, upload-time = "2023-10-11T20:07:55.873Z" },
107
- ]
108
-
109
- [[package]]
110
- name = "sqlglot"
111
- version = "27.7.0"
112
- source = { registry = "https://pypi.org/simple" }
113
- sdist = { url = "https://files.pythonhosted.org/packages/46/0a/6baff44ba014f250c16a0707deb9ebd14a384ebc7afecb95cc3ef20e1c7b/sqlglot-27.7.0.tar.gz", hash = "sha256:6bedac6c57d1b89c3ca2c392e0235305ea1a35b43fced91b6ef485dc64877ae1", size = 5414964, upload-time = "2025-08-13T16:06:54.562Z" }
114
- wheels = [
115
- { url = "https://files.pythonhosted.org/packages/e5/88/536ae39a5abfcdf8b3343bfc309dbafe1b9b72653a62b11e539f34f3d16f/sqlglot-27.7.0-py3-none-any.whl", hash = "sha256:cc4ee8fb780636a6f2d5b5c6624e0466ba38b0a8e6588f560ee229a71e33234d", size = 499485, upload-time = "2025-08-13T16:06:51.738Z" },
116
- ]
117
-
118
- [[package]]
119
- name = "syncraft"
120
- version = "0.1.4"
121
- source = { editable = "." }
122
- dependencies = [
123
- { name = "rich" },
124
- { name = "rstr" },
125
- { name = "sqlglot" },
126
- ]
127
-
128
- [package.dev-dependencies]
129
- dev = [
130
- { name = "pytest" },
131
- ]
132
-
133
- [package.metadata]
134
- requires-dist = [
135
- { name = "rich", specifier = ">=14.1.0" },
136
- { name = "rstr", specifier = ">=3.2.2" },
137
- { name = "sqlglot", specifier = ">=27.7.0" },
138
- ]
139
-
140
- [package.metadata.requires-dev]
141
- dev = [{ name = "pytest", specifier = ">=8.4.1" }]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes