Giter VIP home page Giter VIP logo

csv2influx's Introduction

csv2influx

Write CSV data into InfluxDB thanks to Influx's Line Protocol syntax. It's based on lineprotocol package.

The CSV files must have a header row so csv2inlux can properly match and write fields' and tags' labels.
If you target more than one input CSV file, csv2influx will consider they are all identical in terms of structure and CSV options (delimiter, quoting, etc).
csv2influx won't validate fields' types; it will just add trailing 'i' for integers and double quotes strings. Finally, tags won't be automatically sorted to improve performances. Feel free to do so manually by providing --tag-columns with a sorted list if you prefer.

Usage:
  csv2influx.py PATH [--output-path PATH] [--measurement NAME] [--tag-columns TAGS] --field-columns FIELDS [--timestamp TIME] [--influx-url URL]

Arguments:
  PATH                      path to input file(s) (can contain wildcards)

Options:
  -h --help                 show this message
  --output-path PATH        point to a file or a directory (path ending with os' separator) where the result
                            will be written
  --measurement NAME        name of the measurement [default: sample_measurement]
  --tag-columns TAGS        comma-separated list of columns to use as tags
  --field-columns FIELDS    comma-separated list of columns to use as fields followed by a colon and its type (float, int, str or bool)
  --timestamp TIME          any format that Arrow can read with Arrow.get()
  --influx-url URL          url of the InfluxDB's write endpoint where you'd like to post data
                            (example: http://localhost:8086/write?db=mydb)

Examples:
  csv2influx.py some/data/*.csv --output-path=output/ --measurement=movement --field-columns=speed:int --timestamp=2016-09-26T02:00:00+00:00
  csv2influx.py some/data/sample.csv --output-path=output/result.out --field-columns=speed:int,strength:float --tag-columns=name,class --timestamp=2016-09-26
  csv2influx.py some/data/*/sample.csv --field-columns=speed:int --timestamp=2016-09-26T02:00:00+00:00 --influx-url=http://localhost:8086/write?db=mydb

csv2influx's People

Contributors

qn7o avatar

Watchers

 avatar  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.