gemmology-plugin 1.0.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 gemmology.dev
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.
@@ -0,0 +1,171 @@
1
+ Metadata-Version: 2.4
2
+ Name: gemmology-plugin
3
+ Version: 1.0.0
4
+ Summary: Claude Code plugin for coloured gemstone expertise and crystal visualization
5
+ Author-email: Fabian Schuh <fabian@gemmology.dev>
6
+ License: MIT
7
+ Project-URL: Homepage, https://gemmology.dev
8
+ Project-URL: Documentation, https://gemmology.dev/docs
9
+ Project-URL: Repository, https://github.com/gemmology-dev/gemmology-plugin
10
+ Project-URL: Issues, https://github.com/gemmology-dev/gemmology-plugin/issues
11
+ Keywords: gemmology,crystallography,gemstones,visualization,claude-code,plugin
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: gemmology-cdl-parser>=1.0.0
26
+ Requires-Dist: gemmology-mineral-database>=1.0.0
27
+ Requires-Dist: gemmology-crystal-geometry>=1.0.0
28
+ Requires-Dist: gemmology-crystal-renderer>=1.0.0
29
+ Provides-Extra: dev
30
+ Requires-Dist: pytest>=7.0; extra == "dev"
31
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
32
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
33
+ Requires-Dist: mypy>=1.0; extra == "dev"
34
+ Provides-Extra: lsp
35
+ Requires-Dist: gemmology-cdl-lsp>=1.0.0; extra == "lsp"
36
+ Provides-Extra: all
37
+ Requires-Dist: gemmology-cdl-lsp>=1.0.0; extra == "all"
38
+ Dynamic: license-file
39
+
40
+ # Gemmology Plugin
41
+
42
+ A Claude Code plugin for coloured gemstone expertise and crystal visualization.
43
+
44
+ Part of the [Gemmology Project](https://gemmology.dev).
45
+
46
+ ## Features
47
+
48
+ - **Crystal Visualization**: Generate SVG, STL, and glTF visualizations of crystal structures
49
+ - **Mineral Database**: Access FGA-curriculum aligned gemstone data for 50+ minerals
50
+ - **CDL Parser**: Parse and validate Crystal Description Language notation
51
+ - **Gem Identification**: Interactive workflow for systematic gemstone identification
52
+
53
+ ## Installation
54
+
55
+ ```bash
56
+ pip install gemmology-plugin
57
+ ```
58
+
59
+ This installs the core plugin along with all component packages:
60
+ - `cdl-parser` - Crystal Description Language parser
61
+ - `mineral-database` - Gemstone property database
62
+ - `crystal-geometry` - 3D crystal geometry engine
63
+ - `crystal-renderer` - SVG/STL/glTF visualization
64
+
65
+ ### Optional: Language Server
66
+
67
+ For editor integration with CDL syntax highlighting and completion:
68
+
69
+ ```bash
70
+ pip install gemmology-plugin[lsp]
71
+ ```
72
+
73
+ ## Quick Start
74
+
75
+ ### Command Line
76
+
77
+ ```bash
78
+ # Generate crystal visualization
79
+ gemmology crystal-svg --preset diamond -o diamond.svg
80
+
81
+ # List available presets
82
+ gemmology list-presets
83
+
84
+ # Get mineral information
85
+ gemmology info ruby
86
+ ```
87
+
88
+ ### Python API
89
+
90
+ ```python
91
+ from gemmology_plugin import generate_crystal_svg, get_preset
92
+
93
+ # Generate from CDL notation
94
+ svg = generate_crystal_svg("cubic[m3m]:{111}@1.0 + {100}@1.3")
95
+
96
+ # Generate from preset
97
+ ruby = get_preset("ruby")
98
+ svg = generate_crystal_svg(ruby['cdl'], info_properties={'name': ruby['name']})
99
+ ```
100
+
101
+ ## Claude Code Plugin
102
+
103
+ When used as a Claude Code plugin, this package provides:
104
+
105
+ ### Commands
106
+
107
+ - `/crystal-svg` - Generate crystal structure visualizations
108
+ - `/identify-gem` - Interactive gemstone identification workflow
109
+
110
+ ### Agents
111
+
112
+ Expert agents for domain-specific tasks:
113
+ - `crystallography-expert` - Crystal systems, symmetry, Miller indices
114
+ - `gemmology-expert` - Gemstone properties, FGA data
115
+ - `cdl-expert` - CDL syntax and parsing
116
+
117
+ ### Skills
118
+
119
+ Reference skills covering FGA curriculum topics:
120
+ - Physical properties (hardness, SG, cleavage)
121
+ - Optical properties (RI, birefringence, dispersion)
122
+ - Inclusions and fingerprints
123
+ - Treatments and enhancements
124
+ - Synthetics and simulants
125
+ - Origin determination
126
+
127
+ ## CDL Syntax Overview
128
+
129
+ Crystal Description Language (CDL) provides precise control over crystal morphology:
130
+
131
+ ```
132
+ system[point_group]:{form}@distance + {form}@distance
133
+ ```
134
+
135
+ Examples:
136
+ ```
137
+ cubic[m3m]:{111} # Octahedron
138
+ cubic[m3m]:{111}@1.0 + {100}@1.3 # Truncated octahedron
139
+ trigonal[-3m]:{10-10}@1.0 + {0001}@0.5 # Quartz prism
140
+ ```
141
+
142
+ ## Component Packages
143
+
144
+ This plugin integrates:
145
+
146
+ | Package | Description |
147
+ |---------|-------------|
148
+ | [cdl-parser](https://github.com/gemmology-dev/cdl-parser) | CDL parsing and validation |
149
+ | [mineral-database](https://github.com/gemmology-dev/mineral-database) | Gemstone property database |
150
+ | [crystal-geometry](https://github.com/gemmology-dev/crystal-geometry) | 3D geometry generation |
151
+ | [crystal-renderer](https://github.com/gemmology-dev/crystal-renderer) | Visualization and export |
152
+ | [cdl-lsp](https://github.com/gemmology-dev/cdl-lsp) | Language server (optional) |
153
+
154
+ ## Development
155
+
156
+ ```bash
157
+ git clone https://github.com/gemmology-dev/gemmology-plugin
158
+ cd gemmology-plugin
159
+ pip install -e ".[dev]"
160
+ pytest tests/ -v
161
+ ```
162
+
163
+ ## License
164
+
165
+ MIT License - see [LICENSE](LICENSE) for details.
166
+
167
+ ## Links
168
+
169
+ - [Documentation](https://gemmology.dev/docs)
170
+ - [CDL Specification](https://gemmology.dev/cdl)
171
+ - [GitHub Repository](https://github.com/gemmology-dev/gemmology-plugin)
@@ -0,0 +1,132 @@
1
+ # Gemmology Plugin
2
+
3
+ A Claude Code plugin for coloured gemstone expertise and crystal visualization.
4
+
5
+ Part of the [Gemmology Project](https://gemmology.dev).
6
+
7
+ ## Features
8
+
9
+ - **Crystal Visualization**: Generate SVG, STL, and glTF visualizations of crystal structures
10
+ - **Mineral Database**: Access FGA-curriculum aligned gemstone data for 50+ minerals
11
+ - **CDL Parser**: Parse and validate Crystal Description Language notation
12
+ - **Gem Identification**: Interactive workflow for systematic gemstone identification
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pip install gemmology-plugin
18
+ ```
19
+
20
+ This installs the core plugin along with all component packages:
21
+ - `cdl-parser` - Crystal Description Language parser
22
+ - `mineral-database` - Gemstone property database
23
+ - `crystal-geometry` - 3D crystal geometry engine
24
+ - `crystal-renderer` - SVG/STL/glTF visualization
25
+
26
+ ### Optional: Language Server
27
+
28
+ For editor integration with CDL syntax highlighting and completion:
29
+
30
+ ```bash
31
+ pip install gemmology-plugin[lsp]
32
+ ```
33
+
34
+ ## Quick Start
35
+
36
+ ### Command Line
37
+
38
+ ```bash
39
+ # Generate crystal visualization
40
+ gemmology crystal-svg --preset diamond -o diamond.svg
41
+
42
+ # List available presets
43
+ gemmology list-presets
44
+
45
+ # Get mineral information
46
+ gemmology info ruby
47
+ ```
48
+
49
+ ### Python API
50
+
51
+ ```python
52
+ from gemmology_plugin import generate_crystal_svg, get_preset
53
+
54
+ # Generate from CDL notation
55
+ svg = generate_crystal_svg("cubic[m3m]:{111}@1.0 + {100}@1.3")
56
+
57
+ # Generate from preset
58
+ ruby = get_preset("ruby")
59
+ svg = generate_crystal_svg(ruby['cdl'], info_properties={'name': ruby['name']})
60
+ ```
61
+
62
+ ## Claude Code Plugin
63
+
64
+ When used as a Claude Code plugin, this package provides:
65
+
66
+ ### Commands
67
+
68
+ - `/crystal-svg` - Generate crystal structure visualizations
69
+ - `/identify-gem` - Interactive gemstone identification workflow
70
+
71
+ ### Agents
72
+
73
+ Expert agents for domain-specific tasks:
74
+ - `crystallography-expert` - Crystal systems, symmetry, Miller indices
75
+ - `gemmology-expert` - Gemstone properties, FGA data
76
+ - `cdl-expert` - CDL syntax and parsing
77
+
78
+ ### Skills
79
+
80
+ Reference skills covering FGA curriculum topics:
81
+ - Physical properties (hardness, SG, cleavage)
82
+ - Optical properties (RI, birefringence, dispersion)
83
+ - Inclusions and fingerprints
84
+ - Treatments and enhancements
85
+ - Synthetics and simulants
86
+ - Origin determination
87
+
88
+ ## CDL Syntax Overview
89
+
90
+ Crystal Description Language (CDL) provides precise control over crystal morphology:
91
+
92
+ ```
93
+ system[point_group]:{form}@distance + {form}@distance
94
+ ```
95
+
96
+ Examples:
97
+ ```
98
+ cubic[m3m]:{111} # Octahedron
99
+ cubic[m3m]:{111}@1.0 + {100}@1.3 # Truncated octahedron
100
+ trigonal[-3m]:{10-10}@1.0 + {0001}@0.5 # Quartz prism
101
+ ```
102
+
103
+ ## Component Packages
104
+
105
+ This plugin integrates:
106
+
107
+ | Package | Description |
108
+ |---------|-------------|
109
+ | [cdl-parser](https://github.com/gemmology-dev/cdl-parser) | CDL parsing and validation |
110
+ | [mineral-database](https://github.com/gemmology-dev/mineral-database) | Gemstone property database |
111
+ | [crystal-geometry](https://github.com/gemmology-dev/crystal-geometry) | 3D geometry generation |
112
+ | [crystal-renderer](https://github.com/gemmology-dev/crystal-renderer) | Visualization and export |
113
+ | [cdl-lsp](https://github.com/gemmology-dev/cdl-lsp) | Language server (optional) |
114
+
115
+ ## Development
116
+
117
+ ```bash
118
+ git clone https://github.com/gemmology-dev/gemmology-plugin
119
+ cd gemmology-plugin
120
+ pip install -e ".[dev]"
121
+ pytest tests/ -v
122
+ ```
123
+
124
+ ## License
125
+
126
+ MIT License - see [LICENSE](LICENSE) for details.
127
+
128
+ ## Links
129
+
130
+ - [Documentation](https://gemmology.dev/docs)
131
+ - [CDL Specification](https://gemmology.dev/cdl)
132
+ - [GitHub Repository](https://github.com/gemmology-dev/gemmology-plugin)
@@ -0,0 +1,89 @@
1
+ [project]
2
+ name = "gemmology-plugin"
3
+ version = "1.0.0"
4
+ description = "Claude Code plugin for coloured gemstone expertise and crystal visualization"
5
+ readme = "README.md"
6
+ license = { text = "MIT" }
7
+ requires-python = ">=3.10"
8
+ authors = [
9
+ { name = "Fabian Schuh", email = "fabian@gemmology.dev" }
10
+ ]
11
+ keywords = [
12
+ "gemmology",
13
+ "crystallography",
14
+ "gemstones",
15
+ "visualization",
16
+ "claude-code",
17
+ "plugin"
18
+ ]
19
+ classifiers = [
20
+ "Development Status :: 5 - Production/Stable",
21
+ "Intended Audience :: Science/Research",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Operating System :: OS Independent",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Topic :: Scientific/Engineering",
30
+ ]
31
+ dependencies = [
32
+ "gemmology-cdl-parser>=1.0.0",
33
+ "gemmology-mineral-database>=1.0.0",
34
+ "gemmology-crystal-geometry>=1.0.0",
35
+ "gemmology-crystal-renderer>=1.0.0",
36
+ ]
37
+
38
+ [project.urls]
39
+ Homepage = "https://gemmology.dev"
40
+ Documentation = "https://gemmology.dev/docs"
41
+ Repository = "https://github.com/gemmology-dev/gemmology-plugin"
42
+ Issues = "https://github.com/gemmology-dev/gemmology-plugin/issues"
43
+
44
+ [project.scripts]
45
+ gemmology = "gemmology_plugin.cli:main"
46
+ crystal-svg = "gemmology_plugin.cli:crystal_svg"
47
+
48
+ [project.optional-dependencies]
49
+ dev = [
50
+ "pytest>=7.0",
51
+ "pytest-cov>=4.0",
52
+ "ruff>=0.1.0",
53
+ "mypy>=1.0"
54
+ ]
55
+ lsp = [
56
+ "gemmology-cdl-lsp>=1.0.0"
57
+ ]
58
+ all = [
59
+ "gemmology-cdl-lsp>=1.0.0",
60
+ ]
61
+
62
+ [build-system]
63
+ requires = ["setuptools>=61.0", "wheel"]
64
+ build-backend = "setuptools.build_meta"
65
+
66
+ [tool.setuptools.packages.find]
67
+ where = ["src"]
68
+
69
+ [tool.setuptools.package-data]
70
+ gemmology_plugin = ["py.typed"]
71
+
72
+ [tool.ruff]
73
+ line-length = 100
74
+ target-version = "py310"
75
+
76
+ [tool.ruff.lint]
77
+ select = ["E", "W", "F", "I", "B", "C4", "UP"]
78
+ ignore = ["E501"]
79
+
80
+ [tool.mypy]
81
+ python_version = "3.10"
82
+ strict = false # Integration layer with evolving APIs
83
+ ignore_missing_imports = true
84
+ check_untyped_defs = true
85
+ disable_error_code = ["attr-defined", "call-arg", "arg-type", "assignment", "type-arg"]
86
+
87
+ [tool.pytest.ini_options]
88
+ testpaths = ["tests"]
89
+ addopts = "-v --tb=short"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,200 @@
1
+ """
2
+ Gemmology Plugin - Claude Code plugin for coloured gemstone expertise.
3
+
4
+ This package provides comprehensive tools for gemmology and crystallography,
5
+ including crystal structure visualization, gemstone identification, and
6
+ FGA-curriculum aligned reference materials.
7
+
8
+ Example:
9
+ Generate a crystal visualization:
10
+
11
+ >>> from gemmology_plugin import generate_crystal_svg
12
+ >>> svg = generate_crystal_svg("cubic[m3m]:{111}")
13
+
14
+ Get preset information:
15
+
16
+ >>> from gemmology_plugin import get_preset
17
+ >>> ruby = get_preset("ruby")
18
+ >>> print(ruby.ri)
19
+ '1.762-1.770'
20
+ """
21
+
22
+ __version__ = "1.0.0"
23
+ __author__ = "Fabian Schuh"
24
+ __email__ = "fabian@gemmology.dev"
25
+
26
+ # Re-export core functionality from component packages
27
+ from cdl_parser import (
28
+ CRYSTAL_SYSTEMS,
29
+ NAMED_FORMS,
30
+ POINT_GROUPS,
31
+ TWIN_LAWS,
32
+ CrystalDescription,
33
+ CrystalForm,
34
+ MillerIndex,
35
+ Modification,
36
+ parse_cdl,
37
+ validate_cdl,
38
+ )
39
+ from crystal_geometry import (
40
+ CrystalGeometry,
41
+ cdl_to_geometry,
42
+ halfspace_intersection_3d,
43
+ )
44
+ from crystal_renderer import (
45
+ generate_cdl_svg,
46
+ generate_geometry_svg,
47
+ geometry_to_gltf,
48
+ geometry_to_stl,
49
+ )
50
+ from mineral_database import (
51
+ Mineral,
52
+ get_preset,
53
+ search_presets,
54
+ )
55
+ from mineral_database import (
56
+ list_preset_categories as list_categories,
57
+ )
58
+
59
+ __all__ = [
60
+ # Version info
61
+ "__version__",
62
+ # CDL Parser
63
+ "parse_cdl",
64
+ "validate_cdl",
65
+ "CrystalDescription",
66
+ "CrystalForm",
67
+ "MillerIndex",
68
+ "Modification",
69
+ "CRYSTAL_SYSTEMS",
70
+ "POINT_GROUPS",
71
+ "TWIN_LAWS",
72
+ "NAMED_FORMS",
73
+ # Crystal Geometry
74
+ "cdl_to_geometry",
75
+ "CrystalGeometry",
76
+ "halfspace_intersection_3d",
77
+ # Mineral Database
78
+ "get_preset",
79
+ "search_presets",
80
+ "Mineral",
81
+ "list_categories",
82
+ # Crystal Renderer
83
+ "generate_cdl_svg",
84
+ "generate_geometry_svg",
85
+ "geometry_to_stl",
86
+ "geometry_to_gltf",
87
+ ]
88
+
89
+
90
+ def generate_crystal_svg(
91
+ cdl: str,
92
+ *,
93
+ elevation: float = 30.0,
94
+ azimuth: float = -45.0,
95
+ show_axes: bool = True,
96
+ show_grid: bool = True,
97
+ info_properties: dict = None,
98
+ ) -> str:
99
+ """
100
+ Generate an SVG visualization of a crystal from CDL notation.
101
+
102
+ This is a convenience function that combines parsing, geometry generation,
103
+ and rendering in a single call.
104
+
105
+ Args:
106
+ cdl: Crystal Description Language string (e.g., "cubic[m3m]:{111}")
107
+ elevation: View elevation angle in degrees
108
+ azimuth: View azimuth angle in degrees
109
+ show_axes: Whether to show crystallographic axes
110
+ show_grid: Whether to show background grid
111
+ info_properties: Dict of properties to show in info panel
112
+
113
+ Returns:
114
+ SVG string
115
+
116
+ Example:
117
+ >>> svg = generate_crystal_svg("cubic[m3m]:{111}@1.0 + {100}@1.3")
118
+ >>> with open("crystal.svg", "w") as f:
119
+ ... f.write(svg)
120
+ """
121
+ import os
122
+ import tempfile
123
+
124
+ with tempfile.NamedTemporaryFile(suffix=".svg", delete=False) as f:
125
+ output_path = f.name
126
+
127
+ try:
128
+ generate_cdl_svg(
129
+ cdl,
130
+ output_path,
131
+ elev=elevation,
132
+ azim=azimuth,
133
+ show_axes=show_axes,
134
+ show_grid=show_grid,
135
+ info_properties=info_properties,
136
+ )
137
+ with open(output_path) as f:
138
+ return f.read()
139
+ finally:
140
+ if os.path.exists(output_path):
141
+ os.unlink(output_path)
142
+
143
+
144
+ def generate_preset_svg(
145
+ preset_name: str,
146
+ *,
147
+ elevation: float = 30.0,
148
+ azimuth: float = -45.0,
149
+ show_axes: bool = True,
150
+ show_grid: bool = True,
151
+ info_panel: bool = True,
152
+ ) -> str:
153
+ """
154
+ Generate an SVG visualization of a preset gemstone.
155
+
156
+ Args:
157
+ preset_name: Name of the preset (e.g., "diamond", "ruby", "emerald")
158
+ elevation: View elevation angle in degrees
159
+ azimuth: View azimuth angle in degrees
160
+ show_axes: Whether to show crystallographic axes
161
+ show_grid: Whether to show background grid
162
+ info_panel: Whether to include FGA info panel (default True for presets)
163
+
164
+ Returns:
165
+ SVG string
166
+
167
+ Example:
168
+ >>> svg = generate_preset_svg("diamond", info_panel=True)
169
+ """
170
+ preset = get_preset(preset_name)
171
+ if preset is None:
172
+ raise ValueError(f"Unknown preset: {preset_name}")
173
+
174
+ # Get CDL string from preset dict
175
+ cdl = preset.get('cdl')
176
+ if not cdl:
177
+ raise ValueError(f"Preset '{preset_name}' has no CDL definition")
178
+
179
+ # Build info properties from preset if info_panel is True
180
+ info_props = None
181
+ if info_panel:
182
+ info_props = {
183
+ 'name': preset.get('name', preset_name),
184
+ 'chemistry': preset.get('chemistry'),
185
+ 'system': preset.get('system'),
186
+ 'hardness': preset.get('hardness'),
187
+ 'ri': preset.get('ri'),
188
+ 'sg': preset.get('sg'),
189
+ }
190
+ # Remove None values
191
+ info_props = {k: v for k, v in info_props.items() if v is not None}
192
+
193
+ return generate_crystal_svg(
194
+ cdl,
195
+ elevation=elevation,
196
+ azimuth=azimuth,
197
+ show_axes=show_axes,
198
+ show_grid=show_grid,
199
+ info_properties=info_props,
200
+ )