CodeLine Counter

 import os
from flask import Flask, request, jsonify, redirect, url_for
from werkzeug.utils import secure_filename
import tempfile
import zipfile
import io
import logging

app = Flask(__name__)

logging.basicConfig(level=logging.DEBUG)

SUPPORTED_EXTENSIONS = {'py', 'html', 'js', 'jsx', 'ts', 'css', 'txt', 'json'}

# Global variable to store the results
results_data = {
    'files_processed': {},
    'files_skipped': [],
    'total_lines': 0
}

def allowed_file(filename):
    return '.' in filename and \
           filename.rsplit('.', 1)[1].lower() in SUPPORTED_EXTENSIONS

About this template

This application processes zip files and displays code file details in a visually appealing table format.

Introduction to the CodeLine Counter Template

Welcome to the CodeLine Counter template! This template is designed to help you quickly set up an application that processes zip files containing code files and displays the details of each file, including the number of lines of code, in a visually appealing table format. This is an excellent tool for builders who need to analyze the volume of code in a project or for educational purposes.

Getting Started

To begin using this template, simply click on "Start with this Template" on the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy, paste, or delete any code manually.

Test: Deploying the App

Once you have started with the template, the next step is to deploy the app. To do this, press the "Test" button on the Lazy platform. This will initiate the deployment process and launch the Lazy CLI. The Lazy platform handles all deployment aspects, so you don't need to worry about installing libraries or setting up your environment.

Using the App

After deployment, Lazy will provide you with a dedicated server link to access the app's interface. Here's how to use the interface:

  • Visit the provided server link to access the welcome page of the CodeLine Counter app.
  • On the welcome page, you will see a form to upload a zip file. Click on the "Choose File" button to select the zip file containing your code files.
  • After selecting the file, click on the "Upload" button to submit the file for processing.
  • The app will then unzip the file, count the lines of code in each supported file, and display the results on a new page.
  • You can review the number of lines of code for each file and the total lines of code processed.

Integrating the App

If you wish to integrate the CodeLine Counter app into an external service or frontend, you may need to use the server link provided by Lazy. For example, you could:

  • Add the server link to an external dashboard to display code analysis results.
  • Use the API endpoints provided by the app to fetch results programmatically from another application.

Remember, the CodeLine Counter app is designed to be used within the Lazy platform, and all necessary configurations are handled for you.

If you have any questions or need further assistance, feel free to reach out to the Lazy customer support team. Happy building!

Category
Technology
Last published
July 26, 2024

More templates like this

SecureUserAuthenticator

Develop a secure User Authentication system for users to register, log in, and manage their profiles, laying the foundation for user-specific data management and permissions in the CMS.

Laravel
Python
Flask
Javascript

Simple Multiplayer Telegram game

This app is a simple frontend for a game where users can upvote and downvote the most popular word in their country, learn about the flags of other countries, and view what other people voted for on a leaderboard.

Telegram
Python
Javascript

MP3ify: Youtube to MP3 Converter

A web application that allows users to download YouTube videos from URLs and provides the option to convert them to MP3 format.

Python
Flask
Home
/
CodeLine Counter