crhelp 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.
- crhelp-1.0.0/LICENSE +21 -0
- crhelp-1.0.0/PKG-INFO +45 -0
- crhelp-1.0.0/README.md +30 -0
- crhelp-1.0.0/pyproject.toml +27 -0
- crhelp-1.0.0/setup.cfg +4 -0
- crhelp-1.0.0/src/crhelp/__init__.py +6 -0
- crhelp-1.0.0/src/crhelp/cli.py +85 -0
- crhelp-1.0.0/src/crhelp/data/allcodes.txt +1633 -0
- crhelp-1.0.0/src/crhelp/data/turtlecode.txt +164 -0
- crhelp-1.0.0/src/crhelp.egg-info/PKG-INFO +45 -0
- crhelp-1.0.0/src/crhelp.egg-info/SOURCES.txt +12 -0
- crhelp-1.0.0/src/crhelp.egg-info/dependency_links.txt +1 -0
- crhelp-1.0.0/src/crhelp.egg-info/entry_points.txt +2 -0
- crhelp-1.0.0/src/crhelp.egg-info/top_level.txt +1 -0
crhelp-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 crhelp contributors
|
|
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.
|
crhelp-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: crhelp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Cognitive Robotics Helper - Quick access to lab code snippets for Raspberry Pi, Arduino, ROS 2, and TurtleBot.
|
|
5
|
+
License: MIT
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Topic :: Education
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
11
|
+
Requires-Python: >=3.7
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Dynamic: license-file
|
|
15
|
+
|
|
16
|
+
# crhelp — Cognitive Robotics Helper
|
|
17
|
+
|
|
18
|
+
A simple CLI tool to quickly view lab code snippets for Cognitive Robotics coursework.
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install crhelp
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# List available code files
|
|
30
|
+
crhelp list
|
|
31
|
+
|
|
32
|
+
# View a specific file
|
|
33
|
+
crhelp show allcodes
|
|
34
|
+
crhelp show turtlecode
|
|
35
|
+
|
|
36
|
+
# Check version
|
|
37
|
+
crhelp --version
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Available Files
|
|
41
|
+
|
|
42
|
+
| Name | Description |
|
|
43
|
+
|------|-------------|
|
|
44
|
+
| `allcodes` | Lab codes for Raspberry Pi, Arduino, Robo Car, and TurtleBot ROS 2 |
|
|
45
|
+
| `turtlecode` | Multi-turtle ROS 2 controller (square + zigzag formations) |
|
crhelp-1.0.0/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# crhelp — Cognitive Robotics Helper
|
|
2
|
+
|
|
3
|
+
A simple CLI tool to quickly view lab code snippets for Cognitive Robotics coursework.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install crhelp
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# List available code files
|
|
15
|
+
crhelp list
|
|
16
|
+
|
|
17
|
+
# View a specific file
|
|
18
|
+
crhelp show allcodes
|
|
19
|
+
crhelp show turtlecode
|
|
20
|
+
|
|
21
|
+
# Check version
|
|
22
|
+
crhelp --version
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Available Files
|
|
26
|
+
|
|
27
|
+
| Name | Description |
|
|
28
|
+
|------|-------------|
|
|
29
|
+
| `allcodes` | Lab codes for Raspberry Pi, Arduino, Robo Car, and TurtleBot ROS 2 |
|
|
30
|
+
| `turtlecode` | Multi-turtle ROS 2 controller (square + zigzag formations) |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "crhelp"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Cognitive Robotics Helper - Quick access to lab code snippets for Raspberry Pi, Arduino, ROS 2, and TurtleBot."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.7"
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"License :: OSI Approved :: MIT License",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Topic :: Education",
|
|
17
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
crhelp = "crhelp.cli:main"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools.packages.find]
|
|
24
|
+
where = ["src"]
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.package-data]
|
|
27
|
+
crhelp = ["data/*.txt"]
|
crhelp-1.0.0/setup.cfg
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Command-line interface for crhelp.
|
|
2
|
+
|
|
3
|
+
Usage:
|
|
4
|
+
crhelp list List available code files.
|
|
5
|
+
crhelp show <name> Display contents of a code file.
|
|
6
|
+
crhelp --version Print version.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import argparse
|
|
10
|
+
import sys
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
from crhelp import __version__
|
|
14
|
+
|
|
15
|
+
# ---------------------------------------------------------------------------
|
|
16
|
+
# Resolve the data directory bundled inside the installed package.
|
|
17
|
+
# ---------------------------------------------------------------------------
|
|
18
|
+
_DATA_DIR = Path(__file__).resolve().parent / "data"
|
|
19
|
+
|
|
20
|
+
# Only the two original files are exposed.
|
|
21
|
+
_AVAILABLE_FILES = {
|
|
22
|
+
"allcodes": _DATA_DIR / "allcodes.txt",
|
|
23
|
+
"turtlecode": _DATA_DIR / "turtlecode.txt",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _cmd_list(args):
|
|
28
|
+
"""Print the names of all available code files."""
|
|
29
|
+
print("Available files:")
|
|
30
|
+
for name in sorted(_AVAILABLE_FILES):
|
|
31
|
+
print(f" {name}")
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _cmd_show(args):
|
|
35
|
+
"""Print the full contents of the requested file to stdout."""
|
|
36
|
+
name = args.name
|
|
37
|
+
if name not in _AVAILABLE_FILES:
|
|
38
|
+
print(f"Error: '{name}' is not a valid file name.", file=sys.stderr)
|
|
39
|
+
print(f"Run 'crhelp list' to see available files.", file=sys.stderr)
|
|
40
|
+
sys.exit(1)
|
|
41
|
+
|
|
42
|
+
filepath = _AVAILABLE_FILES[name]
|
|
43
|
+
if not filepath.exists():
|
|
44
|
+
print(f"Error: data file '{filepath}' not found.", file=sys.stderr)
|
|
45
|
+
sys.exit(1)
|
|
46
|
+
|
|
47
|
+
print(filepath.read_text(encoding="utf-8"))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def main():
|
|
51
|
+
parser = argparse.ArgumentParser(
|
|
52
|
+
prog="crhelp",
|
|
53
|
+
description="Cognitive Robotics Helper - view lab code snippets.",
|
|
54
|
+
)
|
|
55
|
+
parser.add_argument(
|
|
56
|
+
"--version",
|
|
57
|
+
action="version",
|
|
58
|
+
version=f"%(prog)s {__version__}",
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
subparsers = parser.add_subparsers(dest="command")
|
|
62
|
+
|
|
63
|
+
# --- crhelp list ---
|
|
64
|
+
subparsers.add_parser("list", help="List available code files.")
|
|
65
|
+
|
|
66
|
+
# --- crhelp show <name> ---
|
|
67
|
+
show_parser = subparsers.add_parser("show", help="Display a code file.")
|
|
68
|
+
show_parser.add_argument(
|
|
69
|
+
"name",
|
|
70
|
+
help="Name of the file to display (e.g. allcodes, turtlecode).",
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
args = parser.parse_args()
|
|
74
|
+
|
|
75
|
+
if args.command == "list":
|
|
76
|
+
_cmd_list(args)
|
|
77
|
+
elif args.command == "show":
|
|
78
|
+
_cmd_show(args)
|
|
79
|
+
else:
|
|
80
|
+
parser.print_help()
|
|
81
|
+
sys.exit(0)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
if __name__ == "__main__":
|
|
85
|
+
main()
|