bluer-objects 6.181.1__py3-none-any.whl → 6.191.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 @web=bluer_objects_web
@@ -77,6 +77,10 @@ function test_bluer_objects_help() {
77
77
  \
78
78
  "@upload" \
79
79
  \
80
+ "@web" \
81
+ "@web is_accessible" \
82
+ "@web where_am_i" \
83
+ \
80
84
  "@wait" \
81
85
  \
82
86
  "bluer_objects"; do
@@ -0,0 +1,17 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_objects_web_is_accessible() {
4
+ local output=$(bluer_objects_web_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_web_is_accessible $url)
13
+ [[ "$output" -ne 1 ]] &&
14
+ return 1
15
+
16
+ return 0
17
+ }
@@ -0,0 +1,5 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_objects_web_where_am_i() {
4
+ bluer_objects_web_where_am_i
5
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_web() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_objects_web_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_objects.web "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /web
@@ -0,0 +1,13 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_web_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.web \
11
+ is_accessible \
12
+ --url $url
13
+ }
@@ -0,0 +1,5 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_web_where_am_i() {
4
+ curl ifconfig.co/json
5
+ }
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.191.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.web import help_functions as help_web
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
+ "web": help_web,
27
29
  }
28
30
  )
@@ -0,0 +1,38 @@
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
+ "@web",
13
+ "is_accessible",
14
+ "<url>",
15
+ ],
16
+ "is <url> accessible?",
17
+ mono=mono,
18
+ )
19
+
20
+
21
+ def help_where_am_i(
22
+ tokens: List[str],
23
+ mono: bool,
24
+ ) -> str:
25
+ return show_usage(
26
+ [
27
+ "@web",
28
+ "where_am_i",
29
+ ],
30
+ "where am I?",
31
+ mono=mono,
32
+ )
33
+
34
+
35
+ help_functions = {
36
+ "is_accessible": help_is_accessible,
37
+ "where_am_i": help_where_am_i,
38
+ }
@@ -0,0 +1,11 @@
1
+ from bluer_objects.web.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.web.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,9 @@
1
+ import requests
2
+
3
+
4
+ def is_accessible(url) -> bool:
5
+ try:
6
+ response = requests.get(url)
7
+ return response.status_code == 200
8
+ except:
9
+ 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.191.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.191.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=LJ2FI0JBSz8Edj83gykb0Nncu9QvUjZjBO-list95Gg,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=nYrAqpaXkL3xOTc_MQdZGSXB4kuUxxAqeXZrI5-E3e8,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=1YF6XNG109ItH6l3SUvvbRkm4JBojiUoLZ2wJYwM28U,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=demhv051Sv_aT3K2fSzbhz4yIFBONfWAfB1H7t1O6d4,1976
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
@@ -66,6 +67,10 @@ bluer_objects/.abcli/tests/mlflow_test.sh,sha256=7MXxYq2GgD2MEJbQlpx80qLT2HaaVn_
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
68
69
  bluer_objects/.abcli/tests/version.sh,sha256=k-lXozSjyFgFR58cTzUYla0Ef-upx3sSK641zI5ynfE,169
70
+ bluer_objects/.abcli/tests/web_is_accessible.sh,sha256=3R33_LQM9PIfl8Bks4HrPHp4ug8cGv9X6LaDscsznEs,405
71
+ bluer_objects/.abcli/tests/web_where_am_ai.sh,sha256=BJ9G_m4id8cx_UB_l_jV2xY6AfQEpG7O4IBsuVjodxk,104
72
+ bluer_objects/.abcli/web/is_accessible.sh,sha256=Luv_6IvpscRYx7f39V0RnkkNEWTRfVGyQVUeij3iqa0,262
73
+ bluer_objects/.abcli/web/where_am_i.sh,sha256=QPBXFo6Ni4pZEoOx0rtuJUxk6tOlp0ESMyAc9YPy9zg,92
69
74
  bluer_objects/README/__init__.py,sha256=JwxdTVAK3LeUaw7rMJujOFIXZA59HaLCtxpsR1C-vpo,1311
70
75
  bluer_objects/README/functions.py,sha256=IriuSysrApSTEgOZHqq32-eyks5v5Tn-KvmwYQUIloc,10752
71
76
  bluer_objects/README/items.py,sha256=-XaNCr5b_NGRkZVfIQ6hBFgJw5GIVcMJdktT3hWoam4,755
@@ -87,12 +92,13 @@ bluer_objects/help/__main__.py,sha256=Dxg-JpMOIlYWZklI_J2LyiHnRui5lUwWmfM7FLRzUX
87
92
  bluer_objects/help/clone.py,sha256=PDnQs7zc4sqmoBHPjVRfX7jIaePiohPGCNA5bxeerik,553
88
93
  bluer_objects/help/create_test_asset.py,sha256=oxJORm2qk4b_q7EC6-dEuNu1_pK9Ri60PcHhrE8ruxM,375
89
94
  bluer_objects/help/download.py,sha256=1fw3ASOXUuXcNhm8y0AK7ZBmXzWwZvdo2hK9ZVbgteA,439
90
- bluer_objects/help/functions.py,sha256=occpIuw_ywUnEiNGQiuJh_w15OEfKcmwD_NQ0wAJiNE,1009
95
+ bluer_objects/help/functions.py,sha256=ghCXmHHMVgdPDkqPHWIK7L64wb--oLYhdfJdZyboZKM,1096
91
96
  bluer_objects/help/gif.py,sha256=gKV6vNT4bEC2Ch3QIb3Yc5DqzAH_UvAVCsuvzXeF1Sc,564
92
97
  bluer_objects/help/host.py,sha256=4t4yrPGjTbnFtODcuBjfIzpA5pmmvc5s4QrjIqPPVsM,988
93
98
  bluer_objects/help/ls.py,sha256=acvRLDxjJOzQ1a9ZQ4Mn9aBZ8Vf17IDHcAxC2O3R33Y,627
94
99
  bluer_objects/help/metadata.py,sha256=fk22NasBcZU1ffY4fu6AxrCzMQtTI28p_ghaSVRrrPM,2811
95
100
  bluer_objects/help/upload.py,sha256=tXAdVhy0FZfF5b4cAEgaYlLQ8_cnQ656um8QioKMV_o,456
101
+ bluer_objects/help/web.py,sha256=YGxzU0GyoQAA8tqnEoGcC4rABFW_RnI44PhvHvIG5dA,626
96
102
  bluer_objects/help/mlflow/__init__.py,sha256=fvnGg8l24oGWKd7lbVm32GHyrE3eBlholj4RFrjFNuw,4427
97
103
  bluer_objects/help/mlflow/cache.py,sha256=O8O1oaiq1e1z2HCi8fRe4hjSNimzvCaCAIu-u2GDHkE,704
98
104
  bluer_objects/help/mlflow/lock.py,sha256=REdB4LmlHu2_6SF1nDA50KBbYtNIKRDbYH7KduUnuEg,848
@@ -157,8 +163,12 @@ bluer_objects/tests/test_storage_webdav_request.py,sha256=h2b8PeIx0-hQ2d6PmQcJZy
157
163
  bluer_objects/tests/test_storage_webdav_zip.py,sha256=C19qxhkcHyTwVFzW35vL85SOcXJPkqXXaWUNll0Uyqc,1017
158
164
  bluer_objects/tests/test_testing.py,sha256=d2NH435yqJBl9wmfMqGGd-f0Y0jsL2QhHUXkty9AwPA,235
159
165
  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,,
166
+ bluer_objects/tests/test_web_is_accessible.py,sha256=2Y20NAEDMblg0MKnhnqcfw3XVKEGakF8DlVzpW0FX5o,331
167
+ bluer_objects/web/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
168
+ bluer_objects/web/__main__.py,sha256=xf2Ob54FI8JEokfGhFmiyOBdD9nBactwqmZvsKsdioU,624
169
+ bluer_objects/web/functions.py,sha256=KNufAFOc6N3BYf83lN2rUpKUdsnzb2anWyp9koFRVUo,172
170
+ bluer_objects-6.191.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
171
+ bluer_objects-6.191.1.dist-info/METADATA,sha256=xHa7FnPzleeatx0ybdV_04CnrXmuYm0BNjphWPwpNE0,3678
172
+ bluer_objects-6.191.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
173
+ bluer_objects-6.191.1.dist-info/top_level.txt,sha256=RX2TpddbnRkurda3G_pAdyeTztP2IhhRPx949GlEvQo,14
174
+ bluer_objects-6.191.1.dist-info/RECORD,,