Skip to content

Instantly share code, notes, and snippets.

@Hrazhan
Hrazhan / kurdfonts_downloader.py
Created February 20, 2023 22:25
A script that downloads all the fonts on kurdfonts.com
import requests
from bs4 import BeautifulSoup
import time
url = 'https://www.kurdfonts.com/browse/categories'
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
@Hrazhan
Hrazhan / resolve_ae.py
Last active September 9, 2023 07:24
A Python function to correct the misspelling of the AE character (ە) in Kurdish text.
import re
def resolve_ae(text):
"""
This function takes a text input in Central Kurdish (Sorani) script and performs a series of character replacements
to standardize variations in the script. Specifically, it addresses cases where the character 'ە' (Arabic letter
AE) may be used in different contexts.
"""
# First replace all occurrences of 'ه' with 'ە'
text = re.sub("ه", "ە", text)
@Hrazhan
Hrazhan / rudaw.py
Last active June 27, 2024 20:49
A minimal script to scrape rudaw.net
"""
This script can scrape rudaw.net in two stages
1. `python rudaw.py links` collect links for each category
2. `python rudaw.py content` collect content for each link and writes it to rudaw.csv
"""
import sys
import os
import csv