bluer-objects 6.181.1__py3-none-any.whl → 6.186.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-objects might be problematic. Click here for more details.

@@ -38,3 +38,5 @@ alias @select=bluer_ai_select
38
38
  alias @storage=bluer_ai_storage
39
39
 
40
40
  alias @upload=bluer_objects_upload
41
+
42
+ alias @url=bluer_objects_url
@@ -77,6 +77,9 @@ function test_bluer_objects_help() {
77
77
  \
78
78
  "@upload" \
79
79
  \
80
+ "@url" \
81
+ "@url is_accessible" \
82
+ \
80
83
  "@wait" \
81
84
  \
82
85
  "bluer_objects"; do
@@ -0,0 +1,17 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_objects_url_is_accessible() {
4
+ local output=$(bluer_objects_url_is_accessible void)
5
+ [[ "$output" -ne 0 ]] &&
6
+ return 1
7
+
8
+ local url="https://iribnews.ir"
9
+ [[ "$abcli_is_github_workflow" == true ]] &&
10
+ url="https://cnn.com"
11
+
12
+ output=$(bluer_objects_url_is_accessible $url)
13
+ [[ "$output" -ne 1 ]] &&
14
+ return 1
15
+
16
+ return 0
17
+ }
@@ -0,0 +1,13 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_url_is_accessible() {
4
+ local url=$1
5
+ if [[ -z "$url" ]]; then
6
+ bluer_ai_log_error "url not found."
7
+ return 1
8
+ fi
9
+
10
+ python3 -m bluer_objects.url \
11
+ is_accessible \
12
+ --url $url
13
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_url() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_objects_url_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_objects.url "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /url
bluer_objects/__init__.py CHANGED
@@ -4,7 +4,7 @@ ICON = "🌀"
4
4
 
5
5
  DESCRIPTION = f"{ICON} Object management in Bash."
6
6
 
7
- VERSION = "6.181.1"
7
+ VERSION = "6.186.1"
8
8
 
9
9
  REPO_NAME = "bluer-objects"
10
10
 
@@ -10,6 +10,7 @@ from bluer_objects.help.ls import help_ls
10
10
  from bluer_objects.help.metadata import help_functions as help_metadata
11
11
  from bluer_objects.help.mlflow import help_functions as help_mlflow
12
12
  from bluer_objects.help.upload import help_upload
13
+ from bluer_objects.help.url import help_functions as help_url
13
14
 
14
15
  help_functions = generic_help_functions(plugin_name=ALIAS)
15
16
 
@@ -24,5 +25,6 @@ help_functions.update(
24
25
  "metadata": help_metadata,
25
26
  "mlflow": help_mlflow,
26
27
  "upload": help_upload,
28
+ "url": help_url,
27
29
  }
28
30
  )
@@ -0,0 +1,23 @@
1
+ from typing import List
2
+
3
+ from bluer_options.terminal import show_usage
4
+
5
+
6
+ def help_is_accessible(
7
+ tokens: List[str],
8
+ mono: bool,
9
+ ) -> str:
10
+ return show_usage(
11
+ [
12
+ "@url",
13
+ "is_accessible",
14
+ "<url>",
15
+ ],
16
+ "is <url> accessible?",
17
+ mono=mono,
18
+ )
19
+
20
+
21
+ help_functions = {
22
+ "is_accessible": help_is_accessible,
23
+ }
@@ -0,0 +1,11 @@
1
+ from bluer_objects.url.functions import is_accessible
2
+ from bluer_ai.env import abcli_is_github_workflow
3
+
4
+
5
+ def test_url_is_accessible():
6
+ success = is_accessible("void")
7
+ assert not success
8
+
9
+ url = "https://cnn.com" if abcli_is_github_workflow else "https://iribnews.ir"
10
+ success = is_accessible(url)
11
+ assert success
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,31 @@
1
+ import argparse
2
+
3
+ from blueness import module
4
+ from blueness.argparse.generic import sys_exit
5
+
6
+ from bluer_objects import NAME
7
+ from bluer_objects.url.functions import is_accessible
8
+ from bluer_objects.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="is_accessible",
17
+ )
18
+ parser.add_argument(
19
+ "--url",
20
+ type=str,
21
+ )
22
+ args = parser.parse_args()
23
+
24
+ success = False
25
+ if args.task == "is_accessible":
26
+ success = True
27
+ print(int(is_accessible(args.url)))
28
+ else:
29
+ success = None
30
+
31
+ sys_exit(logger, NAME, args.task, success)
@@ -0,0 +1,11 @@
1
+ import requests
2
+
3
+ from bluer_objects.logger import logger
4
+
5
+
6
+ def is_accessible(url) -> bool:
7
+ try:
8
+ response = requests.get(url)
9
+ return response.status_code == 200
10
+ except:
11
+ return False
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bluer_objects
3
- Version: 6.181.1
3
+ Version: 6.186.1
4
4
  Summary: 🌀 Object management in Bash.
5
5
  Home-page: https://github.com/kamangir/bluer-objects
6
6
  Author: Arash Abadpour (Kamangir)
@@ -64,6 +64,6 @@ pip install bluer-objects
64
64
 
65
65
  [![pylint](https://github.com/kamangir/bluer-objects/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/bluer-objects/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/pytest.yml) [![bashtest](https://github.com/kamangir/bluer-objects/actions/workflows/bashtest.yml/badge.svg)](https://github.com/kamangir/bluer-objects/actions/workflows/bashtest.yml) [![PyPI version](https://img.shields.io/pypi/v/bluer-objects.svg)](https://pypi.org/project/bluer-objects/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/bluer-objects)](https://pypistats.org/packages/bluer-objects)
66
66
 
67
- built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 🌀 [`bluer_objects-6.181.1`](https://github.com/kamangir/bluer-objects).
67
+ built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 🌀 [`bluer_objects-6.186.1`](https://github.com/kamangir/bluer-objects).
68
68
 
69
69
  built by 🌀 [`blueness-3.118.1`](https://github.com/kamangir/blueness).
@@ -1,4 +1,4 @@
1
- bluer_objects/__init__.py,sha256=ZS-H8ZaUb_ms3k0y-QCmwt8bOPXKu7xlp2mbW8xNmpk,315
1
+ bluer_objects/__init__.py,sha256=1sNJL8KQSNM0GOrqwPBYL3WA9ATDYGZnG0TcMjplZCo,315
2
2
  bluer_objects/__main__.py,sha256=Yqfov833_hJuRne19WrGhT5DWAPtdffpoMxeSXS7EGw,359
3
3
  bluer_objects/config.env,sha256=RjcpnbKfRqNyGLRB4z7M_OG9z2pOM032ck__53JqXqo,216
4
4
  bluer_objects/env.py,sha256=iw4QvaImqnavlsHwfkUScNHc7afDEJQKJSsHTtVJE78,2019
@@ -10,7 +10,7 @@ bluer_objects/urls.py,sha256=paHaYlLMQOI46-EYNch5ohu9Q09BMkF2vvJy1QufrVI,19
10
10
  bluer_objects/.abcli/abcli.sh,sha256=zcqSfpuonb7u9YZCO6jbYeU63pTi0WD5q7lBMSUBXqw,352
11
11
  bluer_objects/.abcli/actions.sh,sha256=HZI-X5KUy6bXEHmxywfBN1zbHalU0mcTblTQ2HvIfOE,236
12
12
  bluer_objects/.abcli/aka.sh,sha256=odRbw4KZb9Ld7uXny6H2pPi64_5kowKX3s68N6YvRmI,23
13
- bluer_objects/.abcli/alias.sh,sha256=wrYmXLozAQKQ3XWoI5id9MFWgU8NvI3wnU8cFs2G3DE,758
13
+ bluer_objects/.abcli/alias.sh,sha256=yQFLZizlUHDZu_7P182J7YuT3wAIfdUUCHN0ThWgRuc,788
14
14
  bluer_objects/.abcli/bluer_objects.sh,sha256=x7qf8hSAp3dAl0Hes4J07vL6qP-mWFUkJhvUXzTJC_8,210
15
15
  bluer_objects/.abcli/clone.sh,sha256=KqC5d4MAXwo7UZGhKnfCq9k9CCSl3I1dpU1igYs0Yrs,1975
16
16
  bluer_objects/.abcli/create_test_asset.sh,sha256=ONIdad_WRjZWdW6V2RalRW2qSJwybEwzU-_KsvaJ9og,245
@@ -25,6 +25,7 @@ bluer_objects/.abcli/object.sh,sha256=Zh2ZMFqBSIOHwwwLegCMxJRfaYCbPp1EJMT3LvcFzh
25
25
  bluer_objects/.abcli/select.sh,sha256=CVcqVRN6bMLtEo0SptZS_QGY90_lT1Su71DlcVyddXo,878
26
26
  bluer_objects/.abcli/storage.sh,sha256=iYHxdXJI9sGR-WKxDuYKOB06FccSQ0G0-uZn9UJQGnc,321
27
27
  bluer_objects/.abcli/upload.sh,sha256=IbT786rA6nWuQurhGOFOiJeH_ZqVpnhvrARA1VJl9MU,640
28
+ bluer_objects/.abcli/url.sh,sha256=T5Scg0PcMJleqB_JhOCyT3_bQDXRh4D4YCvV1AVQQ7A,315
28
29
  bluer_objects/.abcli/metadata/get.sh,sha256=6W9x0akZwwozTyOlKCW_0MndYVUAL4v1HSUPxTAsfKA,835
29
30
  bluer_objects/.abcli/metadata/post.sh,sha256=UdvZNuRu6_NcyRVvDMFZ9GEwOm3K8rsNqM0FFr9LskA,570
30
31
  bluer_objects/.abcli/mlflow/browse.sh,sha256=jPHAKLgG7yDLCdSAW5acVmCOcOltAkZQ8FrttrX401s,1166
@@ -54,7 +55,7 @@ bluer_objects/.abcli/tests/README.sh,sha256=gk2KuNLFTuV3qdVgH8BNfJmur3gZoSV8EwLb
54
55
  bluer_objects/.abcli/tests/clone.sh,sha256=Rl9pHvmRJ4H-y-iMA80q11UdSZFrguNaMTez0LTtJjA,473
55
56
  bluer_objects/.abcli/tests/create_test_asset.sh,sha256=onRGc3VjDWA7On3isxKD3J7mxA6n349AVXRj90Z3Jzc,386
56
57
  bluer_objects/.abcli/tests/gif.sh,sha256=2FvcomiyYTzJa527a7Wk2EJt5N9_vZt8tmQD1QVetDg,461
57
- bluer_objects/.abcli/tests/help.sh,sha256=ViyFns-27DKGh7dOSSvOHTlbE4qLw9YzhCxmVe87vJo,1890
58
+ bluer_objects/.abcli/tests/help.sh,sha256=gVdwuupQhLnbruPuuSqr5jInb6dtxhbPQXD4lmhKoKM,1948
58
59
  bluer_objects/.abcli/tests/host.sh,sha256=GBuTLNw1sU3fAb5jS-ew_qAfovVCQ5CLaz5ad04IkoA,144
59
60
  bluer_objects/.abcli/tests/ls.sh,sha256=oOvcnEQZgnNlwCK4SvkdAjCBs2_z0qBOhgFLsXDBSXM,555
60
61
  bluer_objects/.abcli/tests/metadata.sh,sha256=OP1c0h0TSlDycrv0UglKLyBtTQwqh9M0nqVAdQUzkno,1723
@@ -65,7 +66,9 @@ bluer_objects/.abcli/tests/mlflow_tags.sh,sha256=pX4sEK_z2Vrb7a6Bq4qWurFVPZkvjpS
65
66
  bluer_objects/.abcli/tests/mlflow_test.sh,sha256=7MXxYq2GgD2MEJbQlpx80qLT2HaaVn_PFFMpSA_hWA4,125
66
67
  bluer_objects/.abcli/tests/storage_public_upload.sh,sha256=3S7YJQ-mbPcVtG384PRxEGP7xGLJgvvV-CtV4hgz2I8,456
67
68
  bluer_objects/.abcli/tests/storage_upload_download.sh,sha256=tXjrHuFtmogC9Pf4Q8aTU1Sx1C653GOcy_jIsecelMY,1346
69
+ bluer_objects/.abcli/tests/url_is_accessible.sh,sha256=JwrEfBD19H2nyUG9GY66_NONgwm4TkEXwkw2FFushSo,405
68
70
  bluer_objects/.abcli/tests/version.sh,sha256=k-lXozSjyFgFR58cTzUYla0Ef-upx3sSK641zI5ynfE,169
71
+ bluer_objects/.abcli/url/is_accessible.sh,sha256=nU6YuCOXjSQlvH3CoixSIAuv5Ck9YUqPhyEwwe6NfS0,262
69
72
  bluer_objects/README/__init__.py,sha256=JwxdTVAK3LeUaw7rMJujOFIXZA59HaLCtxpsR1C-vpo,1311
70
73
  bluer_objects/README/functions.py,sha256=IriuSysrApSTEgOZHqq32-eyks5v5Tn-KvmwYQUIloc,10752
71
74
  bluer_objects/README/items.py,sha256=-XaNCr5b_NGRkZVfIQ6hBFgJw5GIVcMJdktT3hWoam4,755
@@ -87,12 +90,13 @@ bluer_objects/help/__main__.py,sha256=Dxg-JpMOIlYWZklI_J2LyiHnRui5lUwWmfM7FLRzUX
87
90
  bluer_objects/help/clone.py,sha256=PDnQs7zc4sqmoBHPjVRfX7jIaePiohPGCNA5bxeerik,553
88
91
  bluer_objects/help/create_test_asset.py,sha256=oxJORm2qk4b_q7EC6-dEuNu1_pK9Ri60PcHhrE8ruxM,375
89
92
  bluer_objects/help/download.py,sha256=1fw3ASOXUuXcNhm8y0AK7ZBmXzWwZvdo2hK9ZVbgteA,439
90
- bluer_objects/help/functions.py,sha256=occpIuw_ywUnEiNGQiuJh_w15OEfKcmwD_NQ0wAJiNE,1009
93
+ bluer_objects/help/functions.py,sha256=-xkCaBRkDxeSfd9Df1DLiAwNoBwPx0uKWPpp7lUaYOY,1096
91
94
  bluer_objects/help/gif.py,sha256=gKV6vNT4bEC2Ch3QIb3Yc5DqzAH_UvAVCsuvzXeF1Sc,564
92
95
  bluer_objects/help/host.py,sha256=4t4yrPGjTbnFtODcuBjfIzpA5pmmvc5s4QrjIqPPVsM,988
93
96
  bluer_objects/help/ls.py,sha256=acvRLDxjJOzQ1a9ZQ4Mn9aBZ8Vf17IDHcAxC2O3R33Y,627
94
97
  bluer_objects/help/metadata.py,sha256=fk22NasBcZU1ffY4fu6AxrCzMQtTI28p_ghaSVRrrPM,2811
95
98
  bluer_objects/help/upload.py,sha256=tXAdVhy0FZfF5b4cAEgaYlLQ8_cnQ656um8QioKMV_o,456
99
+ bluer_objects/help/url.py,sha256=jflKGfzBtkiwNY8_5ZHK6CI0qqEqPVj6iuFPz1BQMvI,381
96
100
  bluer_objects/help/mlflow/__init__.py,sha256=fvnGg8l24oGWKd7lbVm32GHyrE3eBlholj4RFrjFNuw,4427
97
101
  bluer_objects/help/mlflow/cache.py,sha256=O8O1oaiq1e1z2HCi8fRe4hjSNimzvCaCAIu-u2GDHkE,704
98
102
  bluer_objects/help/mlflow/lock.py,sha256=REdB4LmlHu2_6SF1nDA50KBbYtNIKRDbYH7KduUnuEg,848
@@ -156,9 +160,13 @@ bluer_objects/tests/test_storage_s3.py,sha256=otgWqAzQBC7_RoNCyNoKUbONVlm18DSKQF
156
160
  bluer_objects/tests/test_storage_webdav_request.py,sha256=h2b8PeIx0-hQ2d6PmQcJZyQf59L3fDAzTbKg4SNV-SE,1769
157
161
  bluer_objects/tests/test_storage_webdav_zip.py,sha256=C19qxhkcHyTwVFzW35vL85SOcXJPkqXXaWUNll0Uyqc,1017
158
162
  bluer_objects/tests/test_testing.py,sha256=d2NH435yqJBl9wmfMqGGd-f0Y0jsL2QhHUXkty9AwPA,235
163
+ bluer_objects/tests/test_url_is_accessible.py,sha256=U86PpmQXA1TmDlVo-7osleCzq9ug-46-3WBae4xRGAA,331
159
164
  bluer_objects/tests/test_version.py,sha256=Lyf3PMcA22e17BNRk_2VgPrtao6dWEgVoXo68Uds8SE,75
160
- bluer_objects-6.181.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
161
- bluer_objects-6.181.1.dist-info/METADATA,sha256=1Qg1tbF7rFdTgwJ8ezbLyU-EtbWNukcWILBQV5QthQ4,3678
162
- bluer_objects-6.181.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
163
- bluer_objects-6.181.1.dist-info/top_level.txt,sha256=RX2TpddbnRkurda3G_pAdyeTztP2IhhRPx949GlEvQo,14
164
- bluer_objects-6.181.1.dist-info/RECORD,,
165
+ bluer_objects/url/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
166
+ bluer_objects/url/__main__.py,sha256=kjB2_6lIqGaEqi_-Nml__R6Urx80rO_1lxGnIx9NjWw,624
167
+ bluer_objects/url/functions.py,sha256=L7Ug7kRQBzjgxCwV1ugkCRJd9iqihK8XvztL8LLuDG4,213
168
+ bluer_objects-6.186.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
169
+ bluer_objects-6.186.1.dist-info/METADATA,sha256=pnfUPjGL-m1204o5h_C-gee7cZY9zgG9qtNoDZKN_s4,3678
170
+ bluer_objects-6.186.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
171
+ bluer_objects-6.186.1.dist-info/top_level.txt,sha256=RX2TpddbnRkurda3G_pAdyeTztP2IhhRPx949GlEvQo,14
172
+ bluer_objects-6.186.1.dist-info/RECORD,,