This project is a Flask-based web application designed to view tabular data in various formats. The application supports file uploads and renders tabular data in an HTML table format for easy visualization. Additionally, it provides an option to download the data as an Excel file.
The application supports the following file formats:
- CSV: Text files with delimiters such as commas or other characters.
- Excel:
.xlsxfiles created in Microsoft Excel. - SAS7BDAT: Standard SAS data files.
- XPT: Standard transport files used in SAS.
- CPORT Files: SAS CPORT files are not directly supported due to their proprietary nature. If a CPORT file is uploaded, users are informed that the format is unsupported and provided with guidance on converting it to a supported format.
atorus_test_task/
├── app.py # Main Flask application
├── templates/ # HTML templates for the web interface
│ ├── base.html # Base template for consistent layout
│ ├── index.html # Upload interface
│ ├── table.html # Table display interface
├── static/ # Static files (CSS, JavaScript)
│ ├── styles.css # Custom styles
├── converted_files/ # Folder for saving uploaded files
├── README.md # Project documentation
├── requirements.txt # Python dependencies
-
Clone the repository:
git clone <repository-url> cd atorus_test_task
-
Create a virtual environment and activate it:
python3 -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.py
-
Open the application in your browser:
http://127.0.0.1:5000
Users can upload files through the / endpoint. The interface allows selecting a file type and uploading a file for processing.
Uploaded files are processed and displayed as an HTML table at the /view endpoint. The table is:
- Cleaned of unnecessary characters and whitespace.
- Displayed with a responsive layout.
Processed data can be downloaded as an Excel file via the /save endpoint.
The application provides meaningful error messages for unsupported formats or invalid file structures.
- Flask: Web framework for Python.
- Pandas: Data manipulation and analysis.
- Pyreadstat: Reading SAS and SPSS files.
- Chardet: Detecting file encodings.
- Openpyxl: Writing Excel files.
This project demonstrates how to build a file processing web application using Flask. The system processes various tabular formats, cleans data, and presents it in an accessible HTML table. Unsupported formats like CPORT are handled gracefully with user-friendly error messages and guidance on conversion.

