Skip to content

Instantly share code, notes, and snippets.

View eiriks's full-sized avatar

Eirik S eiriks

View GitHub Profile
@vinodnerella
vinodnerella / importsqlintoelastic.py
Created May 19, 2017 12:15
Importing SQL data into Elasticsearch
#Importing MySQL database to elasticsearch
# Importing required modules and connecting to elasticsearch
from pyelasticsearch import ElasticSearch
es = ElasticSearch('http://localhost:9200/')
import json
import requests
import MySQLdb
@xamox
xamox / mongo-to-elasticsearch.py
Created October 18, 2016 22:09
Move data from Mongo to Elasticsearch
'''
Tested with:
Mongo 3.0.12
pymongo 3.3.0
Elasticsearch 2.1.2
Kibana 4.3.3
elasticsearch python 2.1.0
'''
@fnielsen
fnielsen / afinn.py
Last active May 6, 2021 11:41
Simplest sentiment analysis in Python with AFINN
#!/usr/bin/python
#
# (originally entered at https://gist.github.com/1035399)
#
# License: GPLv3
#
# To download the AFINN word list do:
# wget http://www2.imm.dtu.dk/pubdb/views/edoc_download.php/6010/zip/imm6010.zip
# unzip imm6010.zip
#
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<style type="text/css">
body{font:12px/1.231 arial,helvetica,clean,sans-serif;}
</style>