Giter Club home page Giter Club logo

influxdb_assessment's Introduction

INFLUXDB-PYTHON TASK

SETUP INFLUX-DB on Local Using Docker


sudo docker run -p 8086:8086 -v myInfluxVolume:/var/lib/influxdb2 influxdb:latest

Creating a virtual environment:

conda create -p venv --y

Installing Required Dependencies:

pip3 install -r requirements.txt

Add the Secrets to the Environment Variables

export INFLUXDB_URL = < DB URL >
export INFLUXDB_TOKEN = <TOKEN>

Run the APP:

python3 app.py

Upload the attached CSV file air-sensor-data-annotated.csv to the bucket 'bulk_data':

cURL:


curl --location --request GET 'http://127.0.0.1:5000/data/api/bulk-data' \
--header 'Content-Type: application/json'

Sample Response:


{
    "error": false,
    "message": "Data Fetched Successfully"
    "data": [
        {
            "_field": "co",
            "_measurement": "airSensors",
            "_start": "Thu, 01 Jan 1970 00:00:00 GMT",
            "_stop": "Thu, 15 Jun 2023 06:32:34 GMT",
            "_time": "Thu, 15 Jun 2023 03:34:41 GMT",
            "_value": 0.5121152871474747,
            "result": "_result",
            "sensor_id": "TLM0100",
            "table": 0
        },
        {
            "_field": "co",
            "_measurement": "airSensors",
            "_start": "Thu, 01 Jan 1970 00:00:00 GMT",
            "_stop": "Thu, 15 Jun 2023 06:32:34 GMT",
            "_time": "Thu, 15 Jun 2023 03:34:51 GMT",
            "_value": 0.524751710809402,
            "result": "_result",
            "sensor_id": "TLM0100",
            "table": 0
        },
        {
            "_field": "co",
            "_measurement": "airSensors",
            "_start": "Thu, 01 Jan 1970 00:00:00 GMT",
            "_stop": "Thu, 15 Jun 2023 06:32:34 GMT",
            "_time": "Thu, 15 Jun 2023 03:35:01 GMT",
            "_value": 0.5200883097130582,
            "result": "_result",
            "sensor_id": "TLM0100",
            "table": 0
        }
    ]
}

influxdb_assessment's People

Contributors

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