GithubHelp home page GithubHelp logo

csvbuilder's Introduction

# CSV Builder

CSV Builder is a tool which makes creation of csv files from excel sheets easier. The main functionality of this tool is marging two sheets, such that every row from the first sheet is repeated for all rows in the second sheet. The usecase for this logic is when plant data exists on the first sheet (with each row representing a line) and we want to collect all modbus registers (second sheet) for each line.

In addition, some quality of life functionality was added such as separation of csv files based on device name Hostname Edge and static addition of data to the device csv file in case a sheet with the same name as the Hostname Edge value exists among the sheets.

Usage Guide

Prepare an excel file with at least two sheets, one for plant data and another for modbus data. create an output directory if it does not exist. Run python app.py inside the project folder. Necessary args are shown by using the python app.py --help command. Use auto mode in conjuction with default excel file to quickly produce csv sheets. Or use manual mode and customize the input by providing a unique column name and desired output columns.

Follow the prompt step by step and choose between Automatic mode or Manual mode. in case you choose Manual make sure you modify columns_custom.txt file. This file determines the output of csv files, so you can choose the columns which should exist inside the csv file and the program checks validity of columns. In case a column does not exist in your excel file the program raise an error.

You can find the final csv outputs for each edge device inside the output directory.

Manual mode

In Manual mode you can specify the name of desired columns in a .txt format, the program writes only those inside the resulting excel file. You need to specify a unique column name which will act as your output identifier, in this case Hostname Edge as an example. python app.py manual sample.xlsx columns_custom.txt "Hostname Edge"

Requirements

[x] Python 3.9 mkdir output pip install "typer[all]" pip install openpyxl pandas rich pip install typing

csvbuilder's People

Contributors

mohsenmgr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.