grafeo-cli 0.5.33__py3-none-win_amd64.whl

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.
grafeo_cli/__init__.py ADDED
@@ -0,0 +1,89 @@
1
+ """Grafeo CLI launcher.
2
+
3
+ Thin wrapper that finds and runs the grafeo binary bundled with this package.
4
+ Install with: pip install grafeo-cli
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import os
10
+ import platform
11
+ import subprocess
12
+ import sys
13
+ from pathlib import Path
14
+
15
+ __version__ = "0.5.33"
16
+
17
+ # GitHub release download URL template
18
+ _GITHUB_RELEASE = "https://github.com/GrafeoDB/grafeo/releases/download"
19
+
20
+
21
+ def _binary_name() -> str:
22
+ """Return the platform-specific binary name."""
23
+ return "grafeo.exe" if platform.system() == "Windows" else "grafeo"
24
+
25
+
26
+ def _find_binary() -> Path | None:
27
+ """Find the grafeo binary.
28
+
29
+ Search order:
30
+ 1. Bundled with this package (wheel data)
31
+ 2. Adjacent to this package (development installs)
32
+ 3. On PATH
33
+ """
34
+ binary = _binary_name()
35
+
36
+ # 1. Bundled in package directory
37
+ pkg_dir = Path(__file__).parent
38
+ bundled = pkg_dir / binary
39
+ if bundled.is_file():
40
+ return bundled
41
+
42
+ # 2. Adjacent to package (e.g., bin/ directory in virtualenv)
43
+ for bin_dir in [pkg_dir.parent / "bin", pkg_dir.parent / "Scripts"]:
44
+ candidate = bin_dir / binary
45
+ if candidate.is_file():
46
+ return candidate
47
+
48
+ # 3. On system PATH
49
+ from shutil import which
50
+
51
+ on_path = which("grafeo")
52
+ if on_path:
53
+ return Path(on_path)
54
+
55
+ return None
56
+
57
+
58
+ def main() -> None:
59
+ """Run the grafeo CLI binary, forwarding all arguments."""
60
+ binary = _find_binary()
61
+
62
+ if binary is None:
63
+ print(
64
+ "error: grafeo binary not found.\n"
65
+ "\n"
66
+ "The grafeo-cli package is a thin launcher for the Grafeo CLI binary.\n"
67
+ "Install the binary via one of:\n"
68
+ f" - Download from {_GITHUB_RELEASE}/v{__version__}/\n"
69
+ " - cargo install grafeo-cli\n"
70
+ " - Place the 'grafeo' binary on your PATH\n",
71
+ file=sys.stderr,
72
+ )
73
+ sys.exit(1)
74
+
75
+ # Make binary executable on Unix
76
+ if os.name != "nt":
77
+ binary.chmod(binary.stat().st_mode | 0o111)
78
+
79
+ try:
80
+ result = subprocess.run(
81
+ [str(binary), *sys.argv[1:]],
82
+ check=False,
83
+ )
84
+ sys.exit(result.returncode)
85
+ except KeyboardInterrupt:
86
+ sys.exit(130)
87
+ except FileNotFoundError:
88
+ print(f"error: failed to execute {binary}", file=sys.stderr)
89
+ sys.exit(1)
grafeo_cli/__main__.py ADDED
@@ -0,0 +1,5 @@
1
+ """Allow running the CLI via `python -m grafeo_cli`."""
2
+
3
+ from grafeo_cli import main
4
+
5
+ main()
grafeo_cli/grafeo.exe ADDED
Binary file
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: grafeo-cli
3
+ Version: 0.5.33
4
+ Summary: Command-line interface for Grafeo graph database
5
+ Project-URL: Homepage, https://grafeo.dev
6
+ Project-URL: Documentation, https://grafeo.dev/user-guide/cli
7
+ Project-URL: Repository, https://github.com/GrafeoDB/grafeo
8
+ Project-URL: Issues, https://github.com/GrafeoDB/grafeo/issues
9
+ Author: S.T. Grond
10
+ License: Apache-2.0
11
+ Keywords: cli,database,gql,grafeo,graph
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Rust
18
+ Classifier: Topic :: Database
19
+ Classifier: Topic :: Database :: Database Engines/Servers
20
+ Requires-Python: >=3.9
21
+ Description-Content-Type: text/markdown
22
+
23
+ # grafeo-cli
24
+
25
+ Command-line interface for [Grafeo](https://grafeo.dev) graph database.
26
+
27
+ This is a thin Python launcher package that runs the pre-built Grafeo CLI binary.
28
+
29
+ ## Installation
30
+
31
+ ```bash
32
+ uv add grafeo-cli
33
+ # or: pip install grafeo-cli
34
+ ```
35
+
36
+ The package looks for the `grafeo` binary in this order:
37
+ 1. Bundled with the wheel (platform-specific wheels)
38
+ 2. In the virtualenv `bin/` or `Scripts/` directory
39
+ 3. On your system `PATH`
40
+
41
+ If no binary is found, install it separately:
42
+
43
+ ```bash
44
+ # Via cargo
45
+ cargo install grafeo-cli
46
+
47
+ # Or download from GitHub releases
48
+ # https://github.com/GrafeoDB/grafeo/releases
49
+ ```
50
+
51
+ ## Usage
52
+
53
+ ```bash
54
+ # Database management
55
+ grafeo info ./my-db
56
+ grafeo stats ./my-db
57
+ grafeo validate ./my-db
58
+
59
+ # Query execution
60
+ grafeo query ./my-db "MATCH (n:Person) RETURN n.name"
61
+
62
+ # Interactive shell
63
+ grafeo shell ./my-db
64
+
65
+ # Create a new database
66
+ grafeo init ./new-db
67
+
68
+ # Shell completions
69
+ grafeo completions bash > ~/.local/share/bash-completion/completions/grafeo
70
+ ```
71
+
72
+ ## Links
73
+
74
+ - [Documentation](https://grafeo.dev)
75
+ - [GitHub](https://github.com/GrafeoDB/grafeo)
76
+ - [Grafeo Python Library](https://pypi.org/project/grafeo/) (the database engine, not this CLI tool)
77
+
78
+ ## License
79
+
80
+ Apache-2.0
@@ -0,0 +1,7 @@
1
+ grafeo_cli/__init__.py,sha256=R5ZT1lAbvL3eTx6V4Wi9CyjR3GW1Q2njJpXVCFbEsd8,2353
2
+ grafeo_cli/__main__.py,sha256=lKWNwlcnLVfML88xVqcXHMUB2aLvKi8umcnQsePM0ak,93
3
+ grafeo_cli/grafeo.exe,sha256=fi-rqw_b7Y2FgwxcqumfTEGT5eYuNUXVyQA1Y2QjZ4E,10499072
4
+ grafeo_cli-0.5.33.dist-info/METADATA,sha256=ATFiIpwFlx_rmO3arEw4s1_e1oGX8m9AYQrGvceOi6g,2047
5
+ grafeo_cli-0.5.33.dist-info/WHEEL,sha256=fip2IBhkkNvH-S_Xh3PV94_XVqHJB1nn9gTAcldDBj4,94
6
+ grafeo_cli-0.5.33.dist-info/entry_points.txt,sha256=KKaKkAJNnVWo-lVBSFAykz2_Lw2slApF2hLX9j9paEc,43
7
+ grafeo_cli-0.5.33.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-win_amd64
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ grafeo = grafeo_cli:main