This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
""" | |
DESCRIPTION | |
Simple python script to import a csv into ElasticSearch. It can also update existing Elastic data if | |
only parameter --id-column is provided | |
HOW IT WORKS | |
The script creates an ElasticSearch API PUT request for | |
each row in your CSV. It is similar to running an bulk insert by: | |
$ curl -XPUT localhost:9200/_bulk -d '{index: "", type: ""} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Check for Node.js */ | |
var IS_NODE = false; | |
if (typeof exports !== 'undefined') { | |
if (typeof module !== 'undefined' && module.exports) { | |
IS_NODE = true; | |
// Get dependencies | |
request = require("request"); | |
jQuery = require("cheerio"); | |
$ = require("cheerio"); | |
_ = require("underscore"); |
NewerOlder