Skip to content

Instantly share code, notes, and snippets.

View pbindustries's full-sized avatar
🎯

pbindustries

🎯
  • Blue Bite
  • Manhattan
View GitHub Profile
#!/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: ""}
@pbindustries
pbindustries / index.js
Created June 24, 2018 17:25
Check that you have node and needed dependencies
/* 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");