help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
weather-chatbot
RSK World
weather-chatbot
Weather Chatbot - Python + Flask + OpenWeatherMap + OpenAI + Weather Forecast + Weather Alerts + Natural Language Processing
weather-chatbot
  • __pycache__
  • cache
  • logs
  • scripts
  • sessions
  • static
  • templates
  • tests
  • utils
  • .dockerignore778 B
  • .env.example1.5 KB
  • .gitignore2.4 KB
  • .pre-commit-config.yaml1 KB
  • API.md7.9 KB
  • CHANGELOG.md2.4 KB
  • CHECKLIST.md5.4 KB
  • CONTRIBUTING.md1.9 KB
  • Dockerfile1.4 KB
  • FEATURES.md7.1 KB
  • FINAL_CHECK.md6.7 KB
  • GITHUB_RELEASE_INSTRUCTIONS.md5.4 KB
  • INSTALL.md4 KB
  • LICENSE1.3 KB
  • MANIFEST.in553 B
  • Makefile2 KB
  • PROJECT_SUMMARY.md12.9 KB
  • README.md7.2 KB
  • RELEASE_NOTES_v1.0.0.md8.9 KB
  • VERIFICATION_REPORT.md9.2 KB
  • app.py22.2 KB
  • chatbot.py1.7 KB
  • config.py4.9 KB
  • docker-compose.yml2.2 KB
  • nginx.conf2.3 KB
  • pytest.ini549 B
  • requirements.txt1.9 KB
  • run.py3.1 KB
  • setup.py3.1 KB
  • weather_api.py578 B
.gitignoreconfig.py
.gitignore
Raw Download
Find: Go to:
# Weather Chatbot Git Ignore File
# =================================
#
# Author: RSK World (https://rskworld.in)
# Founded by: Molla Samser
# Designer & Tester: Rima Khatun
# Contact: +91 93305 39277, hello@rskworld.in, support@rskworld.in
# Location: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
# Year: 2026

# Environment variables
.env
.env.local
.env.development
.env.test
.env.production

# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# Virtual environments
venv/
env/
ENV/
.venv/
.env/

# IDEs
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/
*.lcov

# nyc test coverage
.nyc_output

# Dependency directories
node_modules/
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
public

# Storybook build outputs
.out
.storybook-out

# Temporary folders
tmp/
temp/

# Database files
*.db
*.sqlite
*.sqlite3

# Flask specific
instance/
.webassets-cache

# Pytest
.pytest_cache/
.coverage
htmlcov/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# pipenv
Pipfile.lock

# PEP 582
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# Application specific
uploads/
static/uploads/
cache/
sessions/

# API Keys and secrets
secrets.json
config.json
api_keys.txt

# Backup files
*.bak
*.backup
*.old

# Compressed files
*.zip
*.tar.gz
*.rar

# Documentation build
docs/_build/

# Local development
local/
dev/
test_data/
201 lines•2.4 KB
text
config.py
Raw Download
Find: Go to:
#!/usr/bin/env python3
"""
Weather Chatbot Configuration
============================

Author: RSK World (https://rskworld.in)
Founded by: Molla Samser
Designer & Tester: Rima Khatun
Contact: +91 93305 39277, hello@rskworld.in, support@rskworld.in
Location: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
Year: 2026

Description: Configuration settings for the Weather Chatbot application
"""

import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

class Config:
    """Base configuration class for Weather Chatbot"""
    
    # Basic Flask Configuration
    SECRET_KEY = os.getenv('SECRET_KEY', 'weather-chatbot-secret-key-2026')
    DEBUG = os.getenv('FLASK_DEBUG', 'True').lower() == 'true'
    
    # Server Configuration
    HOST = os.getenv('HOST', '0.0.0.0')
    PORT = int(os.getenv('PORT', 5000))
    
    # API Keys
    OPENWEATHER_API_KEY = os.getenv('OPENWEATHER_API_KEY')
    OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
    
    # Weather API Configuration
    WEATHER_UNITS = os.getenv('WEATHER_UNITS', 'metric')
    WEATHER_LANGUAGE = os.getenv('WEATHER_LANGUAGE', 'en')
    DEFAULT_CITY = os.getenv('DEFAULT_CITY', 'London')
    
    # OpenWeatherMap API URLs
    OPENWEATHER_BASE_URL = "https://api.openweathermap.org/data/2.5"
    OPENWEATHER_GEO_URL = "http://api.openweathermap.org/geo/1.0"
    
    # Logging Configuration
    LOG_LEVEL = os.getenv('LOG_LEVEL', 'INFO')
    LOG_FILE = os.getenv('LOG_FILE', 'logs/weather_chatbot.log')
    
    # Rate Limiting
    RATE_LIMIT_ENABLED = os.getenv('RATE_LIMIT_ENABLED', 'True').lower() == 'true'
    RATE_LIMIT_PER_MINUTE = int(os.getenv('RATE_LIMIT_PER_MINUTE', 30))
    
    # Cache Configuration
    CACHE_ENABLED = os.getenv('CACHE_ENABLED', 'False').lower() == 'true'
    CACHE_TTL = int(os.getenv('CACHE_TTL', 300))  # 5 minutes
    
    # Database Configuration (for chat history)
    DATABASE_URL = os.getenv('DATABASE_URL', 'sqlite:///weather_chatbot.db')
    
    # CORS Configuration
    CORS_ORIGINS = os.getenv('CORS_ORIGINS', '*').split(',')
    
    # Security Configuration
    SESSION_COOKIE_SECURE = os.getenv('SESSION_COOKIE_SECURE', 'False').lower() == 'true'
    SESSION_COOKIE_HTTPONLY = os.getenv('SESSION_COOKIE_HTTPONLY', 'True').lower() == 'true'
    SESSION_COOKIE_SAMESITE = os.getenv('SESSION_COOKIE_SAMESITE', 'Lax')
    
    # Application Information
    APP_NAME = "Weather Chatbot"
    APP_VERSION = "1.0.0"
    APP_AUTHOR = "RSK World"
    APP_WEBSITE = "https://rskworld.in"
    APP_YEAR = "2026"
    
    # Supported Cities for Quick Access
    SUPPORTED_CITIES = [
        'London', 'New York', 'Paris', 'Tokyo', 'Delhi', 'Mumbai', 
        'Kolkata', 'Chennai', 'Bangalore', 'Sydney', 'Moscow', 
        'Beijing', 'Dubai', 'Singapore', 'Hong Kong'
    ]
    
    # Weather Alert Thresholds
    ALERT_TEMPERATURE_HIGH = 40.0  # Celsius
    ALERT_TEMPERATURE_LOW = -10.0  # Celsius
    ALERT_WIND_SPEED_HIGH = 20.0   # m/s
    ALERT_HUMIDITY_HIGH = 90.0     # Percentage
    
    @staticmethod
    def validate_config():
        """Validate required configuration settings"""
        errors = []
        
        if not Config.OPENWEATHER_API_KEY:
            errors.append("OPENWEATHER_API_KEY is required")
        
        if errors:
            raise ValueError("Configuration validation failed: " + ", ".join(errors))
        
        return True
    
    @staticmethod
    def get_app_info():
        """Get application information"""
        return {
            'name': Config.APP_NAME,
            'version': Config.APP_VERSION,
            'author': Config.APP_AUTHOR,
            'website': Config.APP_WEBSITE,
            'year': Config.APP_YEAR,
            'contact': {
                'phone': '+91 93305 39277',
                'email': 'hello@rskworld.in',
                'support': 'support@rskworld.in'
            },
            'location': 'Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147'
        }

class DevelopmentConfig(Config):
    """Development configuration"""
    DEBUG = True
    LOG_LEVEL = 'DEBUG'

class ProductionConfig(Config):
    """Production configuration"""
    DEBUG = False
    SESSION_COOKIE_SECURE = True
    LOG_LEVEL = 'WARNING'

class TestingConfig(Config):
    """Testing configuration"""
    TESTING = True
    DEBUG = True
    OPENWEATHER_API_KEY = 'test_key'
    OPENAI_API_KEY = 'test_key'

# Configuration mapping
config_map = {
    'development': DevelopmentConfig,
    'production': ProductionConfig,
    'testing': TestingConfig,
    'default': DevelopmentConfig
}

def get_config(config_name=None):
    """Get configuration based on environment"""
    if config_name is None:
        config_name = os.getenv('FLASK_ENV', 'default')
    
    return config_map.get(config_name, DevelopmentConfig)
151 lines•4.9 KB
python

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer