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
  • Blog
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
travel-assistant-bot
RSK World
travel-assistant-bot
Travel Assistant Bot - Python + Flask + OpenAI API + Travel Bot + Flight Search + Hotel Booking + Weather
travel-assistant-bot
  • .venv
  • __pycache__
  • services
  • static
  • templates
  • .gitignore515 B
  • LICENSE.md1.2 KB
  • README.md730 B
  • RELEASE_NOTES.md7.1 KB
  • analytics.py1.4 KB
  • app.log0 B
  • app.py8.2 KB
  • auth.py4.9 KB
  • db.py3.3 KB
  • requirements.txt214 B
  • run.ps1529 B
  • travel.db24 KB
run.pychat.jsanalytics.py
analytics.py
Raw Download
Find: Go to:
# RSK World - Free Programming Resources & Source Code
# Founder: Molla Samser | Designer & Tester: Rima Khatun
# Website: https://rskworld.in/contact.php | Year: 2026
import sqlite3
from pathlib import Path
from datetime import datetime
from typing import Dict

DB_PATH = Path("travel.db")


def _conn():
    return sqlite3.connect(DB_PATH)


def init_events():
    conn = _conn()
    cur = conn.cursor()
    cur.execute(
        """
        CREATE TABLE IF NOT EXISTS events(
            id INTEGER PRIMARY KEY AUTOINCREMENT,
            category TEXT NOT NULL,
            action TEXT NOT NULL,
            meta TEXT,
            created_at TEXT NOT NULL
        )
        """
    )
    conn.commit()
    conn.close()


init_events()


def log_event(category: str, action: str, meta: str = ""):
    conn = _conn()
    cur = conn.cursor()
    cur.execute(
        "INSERT INTO events(category, action, meta, created_at) VALUES (?, ?, ?, ?)",
        (category, action, meta, datetime.utcnow().isoformat()),
    )
    conn.commit()
    conn.close()


def metrics() -> Dict[str, int]:
    conn = _conn()
    cur = conn.cursor()
    counts = {}
    for cat in ["chat", "flights", "hotels", "weather", "itinerary", "auth"]:
        cur.execute("SELECT COUNT(*) FROM events WHERE category = ?", (cat,))
        counts[cat] = cur.fetchone()[0]
    conn.close()
    return counts

58 lines•1.4 KB
python
🚀 Support RSK World

Subscribe to our YouTube channel for latest tutorials & updates!



Click subscribe & support our work ❤️

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