blue-sandbox 5.318.1__tar.gz → 5.322.1__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.
Files changed (41) hide show
  1. {blue_sandbox-5.318.1/blue_sandbox.egg-info → blue_sandbox-5.322.1}/PKG-INFO +2 -2
  2. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/README.md +1 -1
  3. blue_sandbox-5.322.1/blue_sandbox/.abcli/assets/publish.sh +30 -0
  4. blue_sandbox-5.322.1/blue_sandbox/.abcli/assets.sh +15 -0
  5. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/__init__.py +1 -1
  6. blue_sandbox-5.322.1/blue_sandbox/assets/__init__.py +0 -0
  7. blue_sandbox-5.322.1/blue_sandbox/assets/__main__.py +51 -0
  8. blue_sandbox-5.322.1/blue_sandbox/assets/functions.py +68 -0
  9. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1/blue_sandbox.egg-info}/PKG-INFO +2 -2
  10. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox.egg-info/SOURCES.txt +5 -0
  11. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/setup.py +1 -0
  12. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/LICENSE +0 -0
  13. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/MANIFEST.in +0 -0
  14. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/abcli.sh +0 -0
  15. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/actions.sh +0 -0
  16. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/aka.sh +0 -0
  17. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/alias.sh +0 -0
  18. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/blue_sandbox.sh +0 -0
  19. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/browse.sh +0 -0
  20. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/install.sh +0 -0
  21. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/tests/README.sh +0 -0
  22. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/tests/help.sh +0 -0
  23. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/.abcli/tests/version.sh +0 -0
  24. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/README.py +0 -0
  25. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/__main__.py +0 -0
  26. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/config.env +0 -0
  27. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/env.py +0 -0
  28. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/functions.py +0 -0
  29. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/help/__init__.py +0 -0
  30. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/help/__main__.py +0 -0
  31. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/help/functions.py +0 -0
  32. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/host.py +0 -0
  33. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/logger.py +0 -0
  34. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/sample.env +0 -0
  35. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox/urls.py +0 -0
  36. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox.egg-info/dependency_links.txt +0 -0
  37. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox.egg-info/requires.txt +0 -0
  38. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/blue_sandbox.egg-info/top_level.txt +0 -0
  39. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/pyproject.toml +0 -0
  40. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/requirements.txt +0 -0
  41. {blue_sandbox-5.318.1 → blue_sandbox-5.322.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.318.1
3
+ Version: 5.322.1
4
4
  Summary: 🌀 A sandbox for ideas and experiments.
5
5
  Home-page: https://github.com/kamangir/blue-sandbox
6
6
  Author: Arash Abadpour (Kamangir)
@@ -56,4 +56,4 @@ pip install blue-sandbox
56
56
 
57
57
  [![pylint](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-sandbox.svg)](https://pypi.org/project/blue-sandbox/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-sandbox)](https://pypistats.org/packages/blue-sandbox)
58
58
 
59
- built by 🌀 [`blue_options-4.202.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.318.1`](https://github.com/kamangir/blue-sandbox).
59
+ built by 🌀 [`blue_options-4.223.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.322.1`](https://github.com/kamangir/blue-sandbox).
@@ -12,4 +12,4 @@ pip install blue-sandbox
12
12
 
13
13
  [![pylint](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-sandbox.svg)](https://pypi.org/project/blue-sandbox/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-sandbox)](https://pypistats.org/packages/blue-sandbox)
14
14
 
15
- built by 🌀 [`blue_options-4.202.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.318.1`](https://github.com/kamangir/blue-sandbox).
15
+ built by 🌀 [`blue_options-4.223.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.322.1`](https://github.com/kamangir/blue-sandbox).
@@ -0,0 +1,30 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_assets_publish() {
4
+ local options=$1
5
+
6
+ local do_download=$(abcli_option_int "$options" download 0)
7
+ local do_push=$(abcli_option_int "$options" push 0)
8
+ local extensions=$(abcli_option "$options" extensions png+geojson)
9
+
10
+ local object_name=$(abcli_clarify_object $2 .)
11
+
12
+ [[ "$do_download" == 1 ]] &&
13
+ abcli_download - $object_name
14
+
15
+ abcli_eval dryrun=$do_dryrun \
16
+ python3 -m blue_sandbox.assets \
17
+ publish \
18
+ --object_name $object_name \
19
+ --extensions $extensions \
20
+ "${@:3}"
21
+ [[ $? -ne 0 ]] && return 1
22
+
23
+ [[ "$do_push" == 1 ]] &&
24
+ abcli_git \
25
+ assets \
26
+ push \
27
+ "$object_name update."
28
+
29
+ return 0
30
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_assets() {
4
+ local task=$(abcli_unpack_keyword $1 help)
5
+
6
+ local function_name=abcli_assets_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m blue_sandbox.assets "$@"
13
+ }
14
+
15
+ abcli_source_caller_suffix_path /assets
@@ -4,7 +4,7 @@ ICON = "🌀"
4
4
 
5
5
  DESCRIPTION = f"{ICON} A sandbox for ideas and experiments."
6
6
 
7
- VERSION = "5.318.1"
7
+ VERSION = "5.322.1"
8
8
 
9
9
  REPO_NAME = "blue-sandbox"
10
10
 
File without changes
@@ -0,0 +1,51 @@
1
+ import argparse
2
+
3
+ from blueness import module
4
+ from blueness.argparse.generic import sys_exit
5
+
6
+ from blue_sandbox import NAME
7
+ from blue_sandbox.assets.functions import publish
8
+ from blue_sandbox.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="publish",
17
+ )
18
+ parser.add_argument(
19
+ "--arg",
20
+ type=bool,
21
+ default=0,
22
+ help="0|1",
23
+ )
24
+ parser.add_argument(
25
+ "--object_name",
26
+ type=str,
27
+ )
28
+ parser.add_argument(
29
+ "--extensions",
30
+ type=str,
31
+ default="png+geojson",
32
+ help="png+geojson",
33
+ )
34
+ parser.add_argument(
35
+ "--prefix",
36
+ type=str,
37
+ default="",
38
+ )
39
+ args = parser.parse_args()
40
+
41
+ success = False
42
+ if args.task == "publish":
43
+ success = publish(
44
+ object_name=args.object_name,
45
+ list_of_extensions=args.extensions.split("+"),
46
+ prefix=args.prefix,
47
+ )
48
+ else:
49
+ success = None
50
+
51
+ sys_exit(logger, NAME, args.task, success)
@@ -0,0 +1,68 @@
1
+ import os
2
+ from typing import List
3
+ import glob
4
+ from tqdm import tqdm
5
+
6
+ from blueness import module
7
+ from blue_objects import objects, file
8
+ from blue_objects.env import abcli_path_git
9
+ from blue_geo.file.load import load_geodataframe
10
+ from blue_geo.file.save import save_geojson
11
+
12
+ from blue_sandbox import NAME
13
+ from blue_sandbox.logger import logger
14
+
15
+
16
+ NAME = module.name(__file__, NAME)
17
+
18
+
19
+ def publish(
20
+ object_name: str,
21
+ list_of_extensions: List[str],
22
+ prefix: str = "",
23
+ log: bool = True,
24
+ ) -> bool:
25
+ logger.info(
26
+ "{}.publish: {}/{}.* for {}".format(
27
+ NAME,
28
+ object_name,
29
+ prefix,
30
+ ", ".join(list_of_extensions),
31
+ )
32
+ )
33
+
34
+ for extension in tqdm(list_of_extensions):
35
+ for filename in glob.glob(
36
+ objects.path_of(
37
+ filename=f"{prefix}*.{extension}",
38
+ object_name=object_name,
39
+ )
40
+ ):
41
+ published_filename = os.path.join(
42
+ abcli_path_git,
43
+ "assets",
44
+ object_name,
45
+ file.name_and_extension(filename),
46
+ )
47
+
48
+ if extension in ["png", "jpg", "jpeg", "gif"]:
49
+ if not file.copy(
50
+ filename,
51
+ published_filename,
52
+ log=log,
53
+ ):
54
+ return False
55
+
56
+ if extension == "geojson":
57
+ success, gdf = load_geodataframe(filename)
58
+ if not success:
59
+ return False
60
+
61
+ gdf = gdf.to_crs("EPSG:4326")
62
+
63
+ if not save_geojson(published_filename, gdf):
64
+ return False
65
+
66
+ logger.info(f"🔗 https://github.com/kamangir/assets/tree/main/{object_name}")
67
+
68
+ return True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: blue_sandbox
3
- Version: 5.318.1
3
+ Version: 5.322.1
4
4
  Summary: 🌀 A sandbox for ideas and experiments.
5
5
  Home-page: https://github.com/kamangir/blue-sandbox
6
6
  Author: Arash Abadpour (Kamangir)
@@ -56,4 +56,4 @@ pip install blue-sandbox
56
56
 
57
57
  [![pylint](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/blue-sandbox/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-sandbox.svg)](https://pypi.org/project/blue-sandbox/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-sandbox)](https://pypistats.org/packages/blue-sandbox)
58
58
 
59
- built by 🌀 [`blue_options-4.202.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.318.1`](https://github.com/kamangir/blue-sandbox).
59
+ built by 🌀 [`blue_options-4.223.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`blue_sandbox-5.322.1`](https://github.com/kamangir/blue-sandbox).
@@ -23,12 +23,17 @@ blue_sandbox/.abcli/abcli.sh
23
23
  blue_sandbox/.abcli/actions.sh
24
24
  blue_sandbox/.abcli/aka.sh
25
25
  blue_sandbox/.abcli/alias.sh
26
+ blue_sandbox/.abcli/assets.sh
26
27
  blue_sandbox/.abcli/blue_sandbox.sh
27
28
  blue_sandbox/.abcli/browse.sh
28
29
  blue_sandbox/.abcli/install.sh
30
+ blue_sandbox/.abcli/assets/publish.sh
29
31
  blue_sandbox/.abcli/tests/README.sh
30
32
  blue_sandbox/.abcli/tests/help.sh
31
33
  blue_sandbox/.abcli/tests/version.sh
34
+ blue_sandbox/assets/__init__.py
35
+ blue_sandbox/assets/__main__.py
36
+ blue_sandbox/assets/functions.py
32
37
  blue_sandbox/help/__init__.py
33
38
  blue_sandbox/help/__main__.py
34
39
  blue_sandbox/help/functions.py
@@ -9,6 +9,7 @@ setup(
9
9
  description=DESCRIPTION,
10
10
  packages=[
11
11
  NAME,
12
+ f"{NAME}.assets",
12
13
  f"{NAME}.help",
13
14
  ],
14
15
  include_package_data=True,
File without changes
File without changes