File: pull_nerd.py

package info (click to toggle)
hyfetch 1.99.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,704 kB
  • sloc: sh: 13,305; python: 11,128; javascript: 13; makefile: 6
file content (11 lines) | stat: -rw-r--r-- 553 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
import json
from pathlib import Path

import requests

if __name__ == '__main__':
    md = requests.get("https://raw.githubusercontent.com/lukas-w/font-logos/refs/heads/master/README.md").text
    md = [[field.strip().strip('`').replace('Linux', '').replace('GNU/', '').strip() for field in line.split('|')[1:-1]]
          for line in md.splitlines() if line.startswith("|") and 'fl-' in line]
    md = {name: chr(int(char, 16)) for name, css, code, char, img in md}
    Path("font_logos.json").write_text(json.dumps(md, indent=2, ensure_ascii=False))