CSV Viewer and Converter - Powered by Flask & Simple-DataTables JS
Tags: webdev, python, converter, flask
Published: 2022-02-10 18:24:37

---
title: CSV Viewer and Converter - Powered by Flask & Simple-DataTables JS
published: true
description: A simple open-source tool for CSV files: loader, viewer and updater using Flask and Simple-DataTables JS library.
tags: webdev, python, converter, flask
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9nv3bwyp9kw2fzp7ck1g.jpg
canonical_url: https://blog.appseed.us/simple-data-converter-flask-simple-datatables/
---
Hello Coders!

This article presents a simple **Data Converter** codebase powered by `Flask` and `Simple-DataTables` JS Library. This experimental project can be used to **visualize CSV files using data tables**, export in different formats, and edit the information using the console. The `source code`, published on Github under the MIT license, will be updated to support charts and other conversions (to PDF, to data frames.. etc).

> Thanks for reading!

- 👉 [Data Converter](https://github.com/app-generator/devtool-data-converter) - source code
- 🎁 Free [Support](https://appseed.us/support) via email and [Discord](https://discord.gg/fZC6hup)

---

## ✨ Project Features

- 👉 Minimal set up
- 👉 CSV files upload / Visualization
- 👉 Search, Pagination, Export to JSON, SQL, and Text
- 👉 Edit (via console): Update/Remove/Add columns

New columns can be provisioned using data with different formats: Random Strings, Integers, and Timestamps (UNIX format).  

---

![Data Converter - CSV Load in Data Tables.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wnmmgblrr7hazexfqjiz.gif)

---

## ✨How to start the project

This tool can be compiled and started in any environment that has Python3 and GIT installed.

> **Step #1** - Clone the sources

```bash
$ git clone https://github.com/app-generator/devtool-data-converter.git
$ devtool-data-converter
```

---

> **Step #2** - Install the dependencies


```bash
$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt
```

---

> **Step #3** - Start the app

```bash
$ flask run 
```

If all goes well, we should be able to visit the app in the browser and visualize the default CSV files shipped with the code ([samples](https://github.com/app-generator/devtool-data-converter/tree/main/samples) directory).

---

## ✨Helpers

The project comes with a few basic helpers for CSV data format:

- `csv_print()` - print a CSV file to the console
- `csv_col_remove()` - remove a column (by name)
- `csv_col_update()` - update a column with generated data
- `csv_col_add()` - add a new column (generated data)
- `csv_to_json()` - CSV to JSON converter

Generated data is generated in different formats: `random strings`, `random integers`, and UNIX `timestamps`.

---

> **Print** a CVS file

![Data Converter - CSV Print](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o5p43npdcdcygsu5v0nd.png)

---

> **Delete Columns** from a CSV file

![Data Converter - CSV Delete Columns](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4h32g0aq7j0tm2keiaz.png)

---

> **CSV Add Content** - New column provisioned with random integers 

![Data Converter - CSV Add Data](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ctgnewsixkmo9stfvs3.png)

---

> `Thanks for reading!` For more resources, feel free to access:

---

- ✨ [AppSeed](https://appseed.us/) for more tools and [free starters](https://appseed.us/admin-dashboards/open-source)
- ✨ More [sample projects](https://github.com/topics/appseed-sample) published on Github