Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Sagar Rout sagar-rout

🏠
Working from home
View GitHub Profile
@sagar-rout
sagar-rout / introduction_elasticsearch.py
Last active Dec 13, 2020
Create index in the elasticsearch with custom settings and search document
View introduction_elasticsearch.py
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 Oct 25, 2020
download weather data
View app.py
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)