generated from kamangir/blue-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blue_geo-4.122.1 build - kamangir/bolt#746
- Loading branch information
Showing
5 changed files
with
128 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import os | ||
import abcli | ||
from abcli import file | ||
from abcli.file.functions import build_from_template | ||
from abcli.plugins import markdown | ||
from blue_geo import NAME, VERSION, ICON | ||
from blue_geo.logger import logger | ||
|
||
features = { | ||
"QGIS": { | ||
"description": "an AI terraform for [QGIS](https://www.qgis.org/).", | ||
"icon": "🌐", | ||
"thumbnail": "https://raw.githubusercontent.com/kamangir/assets/main/blue-geo/QGIS.jpg", | ||
"url": "https://github.com/kamangir/blue-geo/blob/main/blue_geo/.abcli/QGIS/README.md", | ||
}, | ||
"datacube": { | ||
"description": "a datacube for geospatial AI", | ||
"icon": "🧊", | ||
"thumbnail": "https://github.com/kamangir/assets/blob/main/blue-geo/datacube.png?raw=true", | ||
"url": "https://github.com/kamangir/blue-geo/tree/main/blue_geo/.abcli/datacube", | ||
}, | ||
"firms-area": { | ||
"description": "Fire Information for Resource Management System ([FIRMS](https://firms.modaps.eosdis.nasa.gov)) datacubes.", | ||
"icon": "🌐", | ||
"thumbnail": "https://raw.githubusercontent.com/kamangir/assets/main/blue-geo/datacube-firms_area.jpg", | ||
"url": "https://github.com/kamangir/blue-geo/blob/main/blue_geo/.abcli/datacube/firms/README.md", | ||
}, | ||
"ukraine-timemap": { | ||
"description": "`ingest` for the [Bellingcat](https://www.bellingcat.com/) [Civilian Harm in Ukraine TimeMap](https://github.com/bellingcat/ukraine-timemap) dataset, available through [this UI](https://ukraine.bellingcat.com/) and [this API](https://bellingcat-embeds.ams3.cdn.digitaloceanspaces.com/production/ukr/timemap/api.json).", | ||
"icon": "🇺🇦", | ||
"thumbnail": "https://github.com/kamangir/assets/blob/main/nbs/ukraine-timemap/QGIS.png?raw=true", | ||
"url": "https://github.com/kamangir/blue-geo/blob/main/blue_geo/.abcli/ukraine-timemap/README.md", | ||
}, | ||
"vancouver-watching": { | ||
"description": "🌈 Vancouver watching with AI, last build: [🔗](https://kamangir-public.s3.ca-central-1.amazonaws.com/test_vancouver_watching_ingest/animation.gif).", | ||
"icon": "🌈", | ||
"thumbnail": "https://kamangir-public.s3.ca-central-1.amazonaws.com/test_vancouver_watching_ingest/animation.gif?raw=true", | ||
"url": "https://github.com/kamangir/Vancouver-Watching", | ||
}, | ||
"template": { | ||
"description": "", | ||
"icon": "", | ||
"thumbnail": "", | ||
"url": "", | ||
}, | ||
} | ||
|
||
|
||
def build(filename: str = ""): | ||
if not filename: | ||
filename = os.path.join(file.path(__file__), "../README.md") | ||
|
||
logger.info(f"{NAME}.build: {filename}") | ||
|
||
items = [ | ||
"{}[`{}`]({}) [![image]({})]({}) {}".format( | ||
details["icon"], | ||
feature, | ||
details["url"], | ||
details["thumbnail"], | ||
details["url"], | ||
details["description"], | ||
) | ||
for feature, details in features.items() | ||
if feature != "template" | ||
] | ||
|
||
table = markdown.generate_table(items) | ||
|
||
signature = [ | ||
"---", | ||
"built by [`{}`]({}), based on [`{}-{}`]({}).".format( | ||
abcli.fullname(), | ||
"https://github.com/kamangir/awesome-bash-cli", | ||
NAME, | ||
VERSION, | ||
"https://github.com/kamangir/blue_plugin", | ||
), | ||
] | ||
|
||
return file.build_from_template( | ||
os.path.join(file.path(__file__), "./assets/README.md"), | ||
{ | ||
"--table--": table, | ||
"--signature": signature, | ||
}, | ||
filename, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
from blue_geo import NAME, VERSION, DESCRIPTION, ICON | ||
from blue_geo.logger import logger | ||
from blue_geo import README | ||
from blueness.argparse.generic import main | ||
|
||
success, message = main(__file__, NAME, VERSION, DESCRIPTION, ICON) | ||
success, message = main( | ||
__file__, | ||
NAME, | ||
VERSION, | ||
DESCRIPTION, | ||
ICON, | ||
{ | ||
"build_README": lambda _: README.build(), | ||
}, | ||
) | ||
if not success: | ||
logger.error(message) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 🌐 Blue-GEO | ||
|
||
AI for precise geospatial data analysis and visualization. | ||
|
||
```bash | ||
pip install blue-geo | ||
``` | ||
|
||
--table-- | ||
|
||
--- | ||
|
||
[![PyPI version](https://img.shields.io/pypi/v/blue-geo.svg)](https://pypi.org/project/blue-geo/) | ||
|
||
📜 [metadata](./metadata.yaml) | ||
|
||
--- | ||
|
||
To use on [AWS SageMaker](https://aws.amazon.com/sagemaker/) replace `<plugin-name>` with the name of the plugin and follow [these instructions](https://github.com/kamangir/notebooks-and-scripts/blob/main/SageMaker.md). | ||
|
||
--signature-- |