From 04665a155d8041df174d628d5affa6366a9cf18a Mon Sep 17 00:00:00 2001 From: Talley Lambert Date: Thu, 28 Sep 2023 21:35:56 -0400 Subject: [PATCH] update readme --- .copier-answers.yml | 18 --------------- README.md | 49 +++++++++++++++++++++++++++++++++++++++- example.py | 13 ----------- src/pyconify/__init__.py | 1 + src/pyconify/py.typed | 5 ---- src/pyconify/qt.py | 24 -------------------- 6 files changed, 49 insertions(+), 61 deletions(-) delete mode 100644 .copier-answers.yml delete mode 100644 example.py delete mode 100644 src/pyconify/qt.py diff --git a/.copier-answers.yml b/.copier-answers.yml deleted file mode 100644 index 78b649b..0000000 --- a/.copier-answers.yml +++ /dev/null @@ -1,18 +0,0 @@ -# Do not edit - changes here will be overwritten by Copier -_commit: v1.0 -_src_path: gh:pydev-guide/pyrepo-copier -author_email: talley.lambert@gmail.com -author_name: Talley Lambert -git_versioning: true -github_username: tlambert03 -mode: tooling -module_name: pyconify -project_license: BSD-3-Clause -project_name: pyconify -project_short_description: iconify for python. Universal icon framework -test_pre_release: true -use_black: true -use_mypy: true -use_pre_commit: true -use_ruff: true - diff --git a/README.md b/README.md index e72cc88..a7078e5 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,51 @@ [![CI](https://github.com/tlambert03/pyconify/actions/workflows/ci.yml/badge.svg)](https://github.com/tlambert03/pyconify/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/tlambert03/pyconify/branch/main/graph/badge.svg)](https://codecov.io/gh/tlambert03/pyconify) -iconify for python. Universal icon framework +Python wrapper for the [Iconify](https://github.com/iconify) API. + +Iconify is a versatile icon framework that includes 100+ icon sets with more +than 100,000 icons from FontAwesome, Material Design Icons, DashIcons, Feather +Icons, EmojiOne, Noto Emoji and many other open source icon sets. + +Search for icons at: https://icon-sets.iconify.design + +## Installation + +```bash +pip install pyconify +``` + +## Usage + +```python +import pyconify + +# Info on available collections +collections = pyconify.collections() + +# Info on specific collection(s) +details = pyconify.collection("fa", "fa-brands") + +# Search for icons +hits = pyconify.search("python") + +# Get icon data +data = pyconify.icon_data("fa-brands", "python") + +# Get SVG +svg = pyconify.svg("fa-brands", "python") + +# Get SVG as a temporary file for the session +file_name = pyconify.temp_svg("fa-brands", "python") + +# Get CSS +css = pyconify.css("fa-brands", "python") + +# Keywords +pyconify.keywords('home') + +# API version +pyconify.iconify_version() +``` + +See details for each of these results in the [Iconify API documentation](https://iconify.design/docs/api/queries.html). diff --git a/example.py b/example.py deleted file mode 100644 index 51df4e3..0000000 --- a/example.py +++ /dev/null @@ -1,13 +0,0 @@ -from pyconify.qt import QIconify -from qtpy.QtCore import QSize -from qtpy.QtWidgets import QApplication, QPushButton - -app = QApplication([]) - -btn = QPushButton() -icon = QIconify("game-icons:sharp-smile", color="cornflowerblue", rotate="90") -btn.setIcon(icon) -btn.setIconSize(QSize(30, 30)) -btn.show() - -app.exec() diff --git a/src/pyconify/__init__.py b/src/pyconify/__init__.py index 22f4952..0aa6398 100644 --- a/src/pyconify/__init__.py +++ b/src/pyconify/__init__.py @@ -6,6 +6,7 @@ __version__ = version("pyconify") except PackageNotFoundError: # pragma: no cover __version__ = "uninstalled" + __author__ = "Talley Lambert" __email__ = "talley.lambert@gmail.com" __all__ = [ diff --git a/src/pyconify/py.typed b/src/pyconify/py.typed index 07d3fbd..e69de29 100644 --- a/src/pyconify/py.typed +++ b/src/pyconify/py.typed @@ -1,5 +0,0 @@ -You may remove this file if you don't intend to add types to your package - -Details at: - -https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages diff --git a/src/pyconify/qt.py b/src/pyconify/qt.py deleted file mode 100644 index 5df4c5d..0000000 --- a/src/pyconify/qt.py +++ /dev/null @@ -1,24 +0,0 @@ -from __future__ import annotations - -from typing import TYPE_CHECKING, Literal - -from qtpy.QtGui import QIcon - -from pyconify.api import temp_svg - -if TYPE_CHECKING: - Rotation = Literal["90", "180", "270", 90, 180, 270, "-90", 1, 2, 3] - - -class QIconify(QIcon): - """QIcon from Iconify API.""" - - def __init__( - self, - *key: str, - color: str | None = None, - flip: Literal["horizontal", "vertical", "horizontal,vertical"] | None = None, - rotate: Rotation | None = None, - ) -> None: - self.path = temp_svg(*key, color=color, flip=flip, rotate=rotate) - super().__init__(self.path)