bluer-sbc 8.248.1__py3-none-any.whl → 9.31.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.

Potentially problematic release.


This version of bluer-sbc might be problematic. Click here for more details.

Files changed (37) hide show
  1. bluer_sbc/.abcli/{blue_sbc.sh → bluer_sbc.sh} +2 -0
  2. bluer_sbc/.abcli/sbc/parts/adjust.sh +12 -0
  3. bluer_sbc/.abcli/sbc/parts/cd.sh +5 -0
  4. bluer_sbc/.abcli/sbc/parts.sh +15 -0
  5. bluer_sbc/.abcli/tests/help.sh +4 -0
  6. bluer_sbc/.abcli/tests/parts_adjust.sh +13 -0
  7. bluer_sbc/README/__init__.py +0 -28
  8. bluer_sbc/README/aliases.py +1 -0
  9. bluer_sbc/README/build.py +29 -0
  10. bluer_sbc/README/design.py +32 -0
  11. bluer_sbc/README/designs/__init__.py +35 -11
  12. bluer_sbc/README/designs/battery_bus.py +2 -2
  13. bluer_sbc/README/designs/shelter.py +2 -2
  14. bluer_sbc/README/designs/swallow_head.py +1 -1
  15. bluer_sbc/README/designs/x.py +2 -5
  16. bluer_sbc/README/parts.py +15 -0
  17. bluer_sbc/README/root.py +4 -0
  18. bluer_sbc/README/shortcuts.py +17 -0
  19. bluer_sbc/__init__.py +2 -2
  20. bluer_sbc/__main__.py +3 -2
  21. bluer_sbc/designs/__init__.py +0 -0
  22. bluer_sbc/designs/swallow/__init__.py +0 -0
  23. bluer_sbc/designs/swallow/parts.py +3 -0
  24. bluer_sbc/designs/swallow_head/__init__.py +0 -0
  25. bluer_sbc/designs/swallow_head/parts.py +15 -0
  26. bluer_sbc/help/functions.py +2 -0
  27. bluer_sbc/help/parts.py +49 -0
  28. bluer_sbc/parts/__init__.py +0 -0
  29. bluer_sbc/parts/__main__.py +41 -0
  30. bluer_sbc/parts/classes/db.py +208 -0
  31. bluer_sbc/parts/classes/part.py +96 -0
  32. bluer_sbc/parts/db.py +381 -0
  33. {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.31.1.dist-info}/METADATA +11 -3
  34. {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.31.1.dist-info}/RECORD +37 -18
  35. {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.31.1.dist-info}/WHEEL +0 -0
  36. {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.31.1.dist-info}/licenses/LICENSE +0 -0
  37. {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.31.1.dist-info}/top_level.txt +0 -0
@@ -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
@@ -0,0 +1,12 @@
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
+
7
+ bluer_ai_eval - \
8
+ python3 -m bluer_sbc.parts \
9
+ adjust \
10
+ --dryrun $do_dryrun \
11
+ "${@:2}"
12
+ }
@@ -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
@@ -25,6 +25,10 @@ function test_bluer_sbc_help() {
25
25
  "@sbc lepton capture" \
26
26
  "@sbc lepton preview" \
27
27
  \
28
+ "@sbc parts" \
29
+ "@sbc parts adjust" \
30
+ "@sbc parts cd" \
31
+ \
28
32
  "@sbc pypi" \
29
33
  "@sbc pypi browse" \
30
34
  "@sbc pypi build" \
@@ -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
+ }
@@ -1,28 +0,0 @@
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, 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
- )
27
- for readme in root.docs + designs.docs + aliases.docs
28
- )
@@ -6,5 +6,6 @@ docs = [
6
6
  "camera",
7
7
  "hardware",
8
8
  "rpi",
9
+ "sbc",
9
10
  ]
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,32 @@
1
+ from typing import List, Dict
2
+
3
+ from bluer_objects import markdown
4
+
5
+ from bluer_sbc.parts.db import db_of_parts
6
+
7
+
8
+ def design(
9
+ items: List[str],
10
+ dict_of_parts: Dict = {},
11
+ ) -> Dict:
12
+ output = {
13
+ "items": items,
14
+ }
15
+
16
+ if dict_of_parts:
17
+ output["macros"] = {
18
+ "parts_images:::": markdown.generate_table(
19
+ db_of_parts.as_images(
20
+ dict_of_parts,
21
+ reference="../../../parts",
22
+ ),
23
+ cols=10,
24
+ ),
25
+ "parts_list:::": db_of_parts.as_list(
26
+ dict_of_parts,
27
+ reference="../../../parts",
28
+ log=False,
29
+ ),
30
+ }
31
+
32
+ return output
@@ -1,3 +1,4 @@
1
+ from bluer_sbc.README.design import design
1
2
  from bluer_sbc.README.designs.cheshmak import items as cheshmak_items
2
3
  from bluer_sbc.README.designs.battery_bus import items as battery_bus_items
3
4
  from bluer_sbc.README.designs.swallow import items as swallow_items
@@ -9,22 +10,45 @@ from bluer_sbc.README.designs.x import items as x_items
9
10
  from bluer_sbc.README.designs.ultrasonic_sensor_tester import (
10
11
  items as ultrasonic_sensor_tester_items,
11
12
  )
13
+ from bluer_sbc.designs.swallow.parts import dict_of_parts as swallow_parts
14
+ from bluer_sbc.designs.swallow_head.parts import dict_of_parts as swallow_head_parts
12
15
 
13
16
  docs = [
14
17
  {
15
18
  "cols": 4,
16
- "items": design_items,
19
+ "items": design_info["items"],
17
20
  "path": f"../docs/{design_name}.md",
21
+ "macros": design_info.get("macros", {}),
18
22
  }
19
- for design_name, design_items in {
20
- "battery-bus": battery_bus_items,
21
- "bryce": bryce_items,
22
- "cheshmak": cheshmak_items,
23
- "nafha": nafha_items,
24
- "shelter": shelter_items,
25
- "swallow-head": swallow_head_items,
26
- "swallow": swallow_items,
27
- "ultrasonic-sensor-tester": ultrasonic_sensor_tester_items,
28
- "x": x_items,
23
+ for design_name, design_info in {
24
+ "battery-bus": design(
25
+ battery_bus_items,
26
+ ),
27
+ "bryce": design(
28
+ bryce_items,
29
+ ),
30
+ "cheshmak": design(
31
+ cheshmak_items,
32
+ ),
33
+ "nafha": design(
34
+ nafha_items,
35
+ ),
36
+ "shelter": design(
37
+ shelter_items,
38
+ ),
39
+ "swallow-head": design(
40
+ swallow_head_items,
41
+ swallow_head_parts,
42
+ ),
43
+ "swallow": design(
44
+ swallow_items,
45
+ swallow_parts,
46
+ ),
47
+ "ultrasonic-sensor-tester": design(
48
+ ultrasonic_sensor_tester_items,
49
+ ),
50
+ "x": design(
51
+ x_items,
52
+ ),
29
53
  }.items()
30
54
  ]
@@ -1,10 +1,10 @@
1
1
  from bluer_objects import README
2
2
  from bluer_objects.README.items import ImageItems
3
- from bluer_objects.README.consts import assets_path
3
+ from bluer_objects.README.consts import assets_url
4
4
 
5
5
  from bluer_sbc.README.designs.consts import assets2
6
6
 
7
- assets2_battery_bus = assets_path(
7
+ assets2_battery_bus = assets_url(
8
8
  suffix="battery-bus",
9
9
  volume=2,
10
10
  )
@@ -1,12 +1,12 @@
1
1
  from bluer_objects import README
2
2
  from bluer_objects.README.items import ImageItems
3
- from bluer_objects.README.consts import assets_path
3
+ from bluer_objects.README.consts import assets_url
4
4
 
5
5
  from bluer_sbc.README.designs.consts import assets2
6
6
 
7
7
  image_template = assets2 + "shelter/{}?raw=true"
8
8
 
9
- assets2_shelter = assets_path(
9
+ assets2_shelter = assets_url(
10
10
  suffix="shelter",
11
11
  volume=2,
12
12
  )
@@ -17,5 +17,5 @@ marquee = README.Items(
17
17
  )
18
18
 
19
19
  items = ImageItems(
20
- {"marquee": image_template.format(f"{index+1:02}.jpg") for index in range(6)}
20
+ {image_template.format(f"{index+1:02}.jpg"): "" for index in range(6)}
21
21
  )
@@ -1,12 +1,9 @@
1
1
  from bluer_objects import README
2
2
  from bluer_objects.README.items import ImageItems
3
- from bluer_objects.README.consts import assets_path
3
+ from bluer_objects.README.consts import assets_url
4
4
 
5
- from bluer_sbc.README.designs.consts import assets2
6
5
 
7
- image_template = assets2 + "x/{}?raw=true"
8
-
9
- assets2_x = assets_path(
6
+ assets2_x = assets_url(
10
7
  suffix="x",
11
8
  volume=2,
12
9
  )
@@ -0,0 +1,15 @@
1
+ from bluer_sbc.parts.db import db_of_parts
2
+
3
+ docs = [
4
+ {
5
+ "path": "../docs/parts",
6
+ "macros": {"list:::": db_of_parts.README},
7
+ }
8
+ ] + [
9
+ {
10
+ "path": part.filename(create=True),
11
+ "macros": {"info:::": part.README(db_of_parts.url_prefix)},
12
+ }
13
+ for part_name, part in db_of_parts.items()
14
+ if part_name != "template"
15
+ ]
bluer_sbc/README/root.py CHANGED
@@ -9,6 +9,7 @@ from bluer_sbc.README.designs.battery_bus import marquee as battery_bus_marquee
9
9
  from bluer_sbc.README.designs.ultrasonic_sensor_tester import (
10
10
  marquee as ultrasonic_sensor_tester_marquee,
11
11
  )
12
+ from bluer_sbc.README.shortcuts import items as shortcuts_items
12
13
 
13
14
  docs = [
14
15
  {
@@ -22,5 +23,8 @@ docs = [
22
23
  + shelter_marquee
23
24
  + blue_bracket_items,
24
25
  "path": "../..",
26
+ "macros": {
27
+ "shortcuts:::": shortcuts_items,
28
+ },
25
29
  },
26
30
  ]
@@ -0,0 +1,17 @@
1
+ from bluer_objects.README.items import Items
2
+ from bluer_objects import markdown
3
+
4
+ from bluer_sbc.parts.db import db_of_parts
5
+
6
+
7
+ items = markdown.generate_table(
8
+ Items(
9
+ [
10
+ {
11
+ "name": "parts",
12
+ "url": "./bluer_sbc/docs/parts",
13
+ "marquee": f"{db_of_parts.url_prefix}/XL4015.png",
14
+ },
15
+ ]
16
+ ),
17
+ )
bluer_sbc/__init__.py CHANGED
@@ -2,9 +2,9 @@ NAME = "bluer_sbc"
2
2
 
3
3
  ICON = "🌀"
4
4
 
5
- DESCRIPTION = f"{ICON} AI for single board computers and other designs."
5
+ DESCRIPTION = f"{ICON} AI for single board computers and related designs."
6
6
 
7
- VERSION = "8.248.1"
7
+ VERSION = "9.31.1"
8
8
 
9
9
  REPO_NAME = "bluer-sbc"
10
10
 
bluer_sbc/__main__.py CHANGED
@@ -1,6 +1,7 @@
1
1
  from blueness.argparse.generic import main
2
2
 
3
- from bluer_sbc import NAME, VERSION, DESCRIPTION, ICON, README
3
+ from bluer_sbc import NAME, VERSION, DESCRIPTION, ICON
4
+ from bluer_sbc.README.build import build
4
5
  from bluer_sbc.logger import logger
5
6
 
6
7
  main(
@@ -10,7 +11,7 @@ main(
10
11
  VERSION=VERSION,
11
12
  main_filename=__file__,
12
13
  tasks={
13
- "build_README": lambda _: README.build(),
14
+ "build_README": lambda _: build(),
14
15
  },
15
16
  logger=logger,
16
17
  )
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ dict_of_parts = {
2
+ "BTS7960": "2 x",
3
+ }
File without changes
@@ -0,0 +1,15 @@
1
+ dict_of_parts = {
2
+ "rpi3bp": "",
3
+ "XL4015": "",
4
+ "470-mF": "",
5
+ "Polyfuse": "optional",
6
+ "TVS-diode": "",
7
+ "resistor": "7 x 330-470 Ω + N x 2.2 kΩ + N x 3.3 kΩ",
8
+ "LED": "green + red + yellow + 4 x blue",
9
+ "rpi-camera": "",
10
+ "PCB-single-14x9_5": "2 x",
11
+ "PCB-double-9x7": "2 x",
12
+ "pushbutton": "",
13
+ "ultrasonic-sensor": "4 x",
14
+ "connector": "3 pairs",
15
+ }
@@ -10,6 +10,7 @@ from bluer_sbc.help.camera import help_functions as help_camera
10
10
  from bluer_sbc.help.grove import help_functions as help_grove
11
11
  from bluer_sbc.help.hat import help_functions as help_hat
12
12
  from bluer_sbc.help.lepton import help_functions as help_lepton
13
+ from bluer_sbc.help.parts import help_functions as help_parts
13
14
  from bluer_sbc.help.rpi import help_functions as help_rpi
14
15
  from bluer_sbc.help.scroll_phat_hd import help_functions as help_scroll_phat_hd
15
16
  from bluer_sbc.help.sparkfun_top_phat import help_functions as help_sparkfun_top_phat
@@ -26,6 +27,7 @@ help_functions.update(
26
27
  "grove": help_grove,
27
28
  "hat": help_hat,
28
29
  "lepton": help_lepton,
30
+ "parts": help_parts,
29
31
  "rpi": help_rpi,
30
32
  "scroll_phat_hd": help_scroll_phat_hd,
31
33
  "sparkfun_top_phat": help_sparkfun_top_phat,
@@ -0,0 +1,49 @@
1
+ from typing import List
2
+
3
+ from bluer_options.terminal import show_usage
4
+
5
+ from bluer_sbc import ALIAS
6
+
7
+
8
+ def help_cd(
9
+ tokens: List[str],
10
+ mono: bool,
11
+ ) -> str:
12
+ return show_usage(
13
+ [
14
+ "@sbc",
15
+ "parts",
16
+ "cd",
17
+ ],
18
+ "cd to part images.",
19
+ mono=mono,
20
+ )
21
+
22
+
23
+ def help_adjust(
24
+ tokens: List[str],
25
+ mono: bool,
26
+ ) -> str:
27
+ options = "dryrun"
28
+
29
+ args = [
30
+ "[--verbose 1]",
31
+ ]
32
+
33
+ return show_usage(
34
+ [
35
+ "@sbc",
36
+ "parts",
37
+ "adjust",
38
+ f"[{options}]",
39
+ ]
40
+ + args,
41
+ "adjust part images.",
42
+ mono=mono,
43
+ )
44
+
45
+
46
+ help_functions = {
47
+ "adjust": help_adjust,
48
+ "cd": help_cd,
49
+ }
File without changes
@@ -0,0 +1,41 @@
1
+ import argparse
2
+
3
+ from blueness import module
4
+ from blueness.argparse.generic import sys_exit
5
+
6
+ from bluer_sbc import NAME
7
+ from bluer_sbc.parts.db import db_of_parts
8
+ from bluer_sbc.logger import logger
9
+
10
+ NAME = module.name(__file__, NAME)
11
+
12
+ parser = argparse.ArgumentParser(NAME)
13
+ parser.add_argument(
14
+ "task",
15
+ type=str,
16
+ help="adjust",
17
+ )
18
+ parser.add_argument(
19
+ "--dryrun",
20
+ type=int,
21
+ default=1,
22
+ help="0 | 1",
23
+ )
24
+ parser.add_argument(
25
+ "--verbose",
26
+ type=int,
27
+ default=0,
28
+ help="0 | 1",
29
+ )
30
+ args = parser.parse_args()
31
+
32
+ success = False
33
+ if args.task == "adjust":
34
+ success = db_of_parts.adjust(
35
+ dryrun=args.dryrun == 1,
36
+ verbose=args.verbose == 1,
37
+ )
38
+ else:
39
+ success = None
40
+
41
+ sys_exit(logger, NAME, args.task, success)