bluer-objects 6.104.1__py3-none-any.whl → 6.377.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 (146) hide show
  1. bluer_objects/.abcli/abcli.sh +6 -0
  2. bluer_objects/.abcli/alias.sh +11 -0
  3. bluer_objects/.abcli/assets/cd.sh +20 -0
  4. bluer_objects/.abcli/assets/mv.sh +34 -0
  5. bluer_objects/.abcli/assets/publish.sh +37 -0
  6. bluer_objects/.abcli/assets.sh +15 -0
  7. bluer_objects/.abcli/create_test_asset.sh +10 -0
  8. bluer_objects/.abcli/download.sh +3 -1
  9. bluer_objects/.abcli/file.sh +15 -4
  10. bluer_objects/.abcli/gif.sh +18 -0
  11. bluer_objects/.abcli/host.sh +23 -7
  12. bluer_objects/.abcli/ls.sh +19 -8
  13. bluer_objects/.abcli/metadata/download.sh +9 -0
  14. bluer_objects/.abcli/metadata/edit.sh +15 -0
  15. bluer_objects/.abcli/metadata/upload.sh +9 -0
  16. bluer_objects/.abcli/mlflow/browse.sh +2 -0
  17. bluer_objects/.abcli/mlflow/deploy.sh +21 -5
  18. bluer_objects/.abcli/mlflow/lock/lock.sh +11 -0
  19. bluer_objects/.abcli/mlflow/lock/unlock.sh +12 -0
  20. bluer_objects/.abcli/mlflow/lock.sh +15 -0
  21. bluer_objects/.abcli/mlflow.sh +0 -2
  22. bluer_objects/.abcli/pdf/convert.sh +92 -0
  23. bluer_objects/.abcli/pdf.sh +15 -0
  24. bluer_objects/.abcli/storage/clear.sh +2 -0
  25. bluer_objects/.abcli/tests/clone.sh +2 -3
  26. bluer_objects/.abcli/tests/create_test_asset.sh +16 -0
  27. bluer_objects/.abcli/tests/file.sh +64 -0
  28. bluer_objects/.abcli/tests/gif.sh +3 -3
  29. bluer_objects/.abcli/tests/help.sh +27 -4
  30. bluer_objects/.abcli/tests/ls.sh +11 -4
  31. bluer_objects/.abcli/tests/metadata.sh +35 -0
  32. bluer_objects/.abcli/tests/mlflow_lock.sh +30 -0
  33. bluer_objects/.abcli/tests/open.sh +11 -0
  34. bluer_objects/.abcli/tests/open_gif_open.sh +14 -0
  35. bluer_objects/.abcli/tests/pdf.sh +31 -0
  36. bluer_objects/.abcli/tests/storage_clear.sh +11 -0
  37. bluer_objects/.abcli/tests/storage_public_upload.sh +25 -0
  38. bluer_objects/.abcli/tests/storage_status.sh +12 -0
  39. bluer_objects/.abcli/tests/{storage.sh → storage_upload_download.sh} +26 -8
  40. bluer_objects/.abcli/tests/web_is_accessible.sh +17 -0
  41. bluer_objects/.abcli/tests/web_where_am_ai.sh +5 -0
  42. bluer_objects/.abcli/upload.sh +26 -2
  43. bluer_objects/.abcli/url.sh +15 -0
  44. bluer_objects/.abcli/web/is_accessible.sh +13 -0
  45. bluer_objects/.abcli/web/where_am_i.sh +5 -0
  46. bluer_objects/README/__init__.py +24 -9
  47. bluer_objects/README/alias.py +56 -0
  48. bluer_objects/README/consts.py +39 -0
  49. bluer_objects/README/functions.py +127 -205
  50. bluer_objects/README/items.py +78 -6
  51. bluer_objects/README/utils.py +275 -0
  52. bluer_objects/__init__.py +1 -1
  53. bluer_objects/assets/__init__.py +0 -0
  54. bluer_objects/assets/__main__.py +57 -0
  55. bluer_objects/assets/functions.py +62 -0
  56. bluer_objects/config.env +9 -1
  57. bluer_objects/env.py +23 -0
  58. bluer_objects/file/__main__.py +52 -7
  59. bluer_objects/file/functions.py +13 -3
  60. bluer_objects/file/load.py +2 -9
  61. bluer_objects/file/save.py +17 -24
  62. bluer_objects/graphics/__main__.py +7 -0
  63. bluer_objects/graphics/gif.py +11 -7
  64. bluer_objects/graphics/screen.py +9 -8
  65. bluer_objects/help/assets.py +96 -0
  66. bluer_objects/help/create_test_asset.py +22 -0
  67. bluer_objects/help/download.py +17 -3
  68. bluer_objects/help/file.py +59 -0
  69. bluer_objects/help/functions.py +11 -1
  70. bluer_objects/help/gif.py +25 -0
  71. bluer_objects/help/host.py +6 -4
  72. bluer_objects/help/ls.py +26 -3
  73. bluer_objects/help/metadata.py +51 -0
  74. bluer_objects/help/mlflow/__init__.py +23 -2
  75. bluer_objects/help/mlflow/lock.py +52 -0
  76. bluer_objects/help/pdf.py +67 -0
  77. bluer_objects/help/upload.py +10 -3
  78. bluer_objects/help/web.py +38 -0
  79. bluer_objects/host/functions.py +4 -1
  80. bluer_objects/logger/confusion_matrix.py +76 -0
  81. bluer_objects/logger/image.py +110 -0
  82. bluer_objects/logger/stitch.py +107 -0
  83. bluer_objects/markdown.py +8 -6
  84. bluer_objects/metadata/__init__.py +1 -0
  85. bluer_objects/metadata/flatten.py +27 -0
  86. bluer_objects/mlflow/lock/__init__.py +1 -0
  87. bluer_objects/mlflow/lock/__main__.py +58 -0
  88. bluer_objects/mlflow/lock/functions.py +121 -0
  89. bluer_objects/mlflow/logging.py +47 -41
  90. bluer_objects/pdf/__init__.py +1 -0
  91. bluer_objects/pdf/__main__.py +78 -0
  92. bluer_objects/pdf/convert/__init__.py +0 -0
  93. bluer_objects/pdf/convert/batch.py +54 -0
  94. bluer_objects/pdf/convert/combination.py +32 -0
  95. bluer_objects/pdf/convert/convert.py +111 -0
  96. bluer_objects/pdf/convert/image.py +53 -0
  97. bluer_objects/pdf/convert/md.py +97 -0
  98. bluer_objects/pdf/convert/missing.py +96 -0
  99. bluer_objects/pdf/convert/pdf.py +37 -0
  100. bluer_objects/sample.env +6 -0
  101. bluer_objects/storage/WebDAV.py +11 -7
  102. bluer_objects/storage/WebDAVrequest.py +360 -0
  103. bluer_objects/storage/WebDAVzip.py +26 -29
  104. bluer_objects/storage/__init__.py +28 -1
  105. bluer_objects/storage/__main__.py +40 -6
  106. bluer_objects/storage/base.py +84 -5
  107. bluer_objects/storage/policies.py +7 -0
  108. bluer_objects/storage/s3.py +367 -0
  109. bluer_objects/testing/__main__.py +6 -0
  110. bluer_objects/tests/test_README_consts.py +71 -0
  111. bluer_objects/tests/test_README_items.py +128 -0
  112. bluer_objects/tests/test_alias.py +33 -0
  113. bluer_objects/tests/test_env.py +25 -2
  114. bluer_objects/tests/test_file_download.py +25 -0
  115. bluer_objects/tests/test_file_load_save.py +1 -2
  116. bluer_objects/tests/test_file_load_save_text.py +46 -0
  117. bluer_objects/tests/test_graphics_gif.py +2 -0
  118. bluer_objects/tests/test_log_image_grid.py +29 -0
  119. bluer_objects/tests/test_logger_confusion_matrix.py +18 -0
  120. bluer_objects/tests/test_logger_matrix.py +2 -2
  121. bluer_objects/tests/test_logger_stitch_images.py +47 -0
  122. bluer_objects/tests/test_metadata.py +12 -6
  123. bluer_objects/tests/test_metadata_flatten.py +109 -0
  124. bluer_objects/tests/test_mlflow.py +2 -2
  125. bluer_objects/tests/test_mlflow_lock.py +26 -0
  126. bluer_objects/tests/test_objects.py +2 -0
  127. bluer_objects/tests/test_shell.py +34 -0
  128. bluer_objects/tests/test_storage.py +8 -21
  129. bluer_objects/tests/test_storage_base.py +39 -0
  130. bluer_objects/tests/test_storage_s3.py +67 -0
  131. bluer_objects/tests/test_storage_webdav_request.py +75 -0
  132. bluer_objects/tests/test_storage_webdav_zip.py +42 -0
  133. bluer_objects/tests/test_web_is_accessible.py +11 -0
  134. bluer_objects/web/__init__.py +1 -0
  135. bluer_objects/web/__main__.py +31 -0
  136. bluer_objects/web/functions.py +9 -0
  137. {bluer_objects-6.104.1.dist-info → bluer_objects-6.377.1.dist-info}/METADATA +6 -3
  138. bluer_objects-6.377.1.dist-info/RECORD +217 -0
  139. {bluer_objects-6.104.1.dist-info → bluer_objects-6.377.1.dist-info}/WHEEL +1 -1
  140. bluer_objects/.abcli/storage/download_file.sh +0 -9
  141. bluer_objects/.abcli/storage/exists.sh +0 -8
  142. bluer_objects/.abcli/storage/list.sh +0 -8
  143. bluer_objects/.abcli/storage/rm.sh +0 -11
  144. bluer_objects-6.104.1.dist-info/RECORD +0 -143
  145. {bluer_objects-6.104.1.dist-info → bluer_objects-6.377.1.dist-info}/licenses/LICENSE +0 -0
  146. {bluer_objects-6.104.1.dist-info → bluer_objects-6.377.1.dist-info}/top_level.txt +0 -0
@@ -5,5 +5,11 @@ bluer_ai_source_caller_suffix_path /tests
5
5
  bluer_ai_env_dot_load \
6
6
  caller,plugin=bluer_objects,suffix=/../..
7
7
 
8
+ if [[ "$MLFLOW_DEPLOYMENT" == "local" ]]; then
9
+ export MLFLOW_TRACKING_URI=$HOME/mlflow
10
+ else
11
+ export MLFLOW_TRACKING_URI=$MLFLOW_DEPLOYMENT
12
+ fi
13
+
8
14
  bluer_ai_env_dot_load \
9
15
  caller,filename=config.env,suffix=/..
@@ -1,6 +1,11 @@
1
1
  #! /usr/bin/env bash
2
2
 
3
3
  alias @ai=bluer_ai
4
+ alias @i=bluer_ai
5
+
6
+ alias @assets=bluer_objects_assets
7
+
8
+ alias @create_test_asset=bluer_objects_create_test_asset
4
9
 
5
10
  alias @download=bluer_objects_download
6
11
 
@@ -19,6 +24,8 @@ alias @host=bluer_objects_host
19
24
 
20
25
  alias @ls=bluer_objects_ls
21
26
 
27
+ alias @lock=bluer_objects_mlflow_lock
28
+
22
29
  alias @metadata=bluer_objects_metadata
23
30
 
24
31
  alias @mlflow=bluer_objects_mlflow
@@ -27,6 +34,8 @@ alias @mysql=abcli_mysql
27
34
 
28
35
  alias @objects=bluer_objects
29
36
 
37
+ alias @pdf=bluer_objects_pdf
38
+
30
39
  alias @random=bluer_ai_string_random
31
40
 
32
41
  alias @select=bluer_ai_select
@@ -34,3 +43,5 @@ alias @select=bluer_ai_select
34
43
  alias @storage=bluer_ai_storage
35
44
 
36
45
  alias @upload=bluer_objects_upload
46
+
47
+ alias @web=bluer_objects_web
@@ -0,0 +1,20 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_assets_cd() {
4
+ local options=$1
5
+ local do_create=$(bluer_ai_option_int "$options" create 0)
6
+ local volume=$(bluer_ai_option "$options" vol)
7
+
8
+ local path=$2
9
+ path=$abcli_path_git/assets$volume/$path
10
+
11
+ if [[ "$do_create" == 1 ]]; then
12
+ mkdir -pv $path
13
+ [[ $? -ne 0 ]] && return 1
14
+ fi
15
+
16
+ cd $path
17
+ [[ $? -ne 0 ]] && return 1
18
+
19
+ bluer_ai_log "🔗 $path"
20
+ }
@@ -0,0 +1,34 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_assets_mv() {
4
+ local options=$1
5
+ local do_create=$(bluer_ai_option_int "$options" create 0)
6
+ local extension=$(bluer_ai_option "$options" extension jpg)
7
+ local volume=$(bluer_ai_option "$options" vol)
8
+
9
+ local path=$2
10
+ path=$abcli_path_git/assets$volume/$path
11
+
12
+ if [[ "$do_create" == 1 ]]; then
13
+ mkdir -pv $path
14
+ [[ $? -ne 0 ]] && return 1
15
+ fi
16
+
17
+ bluer_ai_log "Downloads/.$extension -> assets$volume/path"
18
+
19
+ mv -v \
20
+ $HOME/Downloads/*.$extension \
21
+ $path
22
+ [[ $? -ne 0 ]] && return 1
23
+
24
+ local push_options=$3
25
+ local do_push=$(bluer_ai_option_int "$push_options" push 0)
26
+ [[ "$do_push" == 0 ]] &&
27
+ return 0
28
+
29
+ bluer_ai_git \
30
+ assets$volume \
31
+ push \
32
+ "$path += " \
33
+ $push_options
34
+ }
@@ -0,0 +1,37 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_assets_publish() {
4
+ local options=$1
5
+
6
+ local do_download=$(bluer_ai_option_int "$options" download 0)
7
+ local do_pull=$(bluer_ai_option_int "$options" pull 1)
8
+ local do_push=$(bluer_ai_option_int "$options" push 0)
9
+ local extensions=$(bluer_ai_option "$options" extensions png)
10
+
11
+ [[ "$do_pull" == 1 ]] &&
12
+ bluer_ai_git \
13
+ assets \
14
+ pull \
15
+ ~all
16
+
17
+ local object_name=$(bluer_ai_clarify_object $2 .)
18
+
19
+ [[ "$do_download" == 1 ]] &&
20
+ bluer_objects_download - $object_name
21
+
22
+ bluer_ai_eval dryrun=$do_dryrun \
23
+ python3 -m bluer_objects.assets \
24
+ publish \
25
+ --object_name $object_name \
26
+ --extensions $extensions \
27
+ "${@:3}"
28
+ [[ $? -ne 0 ]] && return 1
29
+
30
+ [[ "$do_push" == 1 ]] &&
31
+ bluer_ai_git \
32
+ assets \
33
+ push \
34
+ "$object_name update."
35
+
36
+ return 0
37
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_assets() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_objects_assets_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_objects.assets "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /assets
@@ -0,0 +1,10 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_create_test_asset() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ python3 -m bluer_objects.testing \
7
+ create_test_asset \
8
+ --object_name $object_name \
9
+ "${@:2}"
10
+ }
@@ -3,13 +3,15 @@
3
3
  function bluer_objects_download() {
4
4
  local options=$1
5
5
  local filename=$(bluer_ai_option "$options" filename)
6
+ local policy=$(bluer_ai_option "$options" policy none)
6
7
 
7
8
  local object_name=$(bluer_ai_clarify_object $2 .)
8
9
 
9
10
  python3 -m bluer_objects.storage \
10
11
  download \
11
12
  --object_name $object_name \
12
- --filename "$filename"
13
+ --filename "$filename" \
14
+ --policy $policy
13
15
  [[ $? -ne 0 ]] && return 1
14
16
 
15
17
  local open_options=$3
@@ -1,8 +1,19 @@
1
1
  #! /usr/bin/env bash
2
2
 
3
3
  function bluer_objects_file() {
4
- python3 -m bluer_objects.file \
5
- "$1" \
6
- --filename "$2" \
7
- "${@:3}"
4
+ local options=$1
5
+ local do_sudo=$(bluer_ai_option_int "$options" sudo 0)
6
+
7
+ local task=$2
8
+
9
+ local prefix=""
10
+ [[ "$do_sudo" == 1 ]] &&
11
+ prefix="sudo -E"
12
+
13
+ local filename=$3
14
+
15
+ $prefix $(which python) -m bluer_objects.file \
16
+ "$task" \
17
+ --filename "$filename" \
18
+ "${@:4}"
8
19
  }
@@ -2,6 +2,24 @@
2
2
 
3
3
  function bluer_objects_gif() {
4
4
  local options=$1
5
+ local do_open=$(bluer_ai_option_int "$options" open 0)
6
+ if [[ "$do_open" == 1 ]]; then
7
+ local options=$2
8
+ local do_download=$(bluer_ai_option_int "$options" download 0)
9
+
10
+ local object_name=$(bluer_ai_clarify_object $3 .)
11
+ local filename=$(bluer_ai_option "$options" filename $object_name.gif)
12
+
13
+ [[ "$do_download" == 1 ]] &&
14
+ bluer_objects_download \
15
+ filename=$filename \
16
+ $object_name
17
+
18
+ bluer_ai_browse $ABCLI_OBJECT_ROOT/$object_name/$filename
19
+
20
+ return
21
+ fi
22
+
5
23
  local do_dryrun=$(bluer_ai_option_int "$options" dryrun 0)
6
24
  local do_download=$(bluer_ai_option_int "$options" download $(bluer_ai_not $do_dryrun))
7
25
  local do_upload=$(bluer_ai_option_int "$options" upload $(bluer_ai_not $do_dryrun))
@@ -12,15 +12,31 @@ function bluer_objects_host() {
12
12
  return
13
13
  fi
14
14
 
15
- if [ $task == "reboot" ]; then
16
- bluer_ai_eval ,$options \
17
- sudo reboot
18
- return
19
- fi
15
+ if [[ "|reboot|shutdown|" == *"|$task|"* ]]; then
16
+ local command_line
17
+ [[ $task == "reboot" ]] &&
18
+ command_line="sudo reboot"
19
+ [[ $task == "shutdown" ]] &&
20
+ command_line="sudo shutdown -h now"
21
+
22
+ local rpi=$(bluer_ai_option_int "$options" rpi 0)
23
+ if [[ "$rpi" == 1 ]]; then
24
+ local machine_name=$3
25
+ if [[ -z "$machine_name" ]]; then
26
+ bluer_ai_log_error "machine_name not found."
27
+ return 1
28
+ fi
29
+
30
+ ssh \
31
+ pi@$machine_name.local \
32
+ $command_line
33
+
34
+ return
35
+ fi
20
36
 
21
- if [ $task == "shutdown" ]; then
22
37
  bluer_ai_eval ,$options \
23
- sudo shutdown -h now
38
+ $command_line
39
+
24
40
  return
25
41
  fi
26
42
 
@@ -3,16 +3,27 @@
3
3
  function bluer_objects_ls() {
4
4
  local options=$1
5
5
  local where=$(bluer_ai_option_choice "$options" cloud,local)
6
+ local objects=$(bluer_ai_option_int "$options" objects 0)
6
7
 
7
- if [[ -z "$where" ]]; then
8
- ls -1 "$@"
9
- else
10
- local object_name=$(bluer_ai_clarify_object $2 .)
11
-
8
+ if [[ "$objects" == 1 ]]; then
12
9
  python3 -m bluer_objects.storage \
13
- ls \
14
- --object_name $object_name \
10
+ ls_objects \
15
11
  --where $where \
16
- "${@:3}"
12
+ "${@:2}"
13
+
14
+ return
15
+ fi
16
+
17
+ if [[ -z "$where" ]]; then
18
+ ls -1 "$@"
19
+ return
17
20
  fi
21
+
22
+ local object_name=$(bluer_ai_clarify_object $2 .)
23
+
24
+ python3 -m bluer_objects.storage \
25
+ ls \
26
+ --object_name $object_name \
27
+ --where $where \
28
+ "${@:3}"
18
29
  }
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_metadata_download() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ bluer_objects_download \
7
+ filename=metadata.yaml \
8
+ $object_name
9
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_metadata_edit() {
4
+ local options=$1
5
+ local do_download=$(bluer_ai_option_int "$options" download 0)
6
+
7
+ local object_name=$(bluer_ai_clarify_object $2 .)
8
+
9
+ if [[ "$do_download" == 1 ]]; then
10
+ bluer_objects_metadata_download \
11
+ $object_name
12
+ fi
13
+
14
+ bluer_ai_code $ABCLI_OBJECT_ROOT/$object_name/metadata.yaml
15
+ }
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_metadata_upload() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ bluer_objects_upload \
7
+ filename=metadata.yaml \
8
+ $object_name
9
+ }
@@ -5,6 +5,8 @@ function bluer_objects_mlflow_browse() {
5
5
  local browse_experiment=$(bluer_ai_option_int "$options" experiment 0)
6
6
 
7
7
  local url=http://localhost:5001/#
8
+ [[ "$MLFLOW_DEPLOYMENT" != "local" ]] &&
9
+ url=$MLFLOW_TRACKING_URI
8
10
 
9
11
  if [ $(bluer_ai_option_int "$options" databricks 0) == 1 ]; then
10
12
  url="https://accounts.cloud.databricks.com/"
@@ -2,14 +2,30 @@
2
2
 
3
3
  function bluer_objects_mlflow_deploy() {
4
4
  local options=$1
5
+ local do_set=$(bluer_ai_option_int "$options" set 0)
6
+
7
+ if [[ "$do_set" == 1 ]]; then
8
+ local url=$2
9
+ if [[ -z "$url" ]]; then
10
+ bluer_ai_log_error "url not found."
11
+ return 1
12
+ fi
13
+
14
+ pushd $abcli_path_git/bluer-objects >/dev/null
15
+ dotenv set \
16
+ MLFLOW_DEPLOYMENT \
17
+ $url
18
+ popd >/dev/null
19
+
20
+ bluer_objects init
21
+ return
22
+ fi
23
+
5
24
  local do_dryrun=$(bluer_ai_option_int "$options" dryrun 0)
6
- local do_local=$(bluer_ai_option_int "$options" local 1)
7
25
  local port=$(bluer_ai_option "$options" port 5001)
8
26
 
9
- if [[ "$do_local" == 0 ]]; then
10
- bluer_ai_log_error "only local deployment is supported."
11
- return 1
12
- fi
27
+ [[ "$MLFLOW_DEPLOYMENT" != "local" ]] &&
28
+ bluer_ai_log_warning "MLFLOW_DEPLOYMENT is not local".
13
29
 
14
30
  bluer_ai_badge "🤖"
15
31
 
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_mlflow_lock_lock() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ bluer_ai_eval dryrun=$do_dryrun \
7
+ python3 -m bluer_objects.mlflow.lock \
8
+ lock \
9
+ --object_name $object_name \
10
+ "${@:2}"
11
+ }
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_mlflow_lock_unlock() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ bluer_ai_eval dryrun=$do_dryrun \
7
+ python3 -m bluer_objects.mlflow.lock \
8
+ unlock \
9
+ --object_name $object_name \
10
+ "${@:2}"
11
+
12
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_mlflow_lock() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_objects_mlflow_lock_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_objects.mlflow.lock "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /lock
@@ -1,7 +1,5 @@
1
1
  #! /usr/bin/env bash
2
2
 
3
- export MLFLOW_TRACKING_URI=$HOME/mlflow
4
-
5
3
  function bluer_objects_mlflow() {
6
4
  local task=$1
7
5
 
@@ -0,0 +1,92 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_pdf_convert() {
4
+ local options=$1
5
+ local do_inline=$(bluer_ai_option_int "$options" inline 0)
6
+ local do_install=$(bluer_ai_option_int "$options" install 0)
7
+ local do_combine=$(bluer_ai_option_int "$options" combine 0)
8
+ local do_compress=$(bluer_ai_option_int "$options" compress $do_combine)
9
+ local do_upload=$(bluer_ai_option_int "$options" upload 0)
10
+ local filename=$(bluer_ai_option "$options" filename release.pdf)
11
+
12
+ if [[ "$do_install" == 1 ]]; then
13
+ pip install pypandoc
14
+ pip install PyPDF2
15
+
16
+ if [[ "$abcli_is_mac" == true ]]; then
17
+ brew install pandoc
18
+ brew install wkhtmltopdf
19
+ brew install ghostscript
20
+ fi
21
+ fi
22
+
23
+ if [[ "$do_inline" == 1 ]]; then
24
+ local module_name=${2:-object}
25
+ if alias "$module_name" &>/dev/null; then
26
+ module_name=$(alias "$module_name" | sed -E "s/^alias $module_name='(.*)'$/\1/")
27
+ fi
28
+
29
+ local path_prefix=$(python3 -m $module_name locate)/docs/
30
+
31
+ local suffixes=${3:-metadata}
32
+
33
+ local object_name=$(bluer_ai_clarify_object $4 pdf-$(bluer_ai_string_timestamp))
34
+
35
+ bluer_ai_log "@pdf $module_name/$suffixes -> $object_name ..."
36
+
37
+ bluer_ai_eval dryrun=$do_dryrun \
38
+ python3 -m bluer_objects.pdf \
39
+ convert \
40
+ --path_prefix $path_prefix \
41
+ --object_name $object_name \
42
+ --suffixes $suffixes \
43
+ --combine $do_combine \
44
+ "${@:5}"
45
+ else
46
+ local object_name=$(bluer_ai_clarify_object $2 pdf-$(bluer_ai_string_timestamp))
47
+
48
+ bluer_ai_log "@pdf $object_name ..."
49
+
50
+ bluer_ai_eval dryrun=$do_dryrun \
51
+ python3 -m bluer_objects.pdf \
52
+ convert \
53
+ --object_name $object_name \
54
+ --combine $do_combine \
55
+ --use_metadata 1 \
56
+ "${@:3}"
57
+ fi
58
+ [[ $? -ne 0 ]] && return 1
59
+
60
+ if [[ "$do_compress" == 1 ]]; then
61
+ bluer_ai_log "compressing..."
62
+
63
+ local object_path=$ABCLI_OBJECT_ROOT/$object_name
64
+ mv -v \
65
+ $object_path/$filename \
66
+ $object_path/_$filename
67
+
68
+ gs -sDEVICE=pdfwrite \
69
+ -dCompatibilityLevel=1.4 \
70
+ -dPDFSETTINGS=/ebook \
71
+ -dNOPAUSE \
72
+ -dBATCH \
73
+ -sOutputFile=$object_path/$filename \
74
+ $object_path/_$filename
75
+ [[ $? -ne 0 ]] && return 1
76
+
77
+ rm $object_path/_$filename
78
+ bluer_ai_log "-> $object_path/$filename"
79
+ fi
80
+
81
+ if [[ "$do_upload" == 1 ]]; then
82
+ bluer_objects_upload \
83
+ filename=$filename \
84
+ $object_name
85
+ [[ $? -ne 0 ]] && return 1
86
+
87
+ if [[ "$do_inline" == 0 ]]; then
88
+ bluer_objects_metadata_upload \
89
+ $object_name
90
+ fi
91
+ fi
92
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_pdf() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_objects_pdf_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 bluer_objects.pdf "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /pdf
@@ -4,11 +4,13 @@ function bluer_ai_storage_clear() {
4
4
  local options=$1
5
5
  local do_cloud=$(bluer_ai_option_int "$options" cloud 0)
6
6
  local do_dryrun=$(bluer_ai_option_int "$options" dryrun 1)
7
+ local do_public=$(bluer_ai_option_int "$options" public 0)
7
8
 
8
9
  if [[ "$do_cloud" == 1 ]]; then
9
10
  python3 -m bluer_objects.storage \
10
11
  clear \
11
12
  --do_dryrun $do_dryrun \
13
+ --public $do_public \
12
14
  "${@:2}"
13
15
  return
14
16
  fi
@@ -5,9 +5,8 @@ function test_bluer_objects_clone() {
5
5
 
6
6
  local source_object_name=test_bluer_objects_clone-$(bluer_ai_string_timestamp_short)
7
7
 
8
- python3 -m bluer_objects.testing \
9
- create_test_asset \
10
- --object_name $source_object_name
8
+ bluer_objects_create_test_asset \
9
+ $source_object_name
11
10
  [[ $? -ne 0 ]] && return 1
12
11
 
13
12
  local object_name=test_bluer_objects_clone-$(bluer_ai_string_timestamp_short)
@@ -0,0 +1,16 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_objects_create_test_asset() {
4
+ local options=$1
5
+
6
+ local source_object_name=test_bluer_objects_clone-$(bluer_ai_string_timestamp_short)
7
+
8
+ bluer_objects_create_test_asset \
9
+ $source_object_name
10
+ [[ $? -ne 0 ]] && return 1
11
+ bluer_ai_hr
12
+
13
+ bluer_objects_create_test_asset \
14
+ $source_object_name \
15
+ --depth 3
16
+ }
@@ -0,0 +1,64 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_file_asset() {
4
+ echo $abcli_path_git/bluer-objects/bluer_objects/.abcli/tests/file.sh
5
+ }
6
+
7
+ function test_file_replace() {
8
+ local options=$1
9
+
10
+ local filename=$abcli_path_git/file.sh
11
+
12
+ cp -v \
13
+ $(test_file_asset) \
14
+ $filename
15
+ [[ $? -ne 0 ]] && return 1
16
+
17
+ bluer_objects_file - \
18
+ replace \
19
+ $filename \
20
+ --this function+local \
21
+ --that FUNCTION+LOCAL \
22
+ --cat 1 \
23
+ "${@:2}"
24
+ [[ $? -ne 0 ]] && return 1
25
+ bluer_ai_hr
26
+
27
+ # ---
28
+
29
+ bluer_objects_file - \
30
+ replace \
31
+ $filename \
32
+ --this "FUNCTION test_file_asset() {+echo" \
33
+ --that ":)+:(" \
34
+ --cat 1 \
35
+ --whole_line 1 \
36
+ "${@:2}"
37
+ [[ $? -ne 0 ]] && return 1
38
+ rm -v $filename
39
+ }
40
+
41
+ function test_file_size() {
42
+ local options=$1
43
+
44
+ local size=$(bluer_objects_file - \
45
+ size \
46
+ $(test_file_asset))
47
+
48
+ bluer_ai_assert \
49
+ "$size" \
50
+ "1.18 kB"
51
+ [[ $? -ne 0 ]] && return 1
52
+ bluer_ai_hr
53
+
54
+ # ---
55
+
56
+ local size=$(bluer_objects_file - \
57
+ size \
58
+ $(test_file_asset) \
59
+ --pretty 0)
60
+
61
+ bluer_ai_assert \
62
+ "$size" \
63
+ "1209"
64
+ }