bluer-objects 6.3.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.

Potentially problematic release.


This version of bluer-objects might be problematic. Click here for more details.

Files changed (157) hide show
  1. bluer_objects-6.3.1/LICENSE +121 -0
  2. bluer_objects-6.3.1/MANIFEST.in +1 -0
  3. bluer_objects-6.3.1/PKG-INFO +57 -0
  4. bluer_objects-6.3.1/README.md +22 -0
  5. bluer_objects-6.3.1/bluer_objects/.abcli/abcli.sh +9 -0
  6. bluer_objects-6.3.1/bluer_objects/.abcli/actions.sh +11 -0
  7. bluer_objects-6.3.1/bluer_objects/.abcli/aka.sh +3 -0
  8. bluer_objects-6.3.1/bluer_objects/.abcli/alias.sh +36 -0
  9. bluer_objects-6.3.1/bluer_objects/.abcli/blue_objects.sh +11 -0
  10. bluer_objects-6.3.1/bluer_objects/.abcli/cache.sh +5 -0
  11. bluer_objects-6.3.1/bluer_objects/.abcli/clone.sh +94 -0
  12. bluer_objects-6.3.1/bluer_objects/.abcli/download.sh +53 -0
  13. bluer_objects-6.3.1/bluer_objects/.abcli/file.sh +8 -0
  14. bluer_objects-6.3.1/bluer_objects/.abcli/gif.sh +27 -0
  15. bluer_objects-6.3.1/bluer_objects/.abcli/host.sh +29 -0
  16. bluer_objects-6.3.1/bluer_objects/.abcli/ls.sh +24 -0
  17. bluer_objects-6.3.1/bluer_objects/.abcli/metadata/get.sh +24 -0
  18. bluer_objects-6.3.1/bluer_objects/.abcli/metadata/post.sh +22 -0
  19. bluer_objects-6.3.1/bluer_objects/.abcli/metadata.sh +16 -0
  20. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/browse.sh +36 -0
  21. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/cache.sh +31 -0
  22. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/list_registered_models.sh +9 -0
  23. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/log_artifacts.sh +10 -0
  24. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/log_run.sh +10 -0
  25. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/run.sh +11 -0
  26. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/tags/clone.sh +15 -0
  27. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/tags/get.sh +10 -0
  28. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/tags/search.sh +12 -0
  29. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/tags/set.sh +13 -0
  30. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/tags.sh +16 -0
  31. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/test.sh +11 -0
  32. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow/transition.sh +20 -0
  33. bluer_objects-6.3.1/bluer_objects/.abcli/mlflow.sh +29 -0
  34. bluer_objects-6.3.1/bluer_objects/.abcli/mysql/cache.sh +65 -0
  35. bluer_objects-6.3.1/bluer_objects/.abcli/mysql/relations.sh +83 -0
  36. bluer_objects-6.3.1/bluer_objects/.abcli/mysql/tags.sh +85 -0
  37. bluer_objects-6.3.1/bluer_objects/.abcli/mysql.sh +16 -0
  38. bluer_objects-6.3.1/bluer_objects/.abcli/object.sh +54 -0
  39. bluer_objects-6.3.1/bluer_objects/.abcli/publish.sh +58 -0
  40. bluer_objects-6.3.1/bluer_objects/.abcli/select.sh +34 -0
  41. bluer_objects-6.3.1/bluer_objects/.abcli/storage/clear.sh +45 -0
  42. bluer_objects-6.3.1/bluer_objects/.abcli/storage/download_file.sh +9 -0
  43. bluer_objects-6.3.1/bluer_objects/.abcli/storage/exists.sh +8 -0
  44. bluer_objects-6.3.1/bluer_objects/.abcli/storage/list.sh +8 -0
  45. bluer_objects-6.3.1/bluer_objects/.abcli/storage/rm.sh +11 -0
  46. bluer_objects-6.3.1/bluer_objects/.abcli/storage/status.sh +11 -0
  47. bluer_objects-6.3.1/bluer_objects/.abcli/storage.sh +15 -0
  48. bluer_objects-6.3.1/bluer_objects/.abcli/tags.sh +5 -0
  49. bluer_objects-6.3.1/bluer_objects/.abcli/tests/README.sh +8 -0
  50. bluer_objects-6.3.1/bluer_objects/.abcli/tests/clone.sh +32 -0
  51. bluer_objects-6.3.1/bluer_objects/.abcli/tests/help.sh +85 -0
  52. bluer_objects-6.3.1/bluer_objects/.abcli/tests/host.sh +7 -0
  53. bluer_objects-6.3.1/bluer_objects/.abcli/tests/ls.sh +13 -0
  54. bluer_objects-6.3.1/bluer_objects/.abcli/tests/metadata.sh +53 -0
  55. bluer_objects-6.3.1/bluer_objects/.abcli/tests/mlflow_cache.sh +14 -0
  56. bluer_objects-6.3.1/bluer_objects/.abcli/tests/mlflow_logging.sh +12 -0
  57. bluer_objects-6.3.1/bluer_objects/.abcli/tests/mlflow_tags.sh +29 -0
  58. bluer_objects-6.3.1/bluer_objects/.abcli/tests/mlflow_test.sh +7 -0
  59. bluer_objects-6.3.1/bluer_objects/.abcli/tests/mysql_cache.sh +15 -0
  60. bluer_objects-6.3.1/bluer_objects/.abcli/tests/mysql_relations.sh +20 -0
  61. bluer_objects-6.3.1/bluer_objects/.abcli/tests/mysql_tags.sh +16 -0
  62. bluer_objects-6.3.1/bluer_objects/.abcli/tests/test_gif.sh +13 -0
  63. bluer_objects-6.3.1/bluer_objects/.abcli/tests/version.sh +10 -0
  64. bluer_objects-6.3.1/bluer_objects/.abcli/upload.sh +73 -0
  65. bluer_objects-6.3.1/bluer_objects/README/__init__.py +29 -0
  66. bluer_objects-6.3.1/bluer_objects/README/functions.py +285 -0
  67. bluer_objects-6.3.1/bluer_objects/README/items.py +30 -0
  68. bluer_objects-6.3.1/bluer_objects/__init__.py +19 -0
  69. bluer_objects-6.3.1/bluer_objects/__main__.py +16 -0
  70. bluer_objects-6.3.1/bluer_objects/config.env +22 -0
  71. bluer_objects-6.3.1/bluer_objects/env.py +72 -0
  72. bluer_objects-6.3.1/bluer_objects/file/__init__.py +41 -0
  73. bluer_objects-6.3.1/bluer_objects/file/__main__.py +51 -0
  74. bluer_objects-6.3.1/bluer_objects/file/classes.py +38 -0
  75. bluer_objects-6.3.1/bluer_objects/file/functions.py +290 -0
  76. bluer_objects-6.3.1/bluer_objects/file/load.py +219 -0
  77. bluer_objects-6.3.1/bluer_objects/file/save.py +280 -0
  78. bluer_objects-6.3.1/bluer_objects/graphics/__init__.py +4 -0
  79. bluer_objects-6.3.1/bluer_objects/graphics/__main__.py +84 -0
  80. bluer_objects-6.3.1/bluer_objects/graphics/frame.py +15 -0
  81. bluer_objects-6.3.1/bluer_objects/graphics/gif.py +86 -0
  82. bluer_objects-6.3.1/bluer_objects/graphics/screen.py +63 -0
  83. bluer_objects-6.3.1/bluer_objects/graphics/signature.py +97 -0
  84. bluer_objects-6.3.1/bluer_objects/graphics/text.py +165 -0
  85. bluer_objects-6.3.1/bluer_objects/help/__init__.py +0 -0
  86. bluer_objects-6.3.1/bluer_objects/help/__main__.py +10 -0
  87. bluer_objects-6.3.1/bluer_objects/help/functions.py +5 -0
  88. bluer_objects-6.3.1/bluer_objects/host/__init__.py +1 -0
  89. bluer_objects-6.3.1/bluer_objects/host/__main__.py +84 -0
  90. bluer_objects-6.3.1/bluer_objects/host/functions.py +66 -0
  91. bluer_objects-6.3.1/bluer_objects/logger/__init__.py +4 -0
  92. bluer_objects-6.3.1/bluer_objects/logger/matrix.py +209 -0
  93. bluer_objects-6.3.1/bluer_objects/markdown.py +43 -0
  94. bluer_objects-6.3.1/bluer_objects/metadata/__init__.py +8 -0
  95. bluer_objects-6.3.1/bluer_objects/metadata/__main__.py +110 -0
  96. bluer_objects-6.3.1/bluer_objects/metadata/enums.py +29 -0
  97. bluer_objects-6.3.1/bluer_objects/metadata/get.py +89 -0
  98. bluer_objects-6.3.1/bluer_objects/metadata/post.py +101 -0
  99. bluer_objects-6.3.1/bluer_objects/mlflow/__init__.py +28 -0
  100. bluer_objects-6.3.1/bluer_objects/mlflow/__main__.py +271 -0
  101. bluer_objects-6.3.1/bluer_objects/mlflow/cache.py +13 -0
  102. bluer_objects-6.3.1/bluer_objects/mlflow/logging.py +81 -0
  103. bluer_objects-6.3.1/bluer_objects/mlflow/models.py +57 -0
  104. bluer_objects-6.3.1/bluer_objects/mlflow/objects.py +76 -0
  105. bluer_objects-6.3.1/bluer_objects/mlflow/runs.py +100 -0
  106. bluer_objects-6.3.1/bluer_objects/mlflow/tags.py +90 -0
  107. bluer_objects-6.3.1/bluer_objects/mlflow/testing.py +39 -0
  108. bluer_objects-6.3.1/bluer_objects/mysql/cache/__init__.py +8 -0
  109. bluer_objects-6.3.1/bluer_objects/mysql/cache/__main__.py +91 -0
  110. bluer_objects-6.3.1/bluer_objects/mysql/cache/functions.py +181 -0
  111. bluer_objects-6.3.1/bluer_objects/mysql/relations/__init__.py +9 -0
  112. bluer_objects-6.3.1/bluer_objects/mysql/relations/__main__.py +138 -0
  113. bluer_objects-6.3.1/bluer_objects/mysql/relations/functions.py +180 -0
  114. bluer_objects-6.3.1/bluer_objects/mysql/table.py +144 -0
  115. bluer_objects-6.3.1/bluer_objects/mysql/tags/__init__.py +1 -0
  116. bluer_objects-6.3.1/bluer_objects/mysql/tags/__main__.py +130 -0
  117. bluer_objects-6.3.1/bluer_objects/mysql/tags/functions.py +203 -0
  118. bluer_objects-6.3.1/bluer_objects/objects.py +167 -0
  119. bluer_objects-6.3.1/bluer_objects/path.py +194 -0
  120. bluer_objects-6.3.1/bluer_objects/sample.env +16 -0
  121. bluer_objects-6.3.1/bluer_objects/storage/__init__.py +3 -0
  122. bluer_objects-6.3.1/bluer_objects/storage/__main__.py +114 -0
  123. bluer_objects-6.3.1/bluer_objects/storage/classes.py +237 -0
  124. bluer_objects-6.3.1/bluer_objects/tests/__init__.py +0 -0
  125. bluer_objects-6.3.1/bluer_objects/tests/test_README.py +5 -0
  126. bluer_objects-6.3.1/bluer_objects/tests/test_env.py +27 -0
  127. bluer_objects-6.3.1/bluer_objects/tests/test_file_load_save.py +105 -0
  128. bluer_objects-6.3.1/bluer_objects/tests/test_fullname.py +5 -0
  129. bluer_objects-6.3.1/bluer_objects/tests/test_graphics.py +28 -0
  130. bluer_objects-6.3.1/bluer_objects/tests/test_graphics_frame.py +11 -0
  131. bluer_objects-6.3.1/bluer_objects/tests/test_graphics_gif.py +29 -0
  132. bluer_objects-6.3.1/bluer_objects/tests/test_graphics_screen.py +8 -0
  133. bluer_objects-6.3.1/bluer_objects/tests/test_graphics_signature.py +80 -0
  134. bluer_objects-6.3.1/bluer_objects/tests/test_graphics_text.py +14 -0
  135. bluer_objects-6.3.1/bluer_objects/tests/test_logger.py +5 -0
  136. bluer_objects-6.3.1/bluer_objects/tests/test_logger_matrix.py +73 -0
  137. bluer_objects-6.3.1/bluer_objects/tests/test_markdown.py +10 -0
  138. bluer_objects-6.3.1/bluer_objects/tests/test_metadata.py +204 -0
  139. bluer_objects-6.3.1/bluer_objects/tests/test_mlflow.py +60 -0
  140. bluer_objects-6.3.1/bluer_objects/tests/test_mysql_cache.py +14 -0
  141. bluer_objects-6.3.1/bluer_objects/tests/test_mysql_relations.py +16 -0
  142. bluer_objects-6.3.1/bluer_objects/tests/test_mysql_table.py +9 -0
  143. bluer_objects-6.3.1/bluer_objects/tests/test_mysql_tags.py +13 -0
  144. bluer_objects-6.3.1/bluer_objects/tests/test_objects.py +180 -0
  145. bluer_objects-6.3.1/bluer_objects/tests/test_path.py +7 -0
  146. bluer_objects-6.3.1/bluer_objects/tests/test_storage.py +7 -0
  147. bluer_objects-6.3.1/bluer_objects/tests/test_version.py +5 -0
  148. bluer_objects-6.3.1/bluer_objects/urls.py +3 -0
  149. bluer_objects-6.3.1/bluer_objects.egg-info/PKG-INFO +57 -0
  150. bluer_objects-6.3.1/bluer_objects.egg-info/SOURCES.txt +155 -0
  151. bluer_objects-6.3.1/bluer_objects.egg-info/dependency_links.txt +1 -0
  152. bluer_objects-6.3.1/bluer_objects.egg-info/requires.txt +8 -0
  153. bluer_objects-6.3.1/bluer_objects.egg-info/top_level.txt +1 -0
  154. bluer_objects-6.3.1/pyproject.toml +6 -0
  155. bluer_objects-6.3.1/requirements.txt +6 -0
  156. bluer_objects-6.3.1/setup.cfg +4 -0
  157. bluer_objects-6.3.1/setup.py +38 -0
@@ -0,0 +1,121 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
@@ -0,0 +1 @@
1
+ include requirements.txt
@@ -0,0 +1,57 @@
1
+ Metadata-Version: 2.4
2
+ Name: bluer_objects
3
+ Version: 6.3.1
4
+ Summary: 🌀 data objects for Bash.
5
+ Home-page: https://github.com/kamangir/bluer-objects
6
+ Author: Arash Abadpour (Kamangir)
7
+ Author-email: arash@kamangir.net
8
+ License: Public Domain
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Programming Language :: Unix Shell
11
+ Classifier: License :: Public Domain
12
+ Classifier: Operating System :: OS Independent
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: abcli
16
+ Requires-Dist: dill
17
+ Requires-Dist: mlflow
18
+ Requires-Dist: pandas
19
+ Requires-Dist: urllib3
20
+ Provides-Extra: opencv
21
+ Requires-Dist: opencv-python; extra == "opencv"
22
+ Dynamic: author
23
+ Dynamic: author-email
24
+ Dynamic: classifier
25
+ Dynamic: description
26
+ Dynamic: description-content-type
27
+ Dynamic: home-page
28
+ Dynamic: license
29
+ Dynamic: license-file
30
+ Dynamic: provides-extra
31
+ Dynamic: requires-dist
32
+ Dynamic: summary
33
+
34
+ # 🌀 bluer-objects
35
+
36
+ 🌀 `bluer-objects` are the inputs and outputs of [AI algo](https://github.com/kamangir/giza). They are maintained in cloud storage and their metadata is tracked by [MLflow](https://mlflow.org/).
37
+
38
+ For example, the Sentinel-2 [datacube](https://github.com/kamangir/blue-geo/tree/main/blue_geo/datacube) `datacube-EarthSearch-sentinel_2_l1c-S2A_10UDC_20240731_0_L1C` and 🌐 [`@geo watch` outputs](https://github.com/kamangir/blue-geo/tree/main/blue_geo/watch) are `bluer-objects`.
39
+
40
+ ```bash
41
+ pip install bluer-objects
42
+ ```
43
+
44
+ Also home to [blue README](https://github.com/kamangir/bluer-objects/blob/main/bluer_objects/README/).
45
+
46
+ ---
47
+
48
+ > 🌀 [`blue-objects`](https://github.com/kamangir/blue-objects) for the [Global South](https://github.com/kamangir/blue-south).
49
+
50
+ ---
51
+
52
+
53
+ [![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)
54
+
55
+ built by 🌀 [`blue_options-4.240.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`bluer_objects-6.3.1`](https://github.com/kamangir/bluer-objects).
56
+
57
+ built by 🌀 [`blueness-3.96.1`](https://github.com/kamangir/blueness).
@@ -0,0 +1,22 @@
1
+ # 🌀 bluer-objects
2
+
3
+ 🌀 `bluer-objects` are the inputs and outputs of [AI algo](https://github.com/kamangir/giza). They are maintained in cloud storage and their metadata is tracked by [MLflow](https://mlflow.org/).
4
+
5
+ For example, the Sentinel-2 [datacube](https://github.com/kamangir/blue-geo/tree/main/blue_geo/datacube) `datacube-EarthSearch-sentinel_2_l1c-S2A_10UDC_20240731_0_L1C` and 🌐 [`@geo watch` outputs](https://github.com/kamangir/blue-geo/tree/main/blue_geo/watch) are `bluer-objects`.
6
+
7
+ ```bash
8
+ pip install bluer-objects
9
+ ```
10
+
11
+ Also home to [blue README](./bluer_objects/README/).
12
+
13
+ ---
14
+
15
+ > 🌀 [`blue-objects`](https://github.com/kamangir/blue-objects) for the [Global South](https://github.com/kamangir/blue-south).
16
+
17
+ ---
18
+
19
+
20
+ [![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)
21
+
22
+ built by 🌀 [`blue_options-4.240.1`](https://github.com/kamangir/awesome-bash-cli), based on 🌀 [`bluer_objects-6.3.1`](https://github.com/kamangir/bluer-objects).
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env bash
2
+
3
+ abcli_source_caller_suffix_path /tests
4
+
5
+ abcli_env_dot_load \
6
+ caller,ssm,plugin=bluer_objects,suffix=/../..
7
+
8
+ abcli_env_dot_load \
9
+ caller,filename=config.env,suffix=/..
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_action_git_before_push() {
4
+ bluer_objects build_README
5
+ [[ $? -ne 0 ]] && return 1
6
+
7
+ [[ "$(abcli_git get_branch)" != "main" ]] &&
8
+ return 0
9
+
10
+ bluer_objects pypi build
11
+ }
@@ -0,0 +1,3 @@
1
+ #! /usr/bin/env bash
2
+
3
+
@@ -0,0 +1,36 @@
1
+ #! /usr/bin/env bash
2
+
3
+ alias @download=abcli_download
4
+
5
+ alias @gif=abcli_gif
6
+
7
+ alias @assets=abcli_assets
8
+
9
+ alias @cache=abcli_cache
10
+ alias @ref="abcli_cache read"
11
+ alias @tags=abcli_tags
12
+
13
+ alias @clone=abcli_clone
14
+ alias @cp=abcli_clone
15
+
16
+ alias @file=bluer_objects_file
17
+
18
+ alias @host=abcli_host
19
+
20
+ alias @ls=abcli_ls
21
+
22
+ alias @metadata=abcli_metadata
23
+
24
+ alias @mlflow=abcli_mlflow
25
+
26
+ alias @mysql=abcli_mysql
27
+
28
+ alias @object=abcli_object
29
+
30
+ alias @objects=bluer_objects
31
+
32
+ alias @publish=abcli_publish
33
+
34
+ alias @select=abcli_select
35
+
36
+ alias @upload=abcli_upload
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects() {
4
+ local task=$(abcli_unpack_keyword $1 help)
5
+
6
+ abcli_generic_task \
7
+ plugin=bluer_objects,task=$task \
8
+ "${@:2}"
9
+ }
10
+
11
+ abcli_log $(bluer_objects version --show_icon 1)
@@ -0,0 +1,5 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_cache() {
4
+ abcli_mlflow_cache "$@"
5
+ }
@@ -0,0 +1,94 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_clone() {
4
+ local options=$1
5
+ local do_relate=$(abcli_option_int "$options" relate 1)
6
+ local do_upload=$(abcli_option_int "$options" upload 0)
7
+
8
+ local from_s3=$(abcli_option_int "$options" s3 0)
9
+ if [[ "$from_s3" == 1 ]]; then
10
+ local s3_uri=${2:-void}
11
+
12
+ local object_name=$(abcli_clarify_object $3 .)
13
+ local object_path=$ABCLI_OBJECT_ROOT/$object_name
14
+ mkdir -pv $object_path
15
+
16
+ abcli_log "$s3_uri -clone-> $object_name"
17
+
18
+ aws s3 sync \
19
+ "$s3_uri" \
20
+ "$object_path" \
21
+ --exact-timestamps
22
+ [[ $? -ne 0 ]] && return 1
23
+
24
+ [[ "$do_relate" == 1 ]] &&
25
+ abcli_tags set \
26
+ $object_name \
27
+ cloned.$s3_uri
28
+
29
+ [[ "$do_upload" == 1 ]] &&
30
+ abcli_upload - $object_name
31
+
32
+ return 0
33
+ fi
34
+
35
+ local clone_tags=$(abcli_option_int "$options" tags 1)
36
+ local copy_content=$(abcli_option_int "$options" content 1)
37
+ local do_download=$(abcli_option_int "$options" download 1)
38
+ local transfer_mechanism=$(abcli_option_choice "$options" cp,mv mv)
39
+
40
+ local object_1_name=$(abcli_clarify_object $2 ..)
41
+ local object_2_name=$(abcli_clarify_object $3 .)
42
+
43
+ abcli_log "$object_1_name -clone:$transfer_mechanism-> $object_2_name"
44
+
45
+ [[ "$do_download" == 1 ]] &&
46
+ abcli_download - $object_1_name
47
+
48
+ local object_1_path=$ABCLI_OBJECT_ROOT/$object_1_name
49
+ local object_2_path=$ABCLI_OBJECT_ROOT/$object_2_name
50
+
51
+ if [[ "$copy_content" == 1 ]]; then
52
+ abcli_eval - \
53
+ rsync \
54
+ -avv \
55
+ $object_1_path/ \
56
+ $object_2_path
57
+ else
58
+ local extension
59
+ for extension in qgz; do
60
+ cp -v \
61
+ $object_1_path/*.$extension \
62
+ $object_2_path
63
+ done
64
+ fi
65
+
66
+ [[ "$clone_tags" == 1 ]] &&
67
+ abcli_tags clone \
68
+ $object_1_name \
69
+ $object_2_name
70
+
71
+ [[ "$do_relate" == 1 ]] &&
72
+ abcli_tags set \
73
+ $object_2_name \
74
+ cloned.$object_1_name
75
+
76
+ pushd $object_2_path >/dev/null
77
+ local filename
78
+ for filename in $object_1_name.*; do
79
+ $transfer_mechanism -v \
80
+ $filename \
81
+ $object_2_path/$object_2_name.${filename##*.}
82
+ done
83
+ popd >/dev/null
84
+
85
+ [[ -f "$object_1_path/metadata.yaml" ]] &&
86
+ cp -v \
87
+ $object_1_path/metadata.yaml \
88
+ $object_2_path/metadata-$object_1_name.yaml
89
+
90
+ [[ "$do_upload" == 1 ]] &&
91
+ abcli_upload - $object_2_name
92
+
93
+ return 0
94
+ }
@@ -0,0 +1,53 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_download() {
4
+ local options=$1
5
+ local filename=$(abcli_option "$options" filename)
6
+
7
+ local object_name=$(abcli_clarify_object $2 .)
8
+ local object_path=$ABCLI_OBJECT_ROOT/$object_name
9
+
10
+ local open_options=$3
11
+
12
+ if [ -f "../$object_name.tar.gz" ]; then
13
+ abcli_log "✅ $object_name.tar.gz already exists - skipping download."
14
+ return 1
15
+ fi
16
+
17
+ if [ ! -z "$filename" ]; then
18
+ abcli_log "downloading $object_name/$filename ..."
19
+ aws s3 cp "$ABCLI_S3_OBJECT_PREFIX/$object_name/$filename" "$object_path/$filename"
20
+ else
21
+ local exists=$(aws s3 ls $ABCLI_AWS_S3_BUCKET_NAME/$ABCLI_AWS_S3_PREFIX/$object_name.tar.gz)
22
+ if [ -z "$exists" ]; then
23
+ abcli_log "downloading $object_name ..."
24
+
25
+ aws s3 sync \
26
+ "$ABCLI_S3_OBJECT_PREFIX/$object_name" \
27
+ "$object_path" \
28
+ --exact-timestamps
29
+ else
30
+ abcli_log "downloading $object_name.tar.gz ..."
31
+
32
+ pushd $ABCLI_OBJECT_ROOT >/dev/null
33
+
34
+ aws s3 cp \
35
+ "$ABCLI_S3_OBJECT_PREFIX/$object_name.tar.gz" .
36
+
37
+ local object_size=$(bluer_objects_file size $object_name.tar.gz)
38
+ abcli_log "$object_name.tar.gz ($object_size) downloaded."
39
+
40
+ tar -xvf "$object_name.tar.gz"
41
+
42
+ popd >/dev/null
43
+ fi
44
+
45
+ fi
46
+
47
+ local do_open=$(abcli_option_int "$open_options" open 0)
48
+ [[ "$do_open" == 1 ]] &&
49
+ abcli_open filename=$filename,$open_options \
50
+ $object_name
51
+
52
+ return 0
53
+ }
@@ -0,0 +1,8 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_file() {
4
+ python3 -m bluer_objects.file \
5
+ "$1" \
6
+ --filename "$2" \
7
+ "${@:3}"
8
+ }
@@ -0,0 +1,27 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_gif() {
4
+ local options=$1
5
+ local do_dryrun=$(abcli_option_int "$options" dryrun 0)
6
+ local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
7
+ local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
8
+
9
+ local object_name=$(abcli_clarify_object $2 .)
10
+
11
+ [[ "$do_download" == 1 ]] &&
12
+ abcli_download - $object_name
13
+
14
+ abcli_log "generating animated gif: $object_name ..."
15
+
16
+ abcli_eval dryrun=$do_dryrun \
17
+ python3 -m bluer_objects.graphics \
18
+ generate_animated_gif \
19
+ --object_name $object_name \
20
+ "${@:3}"
21
+ local status="$?"
22
+
23
+ [[ "$do_upload" == 1 ]] &&
24
+ abcli_upload - $object_name
25
+
26
+ return $status
27
+ }
@@ -0,0 +1,29 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_host() {
4
+ local task=$(abcli_unpack_keyword $1 void)
5
+ local options=$2
6
+
7
+ if [ $task == "get" ]; then
8
+ python3 -m blue_options.host \
9
+ get \
10
+ --keyword "$2" \
11
+ "${@:3}"
12
+ return
13
+ fi
14
+
15
+ if [ $task == "reboot" ]; then
16
+ abcli_eval ,$options \
17
+ sudo reboot
18
+ return
19
+ fi
20
+
21
+ if [ $task == "shutdown" ]; then
22
+ abcli_eval ,$options \
23
+ sudo shutdown -h now
24
+ return
25
+ fi
26
+
27
+ abcli_log_error "@host: $task: command not found."
28
+ return 1
29
+ }
@@ -0,0 +1,24 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_ls() {
4
+ local options=$1
5
+ local on_cloud=$(abcli_option_int "$options" cloud 0)
6
+ local on_local=$(abcli_option_int "$options" local 0)
7
+
8
+ [[ "$on_cloud" == 1 ]] ||
9
+ [[ "$on_local" == 1 ]] &&
10
+ local object_name=$(abcli_clarify_object $2 .)
11
+
12
+ if [ "$on_cloud" == 1 ]; then
13
+ abcli_eval - \
14
+ aws s3 ls $ABCLI_S3_OBJECT_PREFIX/$object_name/
15
+ elif [ "$on_local" == 1 ]; then
16
+ abcli_eval - \
17
+ ls -1lh $ABCLI_OBJECT_ROOT/$object_name
18
+ else
19
+ abcli_eval - \
20
+ ls -1 "$@"
21
+ fi
22
+
23
+ return 0
24
+ }
@@ -0,0 +1,24 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_metadata_get() {
4
+ local options=$1
5
+ local source_type=$(abcli_option_choice "$options" object,path,filename object)
6
+
7
+ local source=$2
8
+ [[ "$source_type" == object ]] &&
9
+ source=$(abcli_clarify_object $2 .)
10
+
11
+ local key=$(abcli_option "$options" key)
12
+ local default=$(abcli_option "$options" default)
13
+
14
+ python3 -m bluer_objects.metadata get \
15
+ --default "$default" \
16
+ --delim $(abcli_option "$options" delim ,) \
17
+ --dict_keys $(abcli_option_int "$options" dict.keys 0) \
18
+ --dict_values $(abcli_option_int "$options" dict.values 0) \
19
+ --filename $(abcli_option "$options" filename metadata.yaml) \
20
+ --key "$key" \
21
+ --source "$source" \
22
+ --source_type $source_type \
23
+ "${@:3}"
24
+ }
@@ -0,0 +1,22 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_metadata_post() {
4
+ local key=$1
5
+
6
+ local value=$2
7
+
8
+ local options=$3
9
+ local source_type=$(abcli_option_choice "$options" object,path,filename object)
10
+
11
+ local source=$4
12
+ [[ "$source_type" == object ]] &&
13
+ source=$(abcli_clarify_object $4 .)
14
+
15
+ python3 -m bluer_objects.metadata post \
16
+ --filename $(abcli_option "$options" filename metadata.yaml) \
17
+ --key "$key" \
18
+ --value "$value" \
19
+ --source "$source" \
20
+ --source_type $source_type \
21
+ "${@:5}"
22
+ }
@@ -0,0 +1,16 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_metadata() {
4
+ local task=${1:-help}
5
+
6
+ local function_name="abcli_metadata_$task"
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ abcli_log_error "@metadata: $task: command not found."
13
+ return 1
14
+ }
15
+
16
+ abcli_source_caller_suffix_path /metadata
@@ -0,0 +1,36 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_mlflow_browse() {
4
+ local options=$1
5
+ local browse_experiment=$(abcli_option_int "$options" experiment 0)
6
+
7
+ local url=$DATABRICKS_HOST/$ABCLI_MLFLOW_URL_SUBDOMAIN
8
+
9
+ if [ $(abcli_option_int "$options" databricks 0) == 1 ]; then
10
+ url="https://accounts.cloud.databricks.com/"
11
+ elif [ $(abcli_option_int "$options" host 0) == 1 ]; then
12
+ : # do nothing
13
+ elif [ $(abcli_option_int "$options" models 0) == 1 ]; then
14
+ url="$url/models"
15
+ else
16
+ local object_name=$(abcli_clarify_object $2 .)
17
+
18
+ local experiment_id=$(abcli_mlflow get_id $object_name)
19
+ if [ -z "$experiment_id" ]; then
20
+ abcli_log_error "@mlflow: browse: $object_name: object not found."
21
+ return 1
22
+ fi
23
+ abcli_log "experiment id: $experiment_id"
24
+
25
+ url="$url/experiments/$experiment_id"
26
+
27
+ if [[ "$browse_experiment" == 0 ]]; then
28
+ local last_run_id=$(abcli_mlflow get_run_id $object_name --count 1)
29
+ abcli_log "last run id: $last_run_id"
30
+
31
+ url="$url/runs/$last_run_id"
32
+ fi
33
+ fi
34
+
35
+ abcli_browse $url
36
+ }
@@ -0,0 +1,31 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function abcli_mlflow_cache() {
4
+ local task=$(abcli_unpack_keyword $1 help)
5
+
6
+ local keyword=$2
7
+
8
+ if [ "$task" == "read" ]; then
9
+
10
+ abcli_mlflow_tags get \
11
+ $keyword \
12
+ --tag referent \
13
+ "${@:3}"
14
+
15
+ return
16
+ fi
17
+
18
+ if [ "$task" == "write" ]; then
19
+ local value=$3
20
+
21
+ abcli_mlflow_tags set \
22
+ $keyword \
23
+ referent=$value \
24
+ "${@:4}"
25
+
26
+ return
27
+ fi
28
+
29
+ abcli_log_error "@mlflow: cache: $task: command not found."
30
+ return 1
31
+ }