Skip to content

Instantly share code, notes, and snippets.

View sagar-rout's full-sized avatar
🎯
Focusing

Sagar Rout sagar-rout

🎯
Focusing
View GitHub Profile
@sagar-rout
sagar-rout / introduction_elasticsearch.py
Last active December 13, 2020 15:43
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
sagar-rout / app.py
Created October 25, 2020 09:48
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
json_logging.init_non_web(enable_json=True)