meshub 0.0.1__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.
meshub-0.0.1/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Giacomo Marciani
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,5 @@
1
+ include README.md
2
+ include LICENSE
3
+ recursive-include src/meshub *.py
4
+ recursive-exclude * __pycache__
5
+ recursive-exclude * *.py[co]
meshub-0.0.1/PKG-INFO ADDED
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: meshub
3
+ Version: 0.0.1
4
+ Summary: Official CLI for Meshub
5
+ Author-email: Meshub Team <support@meshub.us>
6
+ License: MIT
7
+ Project-URL: Homepage, https://meshub.us
8
+ Project-URL: Repository, https://github.com/gmarciani/meshub-cli
9
+ Project-URL: Issues, https://github.com/gmarciani/meshub-cli/issues
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Requires-Python: >=3.12
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: click~=8.1
19
+ Requires-Dist: PyYAML~=6.0
20
+ Requires-Dist: requests~=2.32
21
+ Provides-Extra: dev
22
+ Requires-Dist: black~=25.11; extra == "dev"
23
+ Requires-Dist: build~=1.3; extra == "dev"
24
+ Requires-Dist: flake8~=7.3; extra == "dev"
25
+ Requires-Dist: mypy~=1.18; extra == "dev"
26
+ Requires-Dist: pytest~=9.0; extra == "dev"
27
+ Requires-Dist: pytest-cov~=7.0; extra == "dev"
28
+ Requires-Dist: tox~=4.32; extra == "dev"
29
+ Requires-Dist: twine~=6.2; extra == "dev"
30
+ Requires-Dist: types-PyYAML~=6.0; extra == "dev"
31
+ Requires-Dist: types-requests~=2.32; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # meshub-cli
35
+
36
+ Official CLI for Meshub - A powerful command-line interface for managing your Meshub projects.
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ pip install meshub-cli
42
+ ```
43
+
44
+ ## License
45
+
46
+ MIT License - see LICENSE file for details.
meshub-0.0.1/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # meshub-cli
2
+
3
+ Official CLI for Meshub - A powerful command-line interface for managing your Meshub projects.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install meshub-cli
9
+ ```
10
+
11
+ ## License
12
+
13
+ MIT License - see LICENSE file for details.
@@ -0,0 +1,68 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "meshub"
7
+ dynamic = ["version"]
8
+ description = "Official CLI for Meshub"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ authors = [
12
+ {name = "Meshub Team", email = "support@meshub.us"}
13
+ ]
14
+ classifiers = [
15
+ "Development Status :: 4 - Beta",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.12",
20
+ ]
21
+ requires-python = ">=3.12"
22
+ dependencies = [
23
+ "click~=8.1",
24
+ "PyYAML~=6.0",
25
+ "requests~=2.32",
26
+ ]
27
+
28
+ [project.optional-dependencies]
29
+ dev = [
30
+ "black~=25.11",
31
+ "build~=1.3",
32
+ "flake8~=7.3",
33
+ "mypy~=1.18",
34
+ "pytest~=9.0",
35
+ "pytest-cov~=7.0",
36
+ "tox~=4.32",
37
+ "twine~=6.2",
38
+ "types-PyYAML~=6.0",
39
+ "types-requests~=2.32",
40
+ ]
41
+
42
+ [project.scripts]
43
+ meshub = "meshub.cli:main"
44
+
45
+ [project.urls]
46
+ Homepage = "https://meshub.us"
47
+ Repository = "https://github.com/gmarciani/meshub-cli"
48
+ Issues = "https://github.com/gmarciani/meshub-cli/issues"
49
+
50
+ [tool.setuptools.packages.find]
51
+ where = ["src"]
52
+ include = ["meshub*"]
53
+
54
+ [tool.setuptools.dynamic]
55
+ version = {attr = "meshub.constants.__version__"}
56
+
57
+ [tool.black]
58
+ line-length = 88
59
+ target-version = ['py311']
60
+
61
+ [tool.mypy]
62
+ python_version = "3.12"
63
+ warn_return_any = true
64
+ warn_unused_configs = true
65
+ disallow_untyped_defs = true
66
+
67
+ [tool.coverage.run]
68
+ omit = ["*/__init__.py"]
meshub-0.0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,4 @@
1
+ # Copyright (c) 2025, Meshub
2
+ # Licensed under the MIT License
3
+
4
+ """Meshub CLI - Official CLI for Meshub."""
@@ -0,0 +1,31 @@
1
+ # Copyright (c) 2025, Meshub
2
+ # Licensed under the MIT License
3
+
4
+ """Main CLI module for Meshub CLI."""
5
+
6
+ import click
7
+ import logging
8
+ from meshub.constants import __version__
9
+ from meshub.commands import config
10
+
11
+
12
+ @click.group()
13
+ @click.version_option(version=__version__, prog_name="meshub")
14
+ @click.option("--verbose", "-v", is_flag=True, help="Enable verbose output")
15
+ @click.pass_context
16
+ def main(ctx: click.Context, verbose: bool) -> None:
17
+ """Meshub CLI - Official CLI for Meshub."""
18
+ ctx.ensure_object(dict)
19
+ ctx.obj["verbose"] = verbose
20
+
21
+ # Configure logging
22
+ level = logging.DEBUG if verbose else logging.INFO
23
+ logging.basicConfig(level=level, format="%(levelname)s: %(message)s")
24
+
25
+
26
+ # Add command groups
27
+ main.add_command(config.config)
28
+
29
+
30
+ if __name__ == "__main__":
31
+ main()
@@ -0,0 +1,4 @@
1
+ # Copyright (c) 2025, Meshub
2
+ # Licensed under the MIT License
3
+
4
+ """Commands package for Meshub CLI."""
@@ -0,0 +1,72 @@
1
+ # Copyright (c) 2025, Meshub
2
+ # Licensed under the MIT License
3
+
4
+ """Configuration commands for Meshub CLI."""
5
+
6
+ import click
7
+ import logging
8
+ import json
9
+ from meshub.config.configuration import (
10
+ load_config,
11
+ save_config,
12
+ load_default_config,
13
+ get_config_path,
14
+ )
15
+
16
+ logger = logging.getLogger(__name__)
17
+
18
+
19
+ @click.group()
20
+ def config() -> None:
21
+ """Manage configurations."""
22
+ pass
23
+
24
+
25
+ @config.command()
26
+ @click.argument("key")
27
+ @click.argument("value")
28
+ def set(key: str, value: str) -> None:
29
+ """Set a configuration value."""
30
+ default_config = load_default_config()
31
+ if key not in default_config:
32
+ logger.error(f"Unknown configuration key '{key}'")
33
+ return
34
+
35
+ cfg = load_config()
36
+ old_value = cfg.get(key)
37
+ cfg[key] = value
38
+ save_config(cfg)
39
+
40
+ result = {"key": key, "value": value, "oldValue": old_value}
41
+ print(json.dumps(result, indent=2))
42
+
43
+
44
+ @config.command()
45
+ @click.argument("key")
46
+ def get(key: str) -> None:
47
+ """Get a configuration value."""
48
+ cfg = load_config()
49
+ if key not in cfg:
50
+ logger.error(f"Unknown configuration key '{key}'")
51
+ return
52
+
53
+ result = {"key": key, "value": cfg[key]}
54
+ print(json.dumps(result, indent=2))
55
+
56
+
57
+ @config.command()
58
+ def show() -> None:
59
+ """Show all configuration values as JSON."""
60
+ cfg = load_config()
61
+ print(json.dumps(cfg, indent=2))
62
+
63
+
64
+ @config.command()
65
+ def reset() -> None:
66
+ """Reset configuration to defaults and delete local config file."""
67
+ cfg = load_config()
68
+ print(json.dumps(cfg, indent=2))
69
+
70
+ config_path = get_config_path()
71
+ if config_path.exists():
72
+ config_path.unlink()
File without changes
@@ -0,0 +1,51 @@
1
+ # Copyright (c) 2025, Meshub
2
+ # Licensed under the MIT License
3
+
4
+ """Configuration utilities for Meshub CLI."""
5
+
6
+ import yaml
7
+ from pathlib import Path
8
+ from typing import Dict, Any
9
+ import importlib.resources
10
+
11
+
12
+ def get_config_path() -> Path:
13
+ """Get the configuration file path."""
14
+ config_dir = Path.home() / ".meshub"
15
+ config_dir.mkdir(exist_ok=True)
16
+ return config_dir / "config.yaml"
17
+
18
+
19
+ def load_default_config() -> Dict[str, Any]:
20
+ """Load default configuration from packaged config.yaml."""
21
+ try:
22
+ with importlib.resources.open_text("meshub", "config.yaml") as f:
23
+ data = yaml.safe_load(f)
24
+ return data if isinstance(data, dict) else {}
25
+ except (yaml.YAMLError, IOError, FileNotFoundError):
26
+ return {}
27
+
28
+
29
+ def load_config() -> Dict[str, Any]:
30
+ """Load configuration from file, merging with defaults."""
31
+ default_config = load_default_config()
32
+ config_path = get_config_path()
33
+
34
+ if not config_path.exists():
35
+ return default_config
36
+
37
+ try:
38
+ with open(config_path, "r") as f:
39
+ user_config = yaml.safe_load(f)
40
+ if isinstance(user_config, dict):
41
+ default_config.update(user_config)
42
+ return default_config
43
+ except (yaml.YAMLError, IOError):
44
+ return default_config
45
+
46
+
47
+ def save_config(config: Dict[str, Any]) -> None:
48
+ """Save configuration to file."""
49
+ config_path = get_config_path()
50
+ with open(config_path, "w") as f:
51
+ yaml.safe_dump(config, f, indent=2)
@@ -0,0 +1,6 @@
1
+ # Copyright (c) 2025, Meshub
2
+ # Licensed under the MIT License
3
+
4
+ """Constants for Meshub CLI."""
5
+
6
+ __version__ = "0.0.1"
@@ -0,0 +1,46 @@
1
+ Metadata-Version: 2.4
2
+ Name: meshub
3
+ Version: 0.0.1
4
+ Summary: Official CLI for Meshub
5
+ Author-email: Meshub Team <support@meshub.us>
6
+ License: MIT
7
+ Project-URL: Homepage, https://meshub.us
8
+ Project-URL: Repository, https://github.com/gmarciani/meshub-cli
9
+ Project-URL: Issues, https://github.com/gmarciani/meshub-cli/issues
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Requires-Python: >=3.12
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: click~=8.1
19
+ Requires-Dist: PyYAML~=6.0
20
+ Requires-Dist: requests~=2.32
21
+ Provides-Extra: dev
22
+ Requires-Dist: black~=25.11; extra == "dev"
23
+ Requires-Dist: build~=1.3; extra == "dev"
24
+ Requires-Dist: flake8~=7.3; extra == "dev"
25
+ Requires-Dist: mypy~=1.18; extra == "dev"
26
+ Requires-Dist: pytest~=9.0; extra == "dev"
27
+ Requires-Dist: pytest-cov~=7.0; extra == "dev"
28
+ Requires-Dist: tox~=4.32; extra == "dev"
29
+ Requires-Dist: twine~=6.2; extra == "dev"
30
+ Requires-Dist: types-PyYAML~=6.0; extra == "dev"
31
+ Requires-Dist: types-requests~=2.32; extra == "dev"
32
+ Dynamic: license-file
33
+
34
+ # meshub-cli
35
+
36
+ Official CLI for Meshub - A powerful command-line interface for managing your Meshub projects.
37
+
38
+ ## Installation
39
+
40
+ ```bash
41
+ pip install meshub-cli
42
+ ```
43
+
44
+ ## License
45
+
46
+ MIT License - see LICENSE file for details.
@@ -0,0 +1,17 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ src/meshub/__init__.py
6
+ src/meshub/cli.py
7
+ src/meshub/constants.py
8
+ src/meshub.egg-info/PKG-INFO
9
+ src/meshub.egg-info/SOURCES.txt
10
+ src/meshub.egg-info/dependency_links.txt
11
+ src/meshub.egg-info/entry_points.txt
12
+ src/meshub.egg-info/requires.txt
13
+ src/meshub.egg-info/top_level.txt
14
+ src/meshub/commands/__init__.py
15
+ src/meshub/commands/config.py
16
+ src/meshub/config/__init__.py
17
+ src/meshub/config/configuration.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ meshub = meshub.cli:main
@@ -0,0 +1,15 @@
1
+ click~=8.1
2
+ PyYAML~=6.0
3
+ requests~=2.32
4
+
5
+ [dev]
6
+ black~=25.11
7
+ build~=1.3
8
+ flake8~=7.3
9
+ mypy~=1.18
10
+ pytest~=9.0
11
+ pytest-cov~=7.0
12
+ tox~=4.32
13
+ twine~=6.2
14
+ types-PyYAML~=6.0
15
+ types-requests~=2.32
@@ -0,0 +1 @@
1
+ meshub