Skip to content

Instantly share code, notes, and snippets.


Sagar Rout sagar-rout

View GitHub Profile
sagar-rout /
Last active Dec 13, 2020
Create index in the elasticsearch with custom settings and search document
from datetime import datetime
from elasticsearch import Elasticsearch
import json
es = Elasticsearch(
) # This will connect with default elasticsearch connection http://localhost:9200
INDEX_NAME = 'favourite-foods'
# Create index in the elasticsearch
sagar-rout /
Created Oct 25, 2020
download weather data
import os
import requests
from datetime import datetime, timedelta
import json
import json_logging
import logging
import sys
# log is initialized without a web framework name