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
''' | |
Script to put and get values from a distributed map cache in APACHE NIFI. | |
Only works when the id of the Distributed map cache client service is put into a property called "clientServiceId". | |
Sources: | |
https://www.javadoc.io/doc/org.apache.nifi/nifi-distributed-cache-client-service-api/1.7.0/org/apache/nifi/distributed/cache/client/AtomicDistributedMapCacheClient.html | |
https://community.cloudera.com/t5/Community-Articles/ExecuteScript-Cookbook-part-3/ta-p/249148 | |
''' | |
import json |
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
# Import Libraries | |
import matplotlib.font_manager as font_manager | |
import urllib.request | |
from tempfile import NamedTemporaryFile | |
def download_font(url: str, ttf_file: str, github: bool=True): | |
# Download the Font | |
font_url = f"{url}{ttf_file}{'?raw=true' if github else ''}" | |
urllib.request.urlretrieve(font_url, ttf_file) |