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
import pandas as pd | |
from datetime import datetime | |
df = pd.DataFrame([1678448391,1678448399,1678448400,1678448500,1678448900],columns =[ 'time']) | |
df['time'] = pd.to_datetime(df['time'],unit='s', utc= True) | |
df['time'] = pd.to_datetime(pd.to_datetime(df['time'],unit='s'),utc = True) | |
df['time'].dt.tz_convert('Asia/Kolkata') |
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
manual_cities_urls = { | |
"Abu": "https://en.wikipedia.org/wiki/Mount_Abu", | |
"Ahmadabad": "https://en.wikipedia.org/wiki/Ahmedabad", | |
"Bally": "https://en.wikipedia.org/wiki/Bally,_Howrah", | |
"Banda": "https://en.wikipedia.org/wiki/Banda,_Uttar_Pradesh", | |
"Barmer": "https://en.wikipedia.org/wiki/Barmer,_Rajasthan", | |
"Basti": "https://en.wikipedia.org/wiki/Basti_district", | |
"Betul": "https://en.wikipedia.org/wiki/Betul,_Madhya_Pradesh", | |
"Bhadravati": "https://en.wikipedia.org/wiki/Bhadravati,_Karnataka", | |
"Bhojpur": "https://en.wikipedia.org/wiki/Bhojpur,_Madhya_Pradesh", |
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
cities_list= [ | |
"Port Blair", | |
"Adoni", | |
"Amaravati", | |
"Anantapur", | |
"Chandragiri", | |
"Chittoor", | |
"Dowlaiswaram", | |
"Eluru", | |
"Guntur", |
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
from fastapi import FastAPI | |
import requests | |
import json | |
host = '0.0.0.0:8001' # diffent API running | |
app = FastAPI() | |
@app.get("/goodname") | |
async def root(): |
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
from fastapi import FastAPI | |
from pydantic import BaseModel | |
app = FastAPI() | |
class Fullname(BaseModel): | |
first_name: str | |
last_name : str | |
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
import pandas as pd | |
FILE_PATH = 'WDISeries-Time.csv' | |
chunk_size = 50 | |
parts_name = 'WDISeries-Time' | |
df = pd.read_csv(FILE_PATH,chunksize= chunk_size) | |
print(df, type(df)) | |
for i,d in enumerate(df): |
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
"It now costs $1,200 on average to complete World Cup sticker album" | |
"Nancy Pelosi Taiwan visit Highlights: Taiwan scrambles jets as 30 Chinese fighters cross Taiwan Strait median line" | |
"China withdraws promise not to dispatch troops to Taiwan after unification" | |
"Google Fiber Is Coming To Five More US States" |
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
import requests | |
import json | |
API_URL = "http://127.0.0.1:5000/translate" | |
# Openning and reading a file with sample English Sentences. | |
try: | |
file1 = open('sentence.txt', 'r') | |
lines = file1.readlines() | |
except: |
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
import datetime | |
import pytz | |
time_now_zone = datetime.datetime.now(pytz.timezone("Asia/Kolkata")) | |
print("Current Time in the country 'India' is : ", time_now_zone.strftime("%H:%M:%S")) | |
print("Set Timezone : ", time_now_zone.tzinfo) | |
print(datetime.datetime.now().strftime("%H:%M:%S")) |
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
import smtplib, ssl | |
port = 465 # For SSL | |
password = open("secure_pass.txt").read() # your password without newline | |
TO_EMAIL_ADDRESS = "reciever@gmail.com" | |
FROM_EMAIL_ADDRESS= "sender@gmail.com" | |
# Create a secure SSL context | |
context = ssl.create_default_context() |
NewerOlder