From 8765e0ee4e79b630e905c0ef259f503acb54b9ef Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:06:13 +0200 Subject: [PATCH 01/13] Added font-awesome-based icons matched to the best of my abilities --- pyinaturalist/constants.py | 52 +++++++++ pyinaturalist/docs/__init__.py | 1 + pyinaturalist/docs/font_awesome_icons.py | 140 +++++++++++++++++++++++ 3 files changed, 193 insertions(+) create mode 100644 pyinaturalist/docs/font_awesome_icons.py diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index 27cc1e4f..d7b1905c 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -1,4 +1,5 @@ # ruff: noqa: F401 +from dataclasses import dataclass from datetime import date, datetime, timedelta from os.path import abspath, dirname, join from pathlib import Path @@ -8,6 +9,7 @@ from platformdirs import user_data_dir from pyrate_limiter.sqlite_bucket import LOCK_PATH as DEFAULT_LOCK_PATH + # iNaturalist URLs API_V0 = 'https://www.inaturalist.org' API_V1 = 'https://api.inaturalist.org/v1' @@ -102,6 +104,56 @@ 48222: '🟢', 47686: '🦠', } + +COLORS = { + "blue": "#5778a4", + "orange": "#e49444", + "red": "#d1615d", + "teal": "#85b6b2", + "green": "#6a9f58", + "yellow": "#e7ca60", + "purple": "#a87c9f", + "pink": "#f1a2a9", + "brown": "#967662", + "grey": "#b8b0ac", + "black": "#000000", + "grey": "#777", +} + +@dataclass +class FontAwesomeIcon: + + prefix: str + name: str + color: str + size: int = 16 + + def __str__(self): + return f'' + + def __repr__(self): + return f'' + + +ICONIC_FONT_AWESOME = { + 0: FontAwesomeIcon('fa-solid', 'fa-question-circle', COLORS['grey']), + 1: FontAwesomeIcon('fa-solid', 'fa-paw', COLORS['black']), + 3: FontAwesomeIcon('fa-solid', 'fa-dove', COLORS['teal']), + 20978: FontAwesomeIcon('fa-solid', 'fa-frog', COLORS['green']), + 26036: FontAwesomeIcon('fa-solid', 'fa-lizard', COLORS['green']), + 40151: FontAwesomeIcon('fa-solid', 'fa-cat', COLORS['orange']), + 47178: FontAwesomeIcon('fa-solid', 'fa-fish', COLORS['blue']), + 47115: FontAwesomeIcon('fa-solid', 'fa-snail', COLORS['brown']), + 47119: FontAwesomeIcon('fa-solid', 'fa-spider', COLORS['black']), + 47158: FontAwesomeIcon('fa-solid', 'fa-butterfly', COLORS['purple']), + 47126: FontAwesomeIcon('fa-solid', 'fa-leaf', COLORS['green']), + 47170: FontAwesomeIcon('fa-solid', 'fa-bacteria', COLORS['brown']), # mushroom + 48222: FontAwesomeIcon('fa-solid', 'fa-bowling-ball', COLORS['green']), + 47686: FontAwesomeIcon('fa-solid', 'fa-disease', COLORS['green']), +} + +assert set(ICONIC_TAXA.keys()) == set(ICONIC_EMOJI.keys()) == set(ICONIC_FONT_AWESOME.keys()) + ROOT_TAXON_ID = 48460 # Taxonomic ranks that can be filtered on, and numeric values for comparison diff --git a/pyinaturalist/docs/__init__.py b/pyinaturalist/docs/__init__.py index 2d374970..9bd6a93a 100644 --- a/pyinaturalist/docs/__init__.py +++ b/pyinaturalist/docs/__init__.py @@ -7,6 +7,7 @@ from pyinaturalist.docs.docstrings import ApiDocstring, copy_annotations, copy_docstrings from pyinaturalist.docs.emoji import EMOJI +from pyinaturalist.docs.font_awesome_icons import EXTENDED_FONT_AWESOME_ICONS from pyinaturalist.docs.signatures import ( copy_doc_signature, copy_signatures, diff --git a/pyinaturalist/docs/font_awesome_icons.py b/pyinaturalist/docs/font_awesome_icons.py new file mode 100644 index 00000000..3a1457ba --- /dev/null +++ b/pyinaturalist/docs/font_awesome_icons.py @@ -0,0 +1,140 @@ +"""Extended list of font-awesome icons to represent taxa""" +from pyinaturalist.constants import FontAwesomeIcon + +EXTENDED_FONT_AWESOME_ICONS = { + # Birds + 3: FontAwesomeIcon('fa-solid', 'fa-dove', 'teal'), + # Pheasants, Grouse, and Allies + 574: FontAwesomeIcon('fa-solid', 'fa-feather', 'teal'), + 879: FontAwesomeIcon('fa-solid', 'fa-kiwi-bird', 'brown'), + 71261: FontAwesomeIcon('fa-solid', 'fa-crow', 'black'), + 6888: FontAwesomeIcon('fa-solid', 'fa-kiwi-bird', 'green'), + 1199: FontAwesomeIcon('fa-solid', 'fa-kiwi-bird', 'brown'), + 67569: FontAwesomeIcon('fa-solid', 'fa-kiwi-bird', 'pink'), + 2708: FontAwesomeIcon('fa-solid', 'fa-dove', 'teal'), + 6913: FontAwesomeIcon('fa-solid', 'fa-dove', 'teal'), + 67564: FontAwesomeIcon('fa-solid', 'fa-kiwi-bird', 'blue'), + 19350: FontAwesomeIcon('fa-solid', 'fa-crow', 'brown'), + 18874: FontAwesomeIcon('fa-solid', 'fa-kiwi-bird', 'green'), + # Amphibians + reptiles + 20978: FontAwesomeIcon('fa-solid', 'fa-frog', 'green'), + 26036: FontAwesomeIcon('fa-solid', 'fa-dragon', 'green'), + 26039: FontAwesomeIcon('fa-solid', 'fa-dragon', 'green'), + 39532: FontAwesomeIcon('fa-solid', 'fa-dragon', 'green'), + 85553: FontAwesomeIcon('fa-solid', 'fa-worm', 'green'), + # Mammals + 786045: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 43579: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 846280: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 47144: FontAwesomeIcon('fa-solid', 'fa-dog', 'brown'), + 42048: FontAwesomeIcon('fa-solid', 'fa-dog', 'gray'), + 42054: FontAwesomeIcon('fa-solid', 'fa-dog', 'red'), + 41660: FontAwesomeIcon('fa-solid', 'fa-dog', 'brown'), + 41944: FontAwesomeIcon('fa-solid', 'fa-cat', 'orange'), + 846273: FontAwesomeIcon('fa-solid', 'fa-cat', 'yellow'), + 43328: FontAwesomeIcon('fa-solid', 'fa-horse', 'brown'), + 42158: FontAwesomeIcon('fa-solid', 'fa-horse', 'brown'), + 42406: FontAwesomeIcon('fa-solid', 'fa-horse', 'brown'), + 568826: FontAwesomeIcon('fa-solid', 'fa-horse', 'brown'), + 848343: FontAwesomeIcon('fa-solid', 'fa-paw', 'pink'), + 568847: FontAwesomeIcon('fa-solid', 'fa-horse', 'grey'), + 42348: FontAwesomeIcon('fa-solid', 'fa-horse', 'brown'), + 846209: FontAwesomeIcon('fa-solid', 'fa-horse', 'brown'), + 925150: FontAwesomeIcon('fa-solid', 'fa-horse', 'brown'), + 43691: FontAwesomeIcon('fa-solid', 'fa-horse', 'grey'), + 43698: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 43094: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 45933: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 43791: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 533971: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 40268: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 41636: FontAwesomeIcon('fa-solid', 'fa-paw', 'brown'), + 848319: FontAwesomeIcon('fa-solid', 'fa-paw', 'brown'), + 42981: FontAwesomeIcon('fa-solid', 'fa-paw', 'grey'), + 53537: FontAwesomeIcon('fa-solid', 'fa-paw', 'brown'), + 41770: FontAwesomeIcon('fa-solid', 'fa-paw', 'grey'), + 526556: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + 41871: FontAwesomeIcon('fa-solid', 'fa-otter', 'black'), + 846287: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), + # Fish + 47178: FontAwesomeIcon('fa-solid', 'fa-fish', 'blue'), + 47233: FontAwesomeIcon('fa-solid', 'fa-fish-fins', 'blue'), + 47177: FontAwesomeIcon('fa-solid', 'fa-fish', 'blue'), + 372843: FontAwesomeIcon('fa-solid', 'fa-otter', 'blue'), + 152871: FontAwesomeIcon('fa-solid', 'fa-otter', 'blue'), + 41479: FontAwesomeIcon('fa-solid', 'fa-otter', 'blue'), + 47273: FontAwesomeIcon('fa-solid', 'fa-fish-fins', 'blue'), + # Molluscs + 47115: FontAwesomeIcon('fa-solid', 'fa-worm', 'blue'), + 47459: FontAwesomeIcon('fa-solid', 'fa-worm', 'blue'), + 127352: FontAwesomeIcon('fa-solid', 'fa-worm', 'blue'), + # Arthropods + 85493: FontAwesomeIcon('fa-solid', 'fa-shrimp', 'red'), + 144114: FontAwesomeIcon('fa-solid', 'fa-shrimp', 'red'), + 311310: FontAwesomeIcon('fa-solid', 'fa-shrimp', 'red'), + 47119: FontAwesomeIcon('fa-solid', 'fa-spider', 'black'), + 48894: FontAwesomeIcon('fa-solid', 'fa-spider', 'black'), + 172373: FontAwesomeIcon('fa-solid', 'fa-spider', 'black'), + 48900: FontAwesomeIcon('fa-solid', 'fa-spider', 'black'), + 372739: FontAwesomeIcon('fa-solid', 'fa-worm', 'green'), + 144128: FontAwesomeIcon('fa-solid', 'fa-worm', 'green'), + 47822: FontAwesomeIcon('fa-solid', 'fa-mosquito', 'brown'), + 153429: FontAwesomeIcon('fa-solid', 'fa-mosquito', 'brown'), + 81769: FontAwesomeIcon('fa-solid', 'fa-mosquito', 'brown'), + 47651: FontAwesomeIcon('fa-solid', 'fa-locust', 'green'), + 47157: FontAwesomeIcon('fa-solid', 'fa-locust', 'teal'), + 47201: FontAwesomeIcon('fa-solid', 'fa-mosquito', 'yellow'), + 47336: FontAwesomeIcon('fa-solid', 'fa-mosquito', 'yellow'), + 48511: FontAwesomeIcon('fa-solid', 'fa-bug', 'brown'), + 47208: FontAwesomeIcon('fa-solid', 'fa-bug', 'brown'), + 471714: FontAwesomeIcon('fa-solid', 'fa-bugs', 'brown'), + # Plants + 47126: FontAwesomeIcon('fa-solid', 'fa-seedling', 'green'), + 136329: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 47903: FontAwesomeIcon('fa-solid', 'fa-sun-plant-wilt', 'brown'), + 47162: FontAwesomeIcon('fa-solid', 'fa-wheat-awn', 'yellow'), + 121943: FontAwesomeIcon('fa-solid', 'fa-pagelines', 'green'), + 70233: FontAwesomeIcon('fa-solid', 'fa-seedling', 'green'), + 48866: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 544534: FontAwesomeIcon('fa-solid', 'fa-bowling-ball', 'brown'), + 47605: FontAwesomeIcon('fa-solid', 'fa-fan', 'yellow'), + 605446: FontAwesomeIcon('fa-solid', 'fa-fan', 'yellow'), + 47690: FontAwesomeIcon('fa-solid', 'fa-fan', 'pink'), + 48796: FontAwesomeIcon('fa-solid', 'fa-fan', 'pink'), + 47329: FontAwesomeIcon('fa-solid', 'fa-fan', 'pink'), + 47148: FontAwesomeIcon('fa-solid', 'fa-fan', 'red'), + 47727: FontAwesomeIcon('fa-solid', 'fa-canadian-maple-leaf', 'red'), + 53548: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 47853: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 151882: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 50998: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 47567: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 71434: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 47194: FontAwesomeIcon('fa-solid', 'fa-tree', 'green'), + 48699: FontAwesomeIcon('fa-solid', 'fa-carrot', 'orange'), + 47204: FontAwesomeIcon('fa-solid', 'fa-seedling', 'green'), + 71291: FontAwesomeIcon('fa-solid', 'fa-wine-bottle', 'red'), + 48620: FontAwesomeIcon('fa-solid', 'fa-bowling-ball', 'orange'), + 62910: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'red'), + 50623: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'red'), + 723302: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'red'), + 49570: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'yellow'), + 48874: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'green'), + 47351: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'red'), + 47733: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'green'), + 55849: FontAwesomeIcon('fa-solid', 'fa-pepper-hot', 'grey'), + 48516: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'red'), + 48517: FontAwesomeIcon('fa-solid', 'fa-pepper-hot', 'red'), + 62848: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'red'), + 635417: FontAwesomeIcon('fa-solid', 'fa-wheat-awn', 'yellow'), + 55150: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'green'), + 50299: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'red'), + 634914: FontAwesomeIcon('fa-solid', 'fa-apple-whole', 'blue'), + # Other + 1: FontAwesomeIcon('fa-solid', 'fa-paw', 'black'), + 47491: FontAwesomeIcon('fa-solid', 'fa-worm', 'pink'), + 47170: FontAwesomeIcon('fa-solid', 'fa-bacteria', 'brown'), # mushroom + 48222: FontAwesomeIcon('fa-solid', 'fa-bowling-ball', 'green'), + 67333: FontAwesomeIcon('fa-solid', 'fa-bacterium', 'green'), + 131236: FontAwesomeIcon('fa-solid', 'fa-virus', 'red'), +} \ No newline at end of file From d6d98262b5bd1f3c8af2cdd4af2792c271ee2110 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:09:23 +0200 Subject: [PATCH 02/13] Updated History --- HISTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/HISTORY.md b/HISTORY.md index b3bb8224..dce26e57 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,7 @@ * Add `validate_token()` function to manually check if an access token is valid * Support rate limits less than one request per second (example: `ClientSession(per_second=0.5)`) * Allow setting lockfile path used for multiprocess rate limiting (example: `ClientSession(lock_path='/tmp/pyinat.lock')`) +* Add support for font-awesome based icons ## 0.19.0 (2023-12-12) From 20f08af4ad954b51cb403ade71d0811e640d158e Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:11:49 +0200 Subject: [PATCH 03/13] Resolved github actions code smells --- pyinaturalist/constants.py | 2 +- pyinaturalist/docs/font_awesome_icons.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index d7b1905c..4bd501a3 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -147,7 +147,7 @@ def __repr__(self): 47119: FontAwesomeIcon('fa-solid', 'fa-spider', COLORS['black']), 47158: FontAwesomeIcon('fa-solid', 'fa-butterfly', COLORS['purple']), 47126: FontAwesomeIcon('fa-solid', 'fa-leaf', COLORS['green']), - 47170: FontAwesomeIcon('fa-solid', 'fa-bacteria', COLORS['brown']), # mushroom + 47170: FontAwesomeIcon('fa-solid', 'fa-bacteria', COLORS['brown']), # mushroom 48222: FontAwesomeIcon('fa-solid', 'fa-bowling-ball', COLORS['green']), 47686: FontAwesomeIcon('fa-solid', 'fa-disease', COLORS['green']), } diff --git a/pyinaturalist/docs/font_awesome_icons.py b/pyinaturalist/docs/font_awesome_icons.py index 3a1457ba..a4946499 100644 --- a/pyinaturalist/docs/font_awesome_icons.py +++ b/pyinaturalist/docs/font_awesome_icons.py @@ -133,8 +133,8 @@ # Other 1: FontAwesomeIcon('fa-solid', 'fa-paw', 'black'), 47491: FontAwesomeIcon('fa-solid', 'fa-worm', 'pink'), - 47170: FontAwesomeIcon('fa-solid', 'fa-bacteria', 'brown'), # mushroom + 47170: FontAwesomeIcon('fa-solid', 'fa-bacteria', 'brown'), # mushroom 48222: FontAwesomeIcon('fa-solid', 'fa-bowling-ball', 'green'), 67333: FontAwesomeIcon('fa-solid', 'fa-bacterium', 'green'), 131236: FontAwesomeIcon('fa-solid', 'fa-virus', 'red'), -} \ No newline at end of file +} From 67a9c360bb9822cc7117ddf56ef571c5adbbf437 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:12:14 +0200 Subject: [PATCH 04/13] Resolved other github action code smell --- pyinaturalist/docs/font_awesome_icons.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyinaturalist/docs/font_awesome_icons.py b/pyinaturalist/docs/font_awesome_icons.py index a4946499..474761d2 100644 --- a/pyinaturalist/docs/font_awesome_icons.py +++ b/pyinaturalist/docs/font_awesome_icons.py @@ -1,4 +1,5 @@ """Extended list of font-awesome icons to represent taxa""" + from pyinaturalist.constants import FontAwesomeIcon EXTENDED_FONT_AWESOME_ICONS = { From 84799d4c6270cfdd500059494f6b91701c613308 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:13:31 +0200 Subject: [PATCH 05/13] Resolved reaining code smells --- pyinaturalist/constants.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index 4bd501a3..1f73472f 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -106,18 +106,18 @@ } COLORS = { - "blue": "#5778a4", - "orange": "#e49444", - "red": "#d1615d", - "teal": "#85b6b2", - "green": "#6a9f58", - "yellow": "#e7ca60", - "purple": "#a87c9f", - "pink": "#f1a2a9", - "brown": "#967662", - "grey": "#b8b0ac", - "black": "#000000", - "grey": "#777", + 'blue': '#5778a4', + 'orange': '#e49444', + 'red': '#d1615d', + 'teal': '#85b6b2', + 'green': '#6a9f58', + 'yellow': '#e7ca60', + 'purple': '#a87c9f', + 'pink': '#f1a2a9', + 'brown': '#967662', + 'grey': '#b8b0ac', + 'black': '#000000', + 'grey': '#777', } @dataclass From 3e4011e6df5308e6430c7a8dd5abadcefb650c25 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:15:00 +0200 Subject: [PATCH 06/13] Fixed duplicated color --- pyinaturalist/constants.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index 1f73472f..14c7f84c 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -116,8 +116,7 @@ 'pink': '#f1a2a9', 'brown': '#967662', 'grey': '#b8b0ac', - 'black': '#000000', - 'grey': '#777', + 'black': '#000000' } @dataclass From 1dc30cb1ca9135491337b979f0f578fd41597473 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:16:38 +0200 Subject: [PATCH 07/13] Added missing comma --- pyinaturalist/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index 14c7f84c..e2b7c7f1 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -116,7 +116,7 @@ 'pink': '#f1a2a9', 'brown': '#967662', 'grey': '#b8b0ac', - 'black': '#000000' + 'black': '#000000', } @dataclass From bda8e7635cd9d45593885ba6287c8cae84faac41 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:19:31 +0200 Subject: [PATCH 08/13] Resolve line length --- pyinaturalist/constants.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index e2b7c7f1..eb979ad5 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -128,10 +128,17 @@ class FontAwesomeIcon: size: int = 16 def __str__(self): - return f'' + return ( + f'' + ) def __repr__(self): - return f'' + return ( + f'' + ) ICONIC_FONT_AWESOME = { @@ -151,7 +158,8 @@ def __repr__(self): 47686: FontAwesomeIcon('fa-solid', 'fa-disease', COLORS['green']), } -assert set(ICONIC_TAXA.keys()) == set(ICONIC_EMOJI.keys()) == set(ICONIC_FONT_AWESOME.keys()) +assert set(ICONIC_TAXA.keys()) == set(ICONIC_EMOJI.keys()) +assert set(ICONIC_TAXA.keys()) == set(ICONIC_FONT_AWESOME.keys()) ROOT_TAXON_ID = 48460 From 3e48d5010330567b3a4d41f9ac6b920cbec5958c Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:21:43 +0200 Subject: [PATCH 09/13] Fixed code smell according to github actions --- pyinaturalist/constants.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index eb979ad5..b92b0add 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -135,10 +135,7 @@ def __str__(self): ) def __repr__(self): - return ( - f'' - ) + return f'' ICONIC_FONT_AWESOME = { From 840c788df56896eb241b14977f241cc2b4a91b9d Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:23:37 +0200 Subject: [PATCH 10/13] Trying to follow github actions --- pyinaturalist/constants.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index b92b0add..3f1b490c 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -119,9 +119,9 @@ 'black': '#000000', } + @dataclass class FontAwesomeIcon: - prefix: str name: str color: str From f5a2d31e65ecd2337e54a93cb6f76193a4d46e12 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 11:37:27 +0200 Subject: [PATCH 11/13] Replaced remaning pro icons --- pyinaturalist/constants.py | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/pyinaturalist/constants.py b/pyinaturalist/constants.py index 3f1b490c..be8584e5 100644 --- a/pyinaturalist/constants.py +++ b/pyinaturalist/constants.py @@ -88,6 +88,7 @@ 48222: 'Chromista', 47686: 'Protozoa', } + ICONIC_EMOJI = { 0: '❓', 1: '🐾', @@ -139,20 +140,20 @@ def __repr__(self): ICONIC_FONT_AWESOME = { - 0: FontAwesomeIcon('fa-solid', 'fa-question-circle', COLORS['grey']), - 1: FontAwesomeIcon('fa-solid', 'fa-paw', COLORS['black']), - 3: FontAwesomeIcon('fa-solid', 'fa-dove', COLORS['teal']), - 20978: FontAwesomeIcon('fa-solid', 'fa-frog', COLORS['green']), - 26036: FontAwesomeIcon('fa-solid', 'fa-lizard', COLORS['green']), - 40151: FontAwesomeIcon('fa-solid', 'fa-cat', COLORS['orange']), - 47178: FontAwesomeIcon('fa-solid', 'fa-fish', COLORS['blue']), - 47115: FontAwesomeIcon('fa-solid', 'fa-snail', COLORS['brown']), - 47119: FontAwesomeIcon('fa-solid', 'fa-spider', COLORS['black']), - 47158: FontAwesomeIcon('fa-solid', 'fa-butterfly', COLORS['purple']), - 47126: FontAwesomeIcon('fa-solid', 'fa-leaf', COLORS['green']), - 47170: FontAwesomeIcon('fa-solid', 'fa-bacteria', COLORS['brown']), # mushroom - 48222: FontAwesomeIcon('fa-solid', 'fa-bowling-ball', COLORS['green']), - 47686: FontAwesomeIcon('fa-solid', 'fa-disease', COLORS['green']), + 0: FontAwesomeIcon('fa-solid', 'fa-question-circle', 'grey'), + 1: FontAwesomeIcon('fa-solid', 'fa-paw', 'black'), + 3: FontAwesomeIcon('fa-solid', 'fa-dove', 'teal'), + 20978: FontAwesomeIcon('fa-solid', 'fa-frog', 'green'), + 26036: FontAwesomeIcon('fa-solid', 'fa-dragon', 'green'), + 40151: FontAwesomeIcon('fa-solid', 'fa-cat', 'orange'), + 47178: FontAwesomeIcon('fa-solid', 'fa-fish', 'blue'), + 47115: FontAwesomeIcon('fa-solid', 'fa-worm', 'pink'), + 47119: FontAwesomeIcon('fa-solid', 'fa-spider', 'black'), + 47158: FontAwesomeIcon('fa-solid', 'fa-mosquito', 'purple'), + 47126: FontAwesomeIcon('fa-solid', 'fa-leaf', 'green'), + 47170: FontAwesomeIcon('fa-solid', 'fa-bacteria', 'brown'), # mushroom + 48222: FontAwesomeIcon('fa-solid', 'fa-bowling-ball', 'green'), + 47686: FontAwesomeIcon('fa-solid', 'fa-disease', 'green'), } assert set(ICONIC_TAXA.keys()) == set(ICONIC_EMOJI.keys()) From c29e513d2fa270f717981815e6aeb5731bab7dc8 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 12:17:28 +0200 Subject: [PATCH 12/13] Added zero case --- pyinaturalist/docs/font_awesome_icons.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyinaturalist/docs/font_awesome_icons.py b/pyinaturalist/docs/font_awesome_icons.py index 474761d2..1044f974 100644 --- a/pyinaturalist/docs/font_awesome_icons.py +++ b/pyinaturalist/docs/font_awesome_icons.py @@ -3,6 +3,7 @@ from pyinaturalist.constants import FontAwesomeIcon EXTENDED_FONT_AWESOME_ICONS = { + 0: FontAwesomeIcon('fa-solid', 'fa-question-circle', 'grey'), # Birds 3: FontAwesomeIcon('fa-solid', 'fa-dove', 'teal'), # Pheasants, Grouse, and Allies From 10c2df70ce23770b5d73e900c22b1e7836839e47 Mon Sep 17 00:00:00 2001 From: LucaCappelletti94 Date: Fri, 26 Apr 2024 20:35:41 +0200 Subject: [PATCH 13/13] Fixed typo --- pyinaturalist/docs/font_awesome_icons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyinaturalist/docs/font_awesome_icons.py b/pyinaturalist/docs/font_awesome_icons.py index 1044f974..8b8230e3 100644 --- a/pyinaturalist/docs/font_awesome_icons.py +++ b/pyinaturalist/docs/font_awesome_icons.py @@ -29,7 +29,7 @@ 43579: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), 846280: FontAwesomeIcon('fa-solid', 'fa-otter', 'brown'), 47144: FontAwesomeIcon('fa-solid', 'fa-dog', 'brown'), - 42048: FontAwesomeIcon('fa-solid', 'fa-dog', 'gray'), + 42048: FontAwesomeIcon('fa-solid', 'fa-dog', 'grey'), 42054: FontAwesomeIcon('fa-solid', 'fa-dog', 'red'), 41660: FontAwesomeIcon('fa-solid', 'fa-dog', 'brown'), 41944: FontAwesomeIcon('fa-solid', 'fa-cat', 'orange'),