Skip to content

Instantly share code, notes, and snippets.

View alexGitSpace's full-sized avatar

Aleksei Denisov alexGitSpace

  • Videoly
  • Finland, Helsinki
View GitHub Profile
@ddelange
ddelange / Installing PyICU, libpostal, pypostal on Mac OS X 10.14+.md
Last active May 7, 2024 14:12
Installation instructions for libicu-dev, PyICU, libpostal, pypostal on Mac OS X 10.14+

Installing PyICU, libpostal, pypostal on Mac OS X 10.14+

libicu-dev (PyICU dependency)

brew uninstall --ignore-dependencies icu4c
brew install pkg-config icu4c  # keg-only
from __future__ import print_function
import boto3
import urllib
import os
import psycopg2
print('Loading function')
s3_client = boto3.client('s3')
s3_object = boto3.resource('s3')
@mbrzusto
mbrzusto / fix_bad_quote_json.py
Created November 9, 2015 20:21
convert single quote json data file to double quote json data file (without mangling inner quotes)
__author__ = 'mbrzustowicz'
# metadata.json has single quotes like this
# {'asin': 'B00M0AEPXG', 'imUrl': 'http://ecx.images-amazon.com/images/I/51hcXTUeHLL._BO2,204,203,200_ ..... }
# so the strategy is to read each line as a string, and dump into a REAL json file
import json
import ast
fr=open("/Users/mbrzustowicz/Downloads/metadata.json")