bluer-sbc 8.248.1__py3-none-any.whl → 9.36.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.
- bluer_sbc/.abcli/{blue_sbc.sh → bluer_sbc.sh} +2 -0
- bluer_sbc/.abcli/sbc/parts/adjust.sh +12 -0
- bluer_sbc/.abcli/sbc/parts/cd.sh +5 -0
- bluer_sbc/.abcli/sbc/parts.sh +15 -0
- bluer_sbc/.abcli/tests/help.sh +4 -0
- bluer_sbc/.abcli/tests/parts_adjust.sh +13 -0
- bluer_sbc/README/__init__.py +0 -28
- bluer_sbc/README/aliases.py +1 -0
- bluer_sbc/README/build.py +29 -0
- bluer_sbc/README/design.py +32 -0
- bluer_sbc/README/designs/__init__.py +38 -11
- bluer_sbc/README/designs/battery_bus.py +2 -2
- bluer_sbc/README/designs/shelter.py +2 -2
- bluer_sbc/README/designs/swallow_head.py +1 -1
- bluer_sbc/README/designs/x.py +2 -5
- bluer_sbc/README/parts.py +15 -0
- bluer_sbc/README/root.py +4 -0
- bluer_sbc/README/shortcuts.py +17 -0
- bluer_sbc/__init__.py +2 -2
- bluer_sbc/__main__.py +3 -2
- bluer_sbc/designs/__init__.py +0 -0
- bluer_sbc/designs/battery_bus/__init__.py +0 -0
- bluer_sbc/designs/battery_bus/parts.py +5 -0
- bluer_sbc/designs/swallow/__init__.py +0 -0
- bluer_sbc/designs/swallow/parts.py +3 -0
- bluer_sbc/designs/swallow_head/__init__.py +0 -0
- bluer_sbc/designs/swallow_head/parts.py +15 -0
- bluer_sbc/help/functions.py +2 -0
- bluer_sbc/help/parts.py +49 -0
- bluer_sbc/parts/__init__.py +0 -0
- bluer_sbc/parts/__main__.py +41 -0
- bluer_sbc/parts/classes/db.py +208 -0
- bluer_sbc/parts/classes/part.py +96 -0
- bluer_sbc/parts/db.py +381 -0
- {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.36.1.dist-info}/METADATA +11 -3
- {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.36.1.dist-info}/RECORD +39 -18
- {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.36.1.dist-info}/WHEEL +0 -0
- {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.36.1.dist-info}/licenses/LICENSE +0 -0
- {bluer_sbc-8.248.1.dist-info → bluer_sbc-9.36.1.dist-info}/top_level.txt +0 -0
|
@@ -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
|
bluer_sbc/.abcli/tests/help.sh
CHANGED
bluer_sbc/README/__init__.py
CHANGED
|
@@ -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
|
-
)
|
bluer_sbc/README/aliases.py
CHANGED
|
@@ -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
|
|
@@ -10,21 +11,47 @@ from bluer_sbc.README.designs.ultrasonic_sensor_tester import (
|
|
|
10
11
|
items as ultrasonic_sensor_tester_items,
|
|
11
12
|
)
|
|
12
13
|
|
|
14
|
+
from bluer_sbc.designs.battery_bus.parts import dict_of_parts as battery_bus_parts
|
|
15
|
+
from bluer_sbc.designs.swallow.parts import dict_of_parts as swallow_parts
|
|
16
|
+
from bluer_sbc.designs.swallow_head.parts import dict_of_parts as swallow_head_parts
|
|
17
|
+
|
|
13
18
|
docs = [
|
|
14
19
|
{
|
|
15
20
|
"cols": 4,
|
|
16
|
-
"items":
|
|
21
|
+
"items": design_info["items"],
|
|
17
22
|
"path": f"../docs/{design_name}.md",
|
|
23
|
+
"macros": design_info.get("macros", {}),
|
|
18
24
|
}
|
|
19
|
-
for design_name,
|
|
20
|
-
"battery-bus":
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
25
|
+
for design_name, design_info in {
|
|
26
|
+
"battery-bus": design(
|
|
27
|
+
battery_bus_items,
|
|
28
|
+
battery_bus_parts,
|
|
29
|
+
),
|
|
30
|
+
"bryce": design(
|
|
31
|
+
bryce_items,
|
|
32
|
+
),
|
|
33
|
+
"cheshmak": design(
|
|
34
|
+
cheshmak_items,
|
|
35
|
+
),
|
|
36
|
+
"nafha": design(
|
|
37
|
+
nafha_items,
|
|
38
|
+
),
|
|
39
|
+
"shelter": design(
|
|
40
|
+
shelter_items,
|
|
41
|
+
),
|
|
42
|
+
"swallow-head": design(
|
|
43
|
+
swallow_head_items,
|
|
44
|
+
swallow_head_parts,
|
|
45
|
+
),
|
|
46
|
+
"swallow": design(
|
|
47
|
+
swallow_items,
|
|
48
|
+
swallow_parts,
|
|
49
|
+
),
|
|
50
|
+
"ultrasonic-sensor-tester": design(
|
|
51
|
+
ultrasonic_sensor_tester_items,
|
|
52
|
+
),
|
|
53
|
+
"x": design(
|
|
54
|
+
x_items,
|
|
55
|
+
),
|
|
29
56
|
}.items()
|
|
30
57
|
]
|
|
@@ -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
|
|
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 =
|
|
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
|
|
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 =
|
|
9
|
+
assets2_shelter = assets_url(
|
|
10
10
|
suffix="shelter",
|
|
11
11
|
volume=2,
|
|
12
12
|
)
|
bluer_sbc/README/designs/x.py
CHANGED
|
@@ -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
|
|
3
|
+
from bluer_objects.README.consts import assets_url
|
|
4
4
|
|
|
5
|
-
from bluer_sbc.README.designs.consts import assets2
|
|
6
5
|
|
|
7
|
-
|
|
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
|
|
5
|
+
DESCRIPTION = f"{ICON} AI for single board computers and related designs."
|
|
6
6
|
|
|
7
|
-
VERSION = "
|
|
7
|
+
VERSION = "9.36.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
|
|
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 _:
|
|
14
|
+
"build_README": lambda _: build(),
|
|
14
15
|
},
|
|
15
16
|
logger=logger,
|
|
16
17
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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
|
+
}
|
bluer_sbc/help/functions.py
CHANGED
|
@@ -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,
|
bluer_sbc/help/parts.py
ADDED
|
@@ -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)
|