TAAFT
Free mode
100% free
Freemium
Free Trial
Deals

Siddant Kittur's tools

  • Free Code Python Generator
    Generate clean Python code from simple descriptions.
    Open
    ```python # Importando bibliotecas necessรกrias import sqlite3 from typing import List, Dict from dataclasses import dataclass from enum import Enum # Definiรงรฃo de enum para status class Status(Enum): PENDENTE = "pendente" CONCLUIDO = "concluรญdo" # Definiรงรฃo de dataclass para Bloco @dataclass class Bloco: id: int dia: str materia: str videos: str status: Status questoes: int observacoes: str # Data Layer (Modelo e Banco de Dados) class DataLayer: def __init__(self, db_name: str): self.conn = sqlite3.connect(db_name) self.cursor = self.conn.cursor() self.create_tables() def create_tables(self): self.cursor.execute(''' CREATE TABLE IF NOT EXISTS blocos (id INTEGER PRIMARY KEY, dia TEXT, materia TEXT, videos TEXT, status TEXT, questoes INTEGER, observacoes TEXT) ''') self.conn.commit() def insert_bloco(self, bloco: Bloco): self.cursor.execute(''' INSERT INTO blocos (dia, materia, videos, status, questoes, observacoes) VALUES (?, ?, ?, ?, ?, ?) ''', (bloco.dia, bloco.materia, bloco.videos, bloco.status.value, bloco.questoes, bloco.observacoes)) self.conn.commit() def get_blocos(self) -> List[Bloco]: self.cursor.execute('SELECT * FROM blocos') rows = self.cursor.fetchall() return [Bloco(*row) for row in rows] # Service Layer (Lรณgica de Negรณcios) class ServiceLayer: def __init__(self, data_layer: DataLayer): self.data_layer = data_layer def marcar_concluido(self, bloco_id: int): self.data_layer.cursor.execute('UPDATE blocos SET status = ? WHERE id = ?', (Status.CONCLUIDO.value, bloco_id)) self.data_layer.conn.commit() def editar_questoes(self, bloco_id: int, questoes: int): self.data_layer.cursor.execute('UPDATE blocos SET questoes = ? WHERE id = ?', (questoes, bloco_id)) self.data_layer.conn.commit() def adicionar_observacoes(self, bloco_id: int, observacoes: str): self.data_layer.cursor.execute('UPDATE blocos SET observacoes = ? WHERE id = ?', (observacoes, bloco_id)) self.data_layer.conn.commit() def calcular_progresso(self) -> Dict: blocos = self.data_layer.get_blocos() total_blocos = len(blocos) blocos_concluidos = len([b for b in blocos if b.status == Status.CONCLUIDO]) progresso = (blocos_concluidos / total_blocos) * 100 if total_blocos > 0 else 0 return { 'total_blocos': total_blocos, 'blocos_concluidos': blocos_concluidos, 'progresso': progresso } # Interface Layer (CLI) class CLI: def __init__(self, service_layer: ServiceLayer): self.service_layer = service_layer def run(self): while True: print("\nOpรงรตes:") print("1. Marcar bloco como concluรญdo") print("2. Editar quantidade de questรตes") print("3. Adicionar observaรงรตes") print("4. Ver progresso") print("5. Sair") opcao = input("Escolha uma opรงรฃo: ") if opcao == '1': bloco_id = int(input("Informe o ID do bloco: ")) self.service_layer.marcar_concluido(bloco_id) elif opcao == '2': bloco_id = int(input("Informe o ID do bloco: ")) questoes = int(input("Informe a quantidade de questรตes: ")) self.service_layer.editar_questoes(bloco_id, questoes) elif opcao == '3': bloco_id = int(input("Informe o ID do bloco: ")) observacoes = input("Informe as observaรงรตes: ") self.service_layer.adicionar_observacoes(bloco_id, observacoes) elif opcao == '4': progresso = self.service_layer.calcular_progresso() print(f"Total de blocos: {progresso['total_blocos']}") print(f"Blocos concluรญdos: {progresso['blocos_concluidos']}") print(f"Progresso: {progresso['progresso']}%") elif opcao == '5': break else: print("Opรงรฃo invรกlida. Tente novamente.") # Main def main(): data_layer = DataLayer('estudos.db') service_layer = ServiceLayer(data_layer) cli = CLI(service_layer) cli.run() if __name__ == '__main__': main() ```
  • futuredude
    AI career coach that crafts perfect job matches.
    Open
    futuredude website
  • Linux Command Generator
    Turn plain English into Linux commands instantly.
    Open
    Linux Command Generator website
  • Ilustration Generator
    Describe your vision, get stunning digital illustrations.
    Open
    Top generationTop generation
  • Website And App Generator
    Transform ideas into complete website blueprints.
    Open
    Website And App Generator website
  • Instagram Coments Generator
    AI-powered Instagram comments that feel authentic and boost engagement.
    Open
    Instagram Coments Generator website
0 AIs selected
Clear selection
#
Name
Task