Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tlambert03 authored Sep 30, 2023
1 parent 7fe9303 commit 9bb97f1
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data = pyconify.icon_data("fa-brands", "python")
# Get SVG
svg = pyconify.svg("fa-brands", "python")

# Get SVG as a temporary file for the session
# Get path to SVG temporary file for the session
file_name = pyconify.temp_svg("fa-brands", "python")

# Get CSS
Expand All @@ -54,3 +54,31 @@ pyconify.iconify_version()
```

See details for each of these results in the [Iconify API documentation](https://iconify.design/docs/api/queries.html).

### cache

While the first fetch of any given SVG will require internet access,
pyconfiy caches svgs for faster retrieval and offline use. To
see or clear cache directory:

```python
import pyconify

pyconify.get_cache_directory() # reveal location of cache
pyconify.clear_cache() # remove the cache directory
```

If you'd like to precache a number of svgs, the current recommendation
is to use the `svg()` function:

```python
import pyconify

import pyconify

ICONS_TO_STORE = {"mdi:bell", "mdi:bell-off", "mdi:bell-outline"}
for key in ICONS_TO_STORE:
pyconify.svg(key)
```

Later calls to `svg()` will use the cached values.

0 comments on commit 9bb97f1

Please sign in to comment.