Skip to content

Instantly share code, notes, and snippets.

Francesco Bruni brunifrancesco

View GitHub Profile
@brunifrancesco
brunifrancesco / tms.py
Created Apr 16, 2019
Ingest and visualize landsat data
View tms.py
import rasterio
import geopyspark as gps
import numpy as np
import matplotlib
import matplotlib.cm as cm
from pyspark import SparkContext
conf = gps.geopyspark_conf(master="local[*]", appName="ingest-example", )
conf.set(key='spark.kryoserializer.buffer.max', value='256m')
View scraper.py
# -*- coding: utf-8 -*-
"""
Get Paris attractions data scraping the BASE_URL site.
Wrap those data into a json structure.
Deps:
- BeautifulSoup
- requests
- fn
@brunifrancesco
brunifrancesco / process_html.py
Created Jan 12, 2016
Process and parse HTML files to get them complied with the Angular "translate" filter. The scripts create also the final json file which will contain all the needed translations.
View process_html.py
#! /usr/bin/env python
"""
Process some HTML files to add translation features.
The script replaces simple strings (avoiding parsing special chars, comments, Angular based variables, HTML entities)
and any other Angular related stuff with the same string followed by the 'translate' filter as stated in
https://angular-translate.github.io/ .
To be translated labels got memorized in the final json file, where translations values will be present.
File by file, processed content is stored in a new file letting the original one intact.
Install required deps
You can’t perform that action at this time.