bluer-sbc 8.188.1__py3-none-any.whl → 9.168.1__py3-none-any.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.
Files changed (53) hide show
  1. bluer_sbc/.abcli/actions.sh +3 -0
  2. bluer_sbc/.abcli/alias.sh +2 -2
  3. bluer_sbc/.abcli/{blue_sbc.sh → bluer_sbc.sh} +2 -0
  4. bluer_sbc/.abcli/rpi.sh +1 -1
  5. bluer_sbc/.abcli/sbc/parts/adjust.sh +14 -0
  6. bluer_sbc/.abcli/sbc/parts/cd.sh +5 -0
  7. bluer_sbc/.abcli/sbc/parts.sh +15 -0
  8. bluer_sbc/.abcli/seed/rpi_64_bit.sh +36 -0
  9. bluer_sbc/.abcli/tests/help.sh +7 -3
  10. bluer_sbc/.abcli/tests/parts_adjust.sh +13 -0
  11. bluer_sbc/README/aliases.py +11 -0
  12. bluer_sbc/README/build.py +29 -0
  13. bluer_sbc/README/design.py +40 -0
  14. bluer_sbc/README/designs/__init__.py +26 -0
  15. bluer_sbc/README/designs/adapter_bus.py +59 -0
  16. bluer_sbc/README/designs/battery_bus.py +52 -0
  17. bluer_sbc/README/designs/bryce.py +28 -0
  18. bluer_sbc/README/designs/cheshmak.py +29 -0
  19. bluer_sbc/README/designs/nafha.py +57 -0
  20. bluer_sbc/README/designs/shelter.py +63 -0
  21. bluer_sbc/README/designs/swallow.py +46 -0
  22. bluer_sbc/README/designs/swallow_head.py +89 -0
  23. bluer_sbc/README/designs/template.py +38 -0
  24. bluer_sbc/{designs → README/designs}/ultrasonic_sensor_tester.py +11 -10
  25. bluer_sbc/README/parts.py +29 -0
  26. bluer_sbc/README/root.py +33 -0
  27. bluer_sbc/README/shortcuts.py +18 -0
  28. bluer_sbc/__init__.py +2 -2
  29. bluer_sbc/__main__.py +3 -2
  30. bluer_sbc/config.env +1 -1
  31. bluer_sbc/env.py +4 -0
  32. bluer_sbc/help/functions.py +2 -0
  33. bluer_sbc/help/parts.py +49 -0
  34. bluer_sbc/help/rpi.py +2 -1
  35. bluer_sbc/parts/__init__.py +0 -0
  36. bluer_sbc/parts/__main__.py +48 -0
  37. bluer_sbc/parts/classes/db.py +233 -0
  38. bluer_sbc/parts/classes/part.py +96 -0
  39. bluer_sbc/parts/consts.py +3 -0
  40. bluer_sbc/parts/db.py +619 -0
  41. bluer_sbc-9.168.1.dist-info/METADATA +73 -0
  42. {bluer_sbc-8.188.1.dist-info → bluer_sbc-9.168.1.dist-info}/RECORD +48 -24
  43. bluer_sbc/README.py +0 -75
  44. bluer_sbc/designs/bluer_swallow.py +0 -26
  45. bluer_sbc/designs/bryce.py +0 -25
  46. bluer_sbc/designs/cheshmak.py +0 -25
  47. bluer_sbc-8.188.1.dist-info/METADATA +0 -63
  48. /bluer_sbc/{designs → README}/__init__.py +0 -0
  49. /bluer_sbc/{designs → README/designs}/blue_bracket.py +0 -0
  50. /bluer_sbc/{designs → README/designs}/consts.py +0 -0
  51. {bluer_sbc-8.188.1.dist-info → bluer_sbc-9.168.1.dist-info}/WHEEL +0 -0
  52. {bluer_sbc-8.188.1.dist-info → bluer_sbc-9.168.1.dist-info}/licenses/LICENSE +0 -0
  53. {bluer_sbc-8.188.1.dist-info → bluer_sbc-9.168.1.dist-info}/top_level.txt +0 -0
@@ -4,6 +4,9 @@ function bluer_sbc_action_git_before_push() {
4
4
  bluer_sbc build_README
5
5
  [[ $? -ne 0 ]] && return 1
6
6
 
7
+ bluer_sbc parts adjust ~grid
8
+ [[ $? -ne 0 ]] && return 1
9
+
7
10
  [[ "$(bluer_ai_git get_branch)" != "main" ]] &&
8
11
  return 0
9
12
 
bluer_sbc/.abcli/alias.sh CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  alias @camera=bluer_sbc_camera
4
4
 
5
- alias grove=bluer_sbc_grove
5
+ alias @designs=bluer-designs
6
6
 
7
- alias @rpi=bluer_sbc_rpi
7
+ alias grove=bluer_sbc_grove
8
8
 
9
9
  alias @sbc=bluer_sbc
@@ -9,3 +9,5 @@ function bluer_sbc() {
9
9
  }
10
10
 
11
11
  bluer_ai_log $(bluer_sbc version --show_icon 1)
12
+
13
+ bluer_ai_source_caller_suffix_path /sbc
bluer_sbc/.abcli/rpi.sh CHANGED
@@ -9,7 +9,7 @@ function bluer_sbc_rpi() {
9
9
  return
10
10
  fi
11
11
 
12
- bluer_ai_log_error "@rpi: $task: command not found."
12
+ bluer_ai_log_error "@sbc rpi: $task: command not found."
13
13
  return 1
14
14
  }
15
15
 
@@ -0,0 +1,14 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_sbc_parts_adjust() {
4
+ local options=$1
5
+ local do_dryrun=$(bluer_ai_option_int "$options" dryrun 0)
6
+ local generate_grid=$(bluer_ai_option_int "$options" grid 1)
7
+
8
+ bluer_ai_eval - \
9
+ python3 -m bluer_sbc.parts \
10
+ adjust \
11
+ --dryrun $do_dryrun \
12
+ --generate_grid $generate_grid \
13
+ "${@:2}"
14
+ }
@@ -0,0 +1,5 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_sbc_parts_cd() {
4
+ cd $abcli_path_git/assets2/bluer-sbc/parts
5
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_sbc_parts() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_sbc_parts_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_sbc.parts "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /parts
@@ -0,0 +1,36 @@
1
+ #! /usr/bin/env bash
2
+
3
+ # internal function to bluer_ai_seed.
4
+ # seed is NOT local
5
+ function bluer_ai_seed_rpi_64_bit() {
6
+ bluer_ai_seed add_kaggle
7
+
8
+ bluer_ai_seed add_ssh_key sudo
9
+
10
+ seed="${seed}sudo apt-get --yes --force-yes install git$delim_section"
11
+
12
+ bluer_ai_seed add_repo
13
+
14
+ bluer_ai_seed add_bluer_ai_env_ssp
15
+
16
+ local ssp="--break-system-packages"
17
+
18
+ seed="${seed}sudo apt update$delim"
19
+ seed="${seed}sudo apt install -y python3-pip$delim"
20
+ seed="${seed}pip3 install $ssp -e .$delim_section"
21
+
22
+ bluer_ai_seed add_repo repo=bluer-objects
23
+ seed="${seed}pip3 install $ssp -e .$delim_section"
24
+ seed="${seed}$(bluer_ai_seed add_file $abcli_path_git/bluer-objects/.env \$HOME/git/bluer-objects/.env)$delim_section"
25
+
26
+ bluer_ai_seed add_repo repo=bluer-sbc
27
+ seed="${seed}pip3 install $ssp -e .$delim_section"
28
+
29
+ seed="${seed}pip3 install $ssp opencv-python$delim"
30
+ seed="${seed}sudo apt install -y python3-picamera2$delim"
31
+ seed="${seed}pip3 install --force-reinstall --no-cache-dir simplejpeg$delim"
32
+ seed="${seed}pip3 install $ssp evdev$delim_section"
33
+
34
+ seed="${seed}cd; cd git; cd bluer-ai$delim"
35
+ seed="${seed}source ./bluer_ai/.abcli/bluer_ai.sh$delim_section"
36
+ }
@@ -5,9 +5,6 @@ function test_bluer_sbc_help() {
5
5
 
6
6
  local module
7
7
  for module in \
8
- "@rpi" \
9
- "@rpi fake_display" \
10
- \
11
8
  "@sbc" \
12
9
  \
13
10
  "@sbc adafruit_rgb_matrix" \
@@ -28,6 +25,10 @@ function test_bluer_sbc_help() {
28
25
  "@sbc lepton capture" \
29
26
  "@sbc lepton preview" \
30
27
  \
28
+ "@sbc parts" \
29
+ "@sbc parts adjust" \
30
+ "@sbc parts cd" \
31
+ \
31
32
  "@sbc pypi" \
32
33
  "@sbc pypi browse" \
33
34
  "@sbc pypi build" \
@@ -35,6 +36,9 @@ function test_bluer_sbc_help() {
35
36
  \
36
37
  "@sbc pytest" \
37
38
  \
39
+ "@sbc rpi" \
40
+ "@sbc rpi fake_display" \
41
+ \
38
42
  "@sbc scroll_phat_hd" \
39
43
  "@sbc scroll_phat_hd validate" \
40
44
  \
@@ -0,0 +1,13 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_sbc_parts_adjust() {
4
+ local options=$1
5
+
6
+ [[ "$abcli_is_github_workflow" == true ]] &&
7
+ return 0
8
+
9
+ bluer_ai_eval ,$options \
10
+ bluer_sbc_parts_adjust \
11
+ - \
12
+ --verbose 1
13
+ }
@@ -0,0 +1,11 @@
1
+ docs = [
2
+ {
3
+ "path": f"../docs/aliases/{item}.md",
4
+ }
5
+ for item in [
6
+ "camera",
7
+ "hardware",
8
+ "rpi",
9
+ "sbc",
10
+ ]
11
+ ]
@@ -0,0 +1,29 @@
1
+ import os
2
+
3
+ from bluer_options.help.functions import get_help
4
+ from bluer_objects import file, README
5
+
6
+ from bluer_sbc import NAME, VERSION, ICON, REPO_NAME
7
+ from bluer_sbc.help.functions import help_functions
8
+ from bluer_sbc.README import aliases, designs, parts, root
9
+
10
+
11
+ def build():
12
+ return all(
13
+ README.build(
14
+ items=readme.get("items", []),
15
+ cols=readme.get("cols", 3),
16
+ path=os.path.join(file.path(__file__), readme["path"]),
17
+ ICON=ICON,
18
+ NAME=NAME,
19
+ VERSION=VERSION,
20
+ REPO_NAME=REPO_NAME,
21
+ help_function=lambda tokens: get_help(
22
+ tokens,
23
+ help_functions,
24
+ mono=True,
25
+ ),
26
+ macros=readme.get("macros", {}),
27
+ )
28
+ for readme in root.docs + parts.docs + designs.docs + aliases.docs
29
+ )
@@ -0,0 +1,40 @@
1
+ from typing import Dict, List
2
+
3
+ from bluer_objects import markdown
4
+
5
+ from bluer_sbc.parts.db import db_of_parts
6
+
7
+
8
+ def design_doc(
9
+ design_name: str,
10
+ items: List[str] = [],
11
+ dict_of_parts: dict = {},
12
+ macros: dict = {},
13
+ own_folder: bool = False,
14
+ parts_reference: str = "./parts",
15
+ ) -> Dict:
16
+ macros_ = {}
17
+ if dict_of_parts:
18
+ macros_ = {
19
+ "parts_images:::": markdown.generate_table(
20
+ db_of_parts.as_images(
21
+ dict_of_parts,
22
+ reference=parts_reference,
23
+ ),
24
+ cols=10,
25
+ log=False,
26
+ ),
27
+ "parts_list:::": db_of_parts.as_list(
28
+ dict_of_parts,
29
+ reference=parts_reference,
30
+ log=False,
31
+ ),
32
+ }
33
+
34
+ macros_.update(macros)
35
+
36
+ return {
37
+ "path": "../docs/{}{}".format(design_name, "" if own_folder else ".md"),
38
+ "items": items,
39
+ "macros": macros_,
40
+ }
@@ -0,0 +1,26 @@
1
+ from bluer_sbc.README.designs import (
2
+ cheshmak,
3
+ battery_bus,
4
+ adapter_bus,
5
+ swallow,
6
+ swallow_head,
7
+ bryce,
8
+ nafha,
9
+ shelter,
10
+ template,
11
+ ultrasonic_sensor_tester,
12
+ )
13
+
14
+
15
+ docs = (
16
+ battery_bus.docs
17
+ + adapter_bus.docs
18
+ + bryce.docs
19
+ + cheshmak.docs
20
+ + nafha.docs
21
+ + shelter.docs
22
+ + swallow_head.docs
23
+ + swallow.docs
24
+ + ultrasonic_sensor_tester.docs
25
+ + template.docs
26
+ )
@@ -0,0 +1,59 @@
1
+ from bluer_objects import README
2
+ from bluer_objects.README.items import ImageItems
3
+ from bluer_objects.README.consts import assets_url, designs_url
4
+
5
+ from bluer_sbc.README.design import design_doc
6
+
7
+
8
+ assets2 = assets_url(
9
+ suffix="adapter-bus",
10
+ volume=2,
11
+ )
12
+
13
+ marquee = README.Items(
14
+ [
15
+ {
16
+ "name": "adapter bus",
17
+ "marquee": f"{assets2}/20251017_222911.jpg",
18
+ "url": "./bluer_sbc/docs/adapter-bus.md",
19
+ }
20
+ ]
21
+ )
22
+
23
+ items = ImageItems(
24
+ {
25
+ designs_url(
26
+ "adapter-bus/wiring.png?raw=true",
27
+ ): designs_url(
28
+ "adapter-bus/wiring.svg",
29
+ ),
30
+ **{
31
+ f"{assets2}/{timestamp}.jpg": ""
32
+ for timestamp in [
33
+ "20251017_222911",
34
+ "20251017_222929",
35
+ "20251017_222938",
36
+ "20251017_222943",
37
+ "20251017_222949",
38
+ "20251017_223017",
39
+ "20251017_223034",
40
+ "20251018_213244",
41
+ ]
42
+ },
43
+ }
44
+ )
45
+
46
+ parts = {
47
+ "charging-port": "",
48
+ "dsn-vc288": "",
49
+ "charger-socket": "",
50
+ }
51
+
52
+
53
+ docs = [
54
+ design_doc(
55
+ "adapter-bus",
56
+ items,
57
+ parts,
58
+ )
59
+ ]
@@ -0,0 +1,52 @@
1
+ from bluer_objects import README
2
+ from bluer_objects.README.items import ImageItems
3
+ from bluer_objects.README.consts import assets_url
4
+ from bluer_objects.README.consts import designs_url
5
+
6
+ from bluer_sbc.README.design import design_doc
7
+
8
+ assets2 = assets_url(
9
+ suffix="battery-bus",
10
+ volume=2,
11
+ )
12
+
13
+ marquee = README.Items(
14
+ [
15
+ {
16
+ "name": "battery bus",
17
+ "marquee": f"{assets2}/20251007_221902.jpg",
18
+ "url": "./bluer_sbc/docs/battery-bus.md",
19
+ }
20
+ ]
21
+ )
22
+
23
+ items = ImageItems(
24
+ {
25
+ f"{assets2}/concept.png": "",
26
+ designs_url(
27
+ "battery-bus/electrical/wiring.png?raw=true",
28
+ ): designs_url(
29
+ "battery-bus/electrical/wiring.svg",
30
+ ),
31
+ f"{assets2}/20251007_221902.jpg": "",
32
+ f"{assets2}/20251007_220642.jpg": "",
33
+ f"{assets2}/20251007_220520.jpg": "",
34
+ f"{assets2}/20251007_220601.jpg": "",
35
+ }
36
+ )
37
+
38
+ parts = {
39
+ "SLA-Battery": "",
40
+ "on-off-switch": "",
41
+ "charging-port": "",
42
+ "dsn-vc288": "",
43
+ }
44
+
45
+
46
+ docs = [
47
+ design_doc(
48
+ "battery-bus",
49
+ items,
50
+ parts,
51
+ )
52
+ ]
@@ -0,0 +1,28 @@
1
+ from bluer_objects import README
2
+ from bluer_objects.README.items import ImageItems
3
+
4
+ from bluer_sbc.README.designs.consts import assets2
5
+ from bluer_sbc.README.design import design_doc
6
+
7
+ image_template = assets2 + "bryce/{}?raw=true"
8
+
9
+ marquee = README.Items(
10
+ [
11
+ {
12
+ "name": "bryce",
13
+ "marquee": image_template.format("08.jpg"),
14
+ "url": "./bluer_sbc/docs/bryce.md",
15
+ }
16
+ ]
17
+ )
18
+
19
+ items = ImageItems(
20
+ {image_template.format(f"{index+1:02}.jpg"): "" for index in range(9)}
21
+ )
22
+
23
+ docs = [
24
+ design_doc(
25
+ "bryce",
26
+ items,
27
+ )
28
+ ]
@@ -0,0 +1,29 @@
1
+ from bluer_objects import README
2
+ from bluer_objects.README.items import ImageItems
3
+
4
+ from bluer_sbc.README.designs.consts import assets2
5
+ from bluer_sbc.README.design import design_doc
6
+
7
+ image_template = assets2 + "cheshmak/{}?raw=true"
8
+
9
+ marquee = README.Items(
10
+ [
11
+ {
12
+ "name": "cheshmak",
13
+ "marquee": image_template.format("01.png"),
14
+ "url": "./bluer_sbc/docs/cheshmak.md",
15
+ }
16
+ ]
17
+ )
18
+
19
+ items = ImageItems(
20
+ {image_template.format(f"{index+1:02}.png"): "" for index in range(1)}
21
+ )
22
+
23
+
24
+ docs = [
25
+ design_doc(
26
+ "cheshmak",
27
+ items,
28
+ )
29
+ ]
@@ -0,0 +1,57 @@
1
+ from bluer_objects import README
2
+ from bluer_objects.README.items import ImageItems
3
+
4
+ from bluer_sbc.README.designs.consts import assets2
5
+ from bluer_sbc.README.design import design_doc
6
+
7
+ image_template = assets2 + "nafha/{}?raw=true"
8
+
9
+ marquee = README.Items(
10
+ [
11
+ {
12
+ "name": "nafha",
13
+ "marquee": image_template.format("01.png"),
14
+ "url": "./bluer_sbc/docs/nafha",
15
+ }
16
+ ]
17
+ )
18
+
19
+ items = ImageItems(
20
+ {
21
+ image_template.format(f"{filename}"): ""
22
+ for filename in [f"{index+1:02}.png" for index in range(4)]
23
+ + [
24
+ "20251028_123428.jpg",
25
+ "20251028_123438.jpg",
26
+ "20251103_215221.jpg",
27
+ "20251103_215248.jpg",
28
+ "20251103_215253.jpg",
29
+ "20251103_215257.jpg",
30
+ "20251103_215301.jpg",
31
+ "20251103_215319.jpg",
32
+ ]
33
+ },
34
+ )
35
+
36
+ parts = {
37
+ "dsn-vc288": "",
38
+ "charging-port": "",
39
+ "pwm-manual-dc-motor-controller": "",
40
+ "heater-element": "12 V, 4.5 Ω, 32 w",
41
+ }
42
+
43
+ docs = [
44
+ design_doc(
45
+ "nafha",
46
+ items,
47
+ parts,
48
+ own_folder=True,
49
+ parts_reference="../parts",
50
+ ),
51
+ {
52
+ "path": "../docs/nafha/parts-v1.md",
53
+ },
54
+ {
55
+ "path": "../docs/nafha/parts-v2.md",
56
+ },
57
+ ]
@@ -0,0 +1,63 @@
1
+ from bluer_objects import README
2
+ from bluer_objects.README.items import ImageItems
3
+ from bluer_objects.README.consts import assets_url
4
+
5
+ from bluer_sbc.README.design import design_doc
6
+
7
+
8
+ assets2 = assets_url(
9
+ suffix="shelter",
10
+ volume=2,
11
+ )
12
+
13
+ image_template = assets2 + "/{}?raw=true"
14
+
15
+
16
+ marquee = README.Items(
17
+ [
18
+ {
19
+ "name": "shelter",
20
+ "marquee": f"{assets2}/20251104_000755.jpg",
21
+ "url": "./bluer_sbc/docs/shelter",
22
+ }
23
+ ]
24
+ )
25
+
26
+ items = ImageItems(
27
+ {image_template.format(f"{index+1:02}.png"): "" for index in range(4)}
28
+ ) + ImageItems(
29
+ {
30
+ f"{assets2}/20251005_180841.jpg": "",
31
+ f"{assets2}/20251006_181432.jpg": "",
32
+ f"{assets2}/20251006_181509.jpg": "",
33
+ f"{assets2}/20251006_181554.jpg": "",
34
+ f"{assets2}/20251028_113245.jpg": "",
35
+ f"{assets2}/20251103_182323.jpg": "",
36
+ f"{assets2}/20251104_000755.jpg": "",
37
+ f"{assets2}/20251109_000501.jpg": "",
38
+ f"{assets2}/20251109_000641.jpg": "",
39
+ f"{assets2}/20251109_002124.jpg": "",
40
+ f"{assets2}/20251109_002639.jpg": "",
41
+ }
42
+ )
43
+
44
+ parts = {
45
+ "220VAC-dimmer": "",
46
+ "resistance-heating-wire": "1.59 kΩ",
47
+ "ceramic-terminal": "",
48
+ "mountable-digital-thermometer": "",
49
+ }
50
+
51
+
52
+ docs = [
53
+ design_doc(
54
+ "shelter",
55
+ items,
56
+ parts,
57
+ own_folder=True,
58
+ parts_reference="../parts",
59
+ ),
60
+ {
61
+ "path": "../docs/shelter/parts-v1.md",
62
+ },
63
+ ]
@@ -0,0 +1,46 @@
1
+ from bluer_objects import README
2
+ from bluer_objects.README.items import ImageItems
3
+
4
+ from bluer_sbc.README.designs.consts import assets2
5
+ from bluer_sbc.README.design import design_doc
6
+
7
+
8
+ image_template = assets2 + "swallow/design/v5/{}?raw=true"
9
+
10
+ marquee = README.Items(
11
+ [
12
+ {
13
+ "name": "swallow",
14
+ "marquee": image_template.format("01.jpg"),
15
+ "url": "./bluer_sbc/docs/swallow.md",
16
+ }
17
+ ]
18
+ )
19
+
20
+ items = ImageItems(
21
+ {image_template.format(f"{index+1:02}.jpg"): "" for index in range(6)}
22
+ )
23
+
24
+ parts = {
25
+ "BTS7960": "2 x",
26
+ "connector": "2 females",
27
+ "white-terminal": "8 x",
28
+ "nuts-bolts-spacers": "M3: ({})".format(
29
+ " + ".join(
30
+ [
31
+ "8 x 25 mm spacer",
32
+ "4 x 30 mm spacer",
33
+ "4 x nut",
34
+ ]
35
+ )
36
+ ),
37
+ "solid-cable-1-15": "20 cm x (red + black/blue)",
38
+ }
39
+
40
+ docs = [
41
+ design_doc(
42
+ "swallow",
43
+ items,
44
+ parts,
45
+ )
46
+ ]