Skip to content

Instantly share code, notes, and snippets.

View Xevib's full-sized avatar
🎯
Focusing

Xevi Xevib

🎯
Focusing
View GitHub Profile
# -*- encoding: utf-8 -*-
import click
import csv
from erppeek import Client
def actualitzar_lecturas(connection, url_lecturas):
"""
Actualiza el numero de lecturas sumando al ERP las lecturas del fichero
@Xevib
Xevib / generate_demo_escomeses.py
Last active May 23, 2018 09:47
Generates a openeerp demo from osm file
import os
from StringIO import StringIO
from lxml import etree
import click
from tqdm import tqdm
from pyproj import Proj
from pyproj import transform
@Xevib
Xevib / create_soap_file.py
Created December 13, 2017 16:27
Script per generar fitxers de soa diferencials
#!/usr/bin/python
# -*- coding: utf-8 -*-
import csv
import optparse
import sys
import time
def wh_detectectar_delimitador(path_file_csv):
with open(path_file_csv, 'r') as file_csv:
header = file_csv.readline()
@Xevib
Xevib / remove_countrycode.py
Last active January 19, 2016 22:22
Script to remove the country_code tag of towns administrative boundary OSM
import psycopg2
from osmapi import OsmApi
username=u''
password=u''
api = OsmApi(username=username, password=password,
changesetauto=True, changesetautotags={"comment": u"Remove addr:country_code"})
pg_dsn='user=, password=, host= ,database='
con = psycopg2.connect(pg_dsn)
cur = con.cursor()
cur.execute("select osm_id,name from planet_osm_polygon where admin_level='9' and boundary='administrative'")