Skip to main content

WSC Influx Tools

This project is in aid of the Bridgestone World Solar Challenge.

This is a python module which provides several CLI tools for interacting with the event's influx database.

Installing wsc-influx-tools

wsc-influx-tools is a python package. THis has been tested on Linux and Mac (using Python 3.11). Let us know if there are any issues. It can be installed using pip.

pip install wsc-influx-tools

The commands have useful help

$ wsc-influx-send-data --help
usage: wsc-influx-send-data [-h] [--config CONFIG] [--url URL] [--bucket BUCKET] [--org ORG]
                            [--token TOKEN] [--debug] [--quiet] [--dryrun] [--input INPUT]

Writing data to influx

wsc-influx-tools provides a tool to send line format to an Influx V2 database from the CLI, given a URL and a token.

Note that many of hte fields included below are overwritten (e.g. car name, team number, etc.)

Note that the precision used for the timestamp at the end of the line is nanoseconds (i.e. seconds * 1000000000)

wsc-influx-send-data --url https://telemetry.worldsolarchallenge.org/test/ingest/michigan --token TOKEN_GOES_HERE << EOF
telemetry,event=BWSC2023,class=Cruiser,team=World\ Solar\ Challenge\ Faculty,car=Solar\ Wombat\ 3,shortname=WSC\ Faculty longitude=135.26007,latitude=-30.24246,altitude=187.3,distance=432162,solarEnergy=20914846,batteryEnergy=52278368 1697461695000000000
EOF

Reading data from Influx

For testing purposes, teams are provided with access to the InfluxDB V3 bucket to which their data is written. The line format, written above, can be downloaded as CSV using the below command:

By default the wsc-influx-get-data command will query the last day's data from the given measurement in the given bucket.

wsc-influx-get-data \
        --bucket test-teamdata \
        --measurement teamdata \
        --format=csv \
        --token TOKEN_GOES_HERE

The above results in a CSV output on the command line:

,iox::measurement,time,altitude,batteryEnergy,car,class,distance,escapedname,event,host,latitude,longitude,shortname,solarEnergy,team,teamnum
0,teamdata,2023-10-16 13:08:15,187.3,52278368.0,Astrum,Challenger,432162.0,michigan,BWSC2023,telegraf-deployment-michigan-6c497bc786-f4xdg,-30.24246,135.26007,Michigan,20914846.0,University of Michigan Solar Car Team,2

Copyright 2021-2023 David Snowdon

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Release files for wsc-influx-tools 2023.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wsc-influx-tools 2023.1.0
File Size Uploaded
wsc_influx_tools-2023.1.0.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wsc-influx-tools 2023.1.0
File Interpreter ABI Platform
wsc_influx_tools-2023.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / wsc_influx_tools-2023.1.0.tar.gz

Download URL wsc_influx_tools-2023.1.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cf7938d7cccaa03fd8e83a47bcf3a1c9f8db4378962d416360a2b88891ca3bb6
BLAKE2b-256 checksum
How to use checksums
3b633e5d8d9bda867768678c4dc2e4ffffaa7a9f90987844de3a20dcd6d72d0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / wsc_influx_tools-2023.1.0-py3-none-any.whl

Download URL wsc_influx_tools-2023.1.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20dfa991b6cb7ae0c2fb4f6bba86a94895ffd80b5ddcc97a16ee1ce1f13a328d
BLAKE2b-256 checksum
How to use checksums
f817999fbce61ce733db09c363de74a86a0d37471ff33520c0e4ad4b4636d1f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

2023.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page