This file contains hidden or 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 | |
from datetime import datetime, timedelta | |
API_KEY = 'YOUR_API_KEY' | |
url = "https://api.marketstack.com/v1/eod" | |
# Date range (last 3days) | |
date_from = (datetime.today() - timedelta(days=3)).strftime('%Y-%m-%d') |
This file contains hidden or 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 pandas as pd | |
# Load dataset (first 30 reviews) | |
url = "https://raw.githubusercontent.com/Abhayparashar31/NLPP_sentiment-analsis-on-hotel-review/refs/heads/main/Restaurant_Reviews.tsv" | |
df = pd.read_csv(url, sep='\t').head(30) | |
# API details | |
API_KEY = "EnwRnRRdslkpyV3Jqc2890NEduln2TXW" | |
API_URL = "https://api.apilayer.com/text_to_emotion" |
This file contains hidden or 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 pandas as pd | |
from datetime import datetime, timedelta | |
# API Key and URL | |
API_KEY = '0d25bd311d7d68b831ea2c0e952e6a6a' | |
url = "https://api.marketstack.com/v1/eod" | |
# Calculate date range (last 30 days) | |
today = datetime.today().strftime('%Y-%m-%d') |
This file contains hidden or 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 http.client | |
import urllib.parse | |
import smtplib | |
import json | |
from email.mime.text import MIMEText | |
from email.mime.multipart import MIMEMultipart | |
# Step 1: Fetch News Data from MediaStack API | |
def fetch_news(): | |
conn = http.client.HTTPConnection('api.mediastack.com') |
This file contains hidden or 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 tkinter as tk | |
from tkinter import messagebox | |
import pyaudio | |
import wave | |
import os | |
from datetime import datetime | |
from playsound import playsound | |
# Ensure directory exists for recordings | |
os.makedirs("assets/recordings", exist_ok=True) |
This file contains hidden or 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 time | |
import yfinance as yf | |
from win10toast import ToastNotifier | |
# Define the stock symbol and the percentage threshold | |
stock_symbol = "AAPL" | |
threshold_percentage = 0.010 # Set the desired threshold percentage | |
toaster = ToastNotifier() |
This file contains hidden or 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
def generate_markdown_file(): | |
# Prompting user for inputs | |
repository_name = input("\n Enter the name of your GitHub repository: ") | |
project_description = input("Enter a short description of your project: ") | |
installation_instructions = input("Enter installation instructions for your project: ") | |
usage_instructions = input("Enter usage instructions for your project: ") | |
contributors = input("Enter the contributors to your project (separated by commas): ") | |
license = select_license() | |
# Generating badges |
This file contains hidden or 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 socket | |
from prettytable import PrettyTable | |
# Dictionary mapping common ports to vulnerabilities (Top 15) | |
vulnerabilities = { | |
80: "HTTP (Hypertext Transfer Protocol) - Used for unencrypted web traffic", | |
443: "HTTPS (HTTP Secure) - Used for encrypted web traffic", | |
22: "SSH (Secure Shell) - Used for secure remote access", | |
21: "FTP (File Transfer Protocol) - Used for file transfers", | |
25: "SMTP (Simple Mail Transfer Protocol) - Used for email transmission", |
This file contains hidden or 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 os | |
import subprocess | |
def analyze_code(directory): | |
# List Python files in the directory | |
python_files = [file for file in os.listdir(directory) if file.endswith('.py')] | |
if not python_files: | |
print("No Python files found in the specified directory.") | |
return | |
report_dir = os.path.join(directory, "reports") |
This file contains hidden or 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 PIL import Image, JpegImagePlugin | |
from PIL.ExifTags import TAGS | |
def fetch_exif(image_path): | |
try: | |
image = Image.open(image_path) | |
exif_data = image._getexif() | |
if exif_data is not None: | |
# Convert EXIF data to a readable dictionary | |
exif_dict = {TAGS[key]: exif_data[key] for key in exif_data.keys() if key in TAGS and isinstance(exif_data[key], (int, str))} |
NewerOlder