gemfyi 0.1.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.
- gemfyi-0.1.0/LICENSE +21 -0
- gemfyi-0.1.0/PKG-INFO +63 -0
- gemfyi-0.1.0/README.md +23 -0
- gemfyi-0.1.0/demo.tape +34 -0
- gemfyi-0.1.0/pyproject.toml +86 -0
- gemfyi-0.1.0/src/gemfyi/__init__.py +3 -0
- gemfyi-0.1.0/src/gemfyi/api.py +58 -0
- gemfyi-0.1.0/src/gemfyi/cli.py +19 -0
- gemfyi-0.1.0/src/gemfyi/mcp_server.py +18 -0
- gemfyi-0.1.0/src/gemfyi/py.typed +0 -0
- gemfyi-0.1.0/tests/__init__.py +0 -0
- gemfyi-0.1.0/tests/test_basic.py +7 -0
- gemfyi-0.1.0/uv.lock +1137 -0
gemfyi-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 FYIPedia
|
|
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.
|
gemfyi-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: gemfyi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Gemstone and mineralogy reference API client — gemfyi.com
|
|
5
|
+
Project-URL: Homepage, https://gemfyi.com
|
|
6
|
+
Project-URL: Documentation, https://gemfyi.com/developers/
|
|
7
|
+
Project-URL: Repository, https://github.com/fyipedia/gemfyi
|
|
8
|
+
Project-URL: Issues, https://github.com/fyipedia/gemfyi/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/fyipedia/gemfyi/releases
|
|
10
|
+
Author: FYIPedia
|
|
11
|
+
License-Expression: MIT
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: carat,diamond,gem,gemstone,grading,jewelry,mineralogy,precious-stone
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Classifier: Typing :: Typed
|
|
26
|
+
Requires-Python: >=3.10
|
|
27
|
+
Provides-Extra: all
|
|
28
|
+
Requires-Dist: httpx>=0.27; extra == 'all'
|
|
29
|
+
Requires-Dist: mcp>=1.0; extra == 'all'
|
|
30
|
+
Requires-Dist: rich>=13.0; extra == 'all'
|
|
31
|
+
Requires-Dist: typer>=0.15; extra == 'all'
|
|
32
|
+
Provides-Extra: api
|
|
33
|
+
Requires-Dist: httpx>=0.27; extra == 'api'
|
|
34
|
+
Provides-Extra: cli
|
|
35
|
+
Requires-Dist: rich>=13.0; extra == 'cli'
|
|
36
|
+
Requires-Dist: typer>=0.15; extra == 'cli'
|
|
37
|
+
Provides-Extra: mcp
|
|
38
|
+
Requires-Dist: mcp>=1.0; extra == 'mcp'
|
|
39
|
+
Description-Content-Type: text/markdown
|
|
40
|
+
|
|
41
|
+
# gemfyi
|
|
42
|
+
|
|
43
|
+
Gemstone and mineralogy reference API client — [gemfyi.com](https://gemfyi.com)
|
|
44
|
+
|
|
45
|
+
## Install
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pip install gemfyi
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
from gemfyi.api import GemFYI
|
|
55
|
+
|
|
56
|
+
with GemFYI() as api:
|
|
57
|
+
results = api.search("diamond")
|
|
58
|
+
print(results)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT
|
gemfyi-0.1.0/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# gemfyi
|
|
2
|
+
|
|
3
|
+
Gemstone and mineralogy reference API client — [gemfyi.com](https://gemfyi.com)
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install gemfyi
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from gemfyi.api import GemFYI
|
|
15
|
+
|
|
16
|
+
with GemFYI() as api:
|
|
17
|
+
results = api.search("diamond")
|
|
18
|
+
print(results)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## License
|
|
22
|
+
|
|
23
|
+
MIT
|
gemfyi-0.1.0/demo.tape
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# gemfyi — Python API Client Demo
|
|
2
|
+
Output demo.gif
|
|
3
|
+
|
|
4
|
+
Set FontSize 20
|
|
5
|
+
Set Width 1000
|
|
6
|
+
Set Height 580
|
|
7
|
+
Set Shell "zsh"
|
|
8
|
+
Set Theme "Catppuccin Mocha"
|
|
9
|
+
Set TypingSpeed 30ms
|
|
10
|
+
Set Padding 24
|
|
11
|
+
|
|
12
|
+
Type "uv run --with 'gemfyi[api]' python3"
|
|
13
|
+
Enter
|
|
14
|
+
Sleep 2.5s
|
|
15
|
+
|
|
16
|
+
Type "from gemfyi.api import GemFYI"
|
|
17
|
+
Enter
|
|
18
|
+
Sleep 1s
|
|
19
|
+
|
|
20
|
+
Type "client = GemFYI()"
|
|
21
|
+
Enter
|
|
22
|
+
Sleep 1s
|
|
23
|
+
|
|
24
|
+
Type "# Search gemfyi.com"
|
|
25
|
+
Enter
|
|
26
|
+
Sleep 0.5s
|
|
27
|
+
|
|
28
|
+
Type "client.search('diamond')"
|
|
29
|
+
Enter
|
|
30
|
+
Sleep 2.5s
|
|
31
|
+
|
|
32
|
+
Type "exit()"
|
|
33
|
+
Enter
|
|
34
|
+
Sleep 1s
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "gemfyi"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Gemstone and mineralogy reference API client — gemfyi.com"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
requires-python = ">=3.10"
|
|
8
|
+
authors = [{ name = "FYIPedia" }]
|
|
9
|
+
keywords = [
|
|
10
|
+
"gemstone",
|
|
11
|
+
"jewelry",
|
|
12
|
+
"mineralogy",
|
|
13
|
+
"gem",
|
|
14
|
+
"grading",
|
|
15
|
+
"carat",
|
|
16
|
+
"diamond",
|
|
17
|
+
"precious-stone",
|
|
18
|
+
]
|
|
19
|
+
classifiers = [
|
|
20
|
+
"Development Status :: 4 - Beta",
|
|
21
|
+
"Intended Audience :: Developers",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Programming Language :: Python :: 3.10",
|
|
25
|
+
"Programming Language :: Python :: 3.11",
|
|
26
|
+
"Programming Language :: Python :: 3.12",
|
|
27
|
+
"Programming Language :: Python :: 3.13",
|
|
28
|
+
"Programming Language :: Python :: 3.14",
|
|
29
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
30
|
+
"Typing :: Typed",
|
|
31
|
+
"Environment :: Console",
|
|
32
|
+
]
|
|
33
|
+
dependencies = []
|
|
34
|
+
|
|
35
|
+
[project.optional-dependencies]
|
|
36
|
+
api = ["httpx>=0.27"]
|
|
37
|
+
cli = ["typer>=0.15", "rich>=13.0"]
|
|
38
|
+
mcp = ["mcp>=1.0"]
|
|
39
|
+
all = ["gemfyi[api,cli,mcp]"]
|
|
40
|
+
|
|
41
|
+
[project.scripts]
|
|
42
|
+
gemfyi = "gemfyi.cli:app"
|
|
43
|
+
|
|
44
|
+
[project.entry-points."mcp.servers"]
|
|
45
|
+
gemfyi = "gemfyi.mcp_server:mcp"
|
|
46
|
+
|
|
47
|
+
[project.urls]
|
|
48
|
+
Homepage = "https://gemfyi.com"
|
|
49
|
+
Documentation = "https://gemfyi.com/developers/"
|
|
50
|
+
Repository = "https://github.com/fyipedia/gemfyi"
|
|
51
|
+
Issues = "https://github.com/fyipedia/gemfyi/issues"
|
|
52
|
+
Changelog = "https://github.com/fyipedia/gemfyi/releases"
|
|
53
|
+
|
|
54
|
+
[build-system]
|
|
55
|
+
requires = ["hatchling"]
|
|
56
|
+
build-backend = "hatchling.build"
|
|
57
|
+
|
|
58
|
+
[tool.hatch.build.targets.wheel]
|
|
59
|
+
packages = ["src/gemfyi"]
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
testpaths = ["tests"]
|
|
63
|
+
addopts = "-v --tb=short"
|
|
64
|
+
|
|
65
|
+
[tool.ruff]
|
|
66
|
+
target-version = "py310"
|
|
67
|
+
line-length = 100
|
|
68
|
+
|
|
69
|
+
[tool.ruff.lint]
|
|
70
|
+
select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
|
|
71
|
+
ignore = ["RUF022"]
|
|
72
|
+
|
|
73
|
+
[tool.mypy]
|
|
74
|
+
python_version = "3.10"
|
|
75
|
+
strict = true
|
|
76
|
+
|
|
77
|
+
[dependency-groups]
|
|
78
|
+
dev = [
|
|
79
|
+
"httpx>=0.27",
|
|
80
|
+
"mcp>=1.0",
|
|
81
|
+
"mypy>=1.19.1",
|
|
82
|
+
"pytest>=9.0.2",
|
|
83
|
+
"rich>=13.0",
|
|
84
|
+
"ruff>=0.15.4",
|
|
85
|
+
"typer>=0.15",
|
|
86
|
+
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""HTTP API client for gemfyi.com REST endpoints.
|
|
2
|
+
|
|
3
|
+
Requires the ``api`` extra: ``pip install gemfyi[api]``
|
|
4
|
+
|
|
5
|
+
Usage::
|
|
6
|
+
|
|
7
|
+
from gemfyi.api import GemFYI
|
|
8
|
+
|
|
9
|
+
with GemFYI() as api:
|
|
10
|
+
results = api.search("diamond")
|
|
11
|
+
print(results)
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
from typing import Any
|
|
17
|
+
|
|
18
|
+
import httpx
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class GemFYI:
|
|
22
|
+
"""API client for the gemfyi.com REST API.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
base_url: API base URL. Defaults to ``https://gemfyi.com``.
|
|
26
|
+
timeout: Request timeout in seconds. Defaults to ``10.0``.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
def __init__(
|
|
30
|
+
self,
|
|
31
|
+
base_url: str = "https://gemfyi.com",
|
|
32
|
+
timeout: float = 10.0,
|
|
33
|
+
) -> None:
|
|
34
|
+
self._client = httpx.Client(base_url=base_url, timeout=timeout)
|
|
35
|
+
|
|
36
|
+
def _get(self, path: str, **params: Any) -> dict[str, Any]:
|
|
37
|
+
resp = self._client.get(path, params={k: v for k, v in params.items() if v is not None})
|
|
38
|
+
resp.raise_for_status()
|
|
39
|
+
result: dict[str, Any] = resp.json()
|
|
40
|
+
return result
|
|
41
|
+
|
|
42
|
+
def search(self, query: str) -> dict[str, Any]:
|
|
43
|
+
"""Search across all content.
|
|
44
|
+
|
|
45
|
+
Args:
|
|
46
|
+
query: Search term (e.g. ``"diamond"``).
|
|
47
|
+
"""
|
|
48
|
+
return self._get("/api/search/", q=query)
|
|
49
|
+
|
|
50
|
+
def close(self) -> None:
|
|
51
|
+
"""Close the underlying HTTP connection."""
|
|
52
|
+
self._client.close()
|
|
53
|
+
|
|
54
|
+
def __enter__(self) -> GemFYI:
|
|
55
|
+
return self
|
|
56
|
+
|
|
57
|
+
def __exit__(self, *_: object) -> None:
|
|
58
|
+
self.close()
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Command-line interface for gemfyi."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
|
|
7
|
+
import typer
|
|
8
|
+
|
|
9
|
+
from gemfyi.api import GemFYI
|
|
10
|
+
|
|
11
|
+
app = typer.Typer(help="GemFYI — Gemstone and mineralogy reference API client.")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@app.command()
|
|
15
|
+
def search(query: str) -> None:
|
|
16
|
+
"""Search gemfyi.com."""
|
|
17
|
+
with GemFYI() as api:
|
|
18
|
+
result = api.search(query)
|
|
19
|
+
typer.echo(json.dumps(result, indent=2))
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""MCP server for gemfyi."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any
|
|
6
|
+
|
|
7
|
+
from mcp.server.fastmcp import FastMCP
|
|
8
|
+
|
|
9
|
+
from gemfyi.api import GemFYI
|
|
10
|
+
|
|
11
|
+
mcp = FastMCP("gemfyi")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@mcp.tool()
|
|
15
|
+
def search_gemfyi(query: str) -> dict[str, Any]:
|
|
16
|
+
"""Search gemfyi.com for content matching the query."""
|
|
17
|
+
with GemFYI() as api:
|
|
18
|
+
return api.search(query)
|
|
File without changes
|
|
File without changes
|