Package: influxio
AboutYou can useinfluxioto import and export data into/from InfluxDB.
It can be used both as a standalone program, and as a library.influxiois, amongst others, based on the excellentdask,fsspec,influxdb-client,line-protocol-parser,pandas, andSQLAlchemypackages.Please note thatinfluxiois alpha-quality software, and a work in progress.
Contributions of all kinds are very welcome, in order to make it more solid.
Breaking changes should be expected until a 1.0 release, so version pinning
is recommended, especially when you use it as a library.Caveat: Only a few features sketched out in the README have actually been
implemented right now.Synopsis# Export from data directory to line protocol format.influxiocopy\"file:///path/to/data/engine?org=example&bucket=testdrive&measurement=demo"\"file://export.lp"# Export from API to database.influxiocopy\"http://example:token@localhost:8086/testdrive/demo"\"sqlite://export.sqlite?table=demo"QuickstartIf you are in a hurry, and want to runinfluxiowithout any installation,
just use the OCI image on Podman or Docker.dockerrun--rm--network=hostghcr.io/daq-tools/influxio\influxiocopy\"http://example:token@localhost:8086/testdrive/demo"\"crate://crate@localhost:4200/testdrive/demo"SetupInstallinfluxiofrom PyPI.pipinstallinfluxioUsageThis section outlines some example invocations ofinfluxio, both on the
command line, and per library use. Other than the resources available from
the web, testing data can be acquired from the repository’stestdatafolder.PrerequisitesFor properly running some of the example invocations outlined below, you will
need an InfluxDB and a CrateDB server. The easiest way to spin up those
instances is to use Podman or Docker.dockerrun--rm-it--publish=8086:8086\--env=DOCKER_INFLUXDB_INIT_MODE=setup\--env=DOCKER_INFLUXDB_INIT_USERNAME=admin\--env=DOCKER_INFLUXDB_INIT_PASSWORD=secret1234\--env=DOCKER_INFLUXDB_INIT_ORG=example\--env=DOCKER_INFLUXDB_INIT_BUCKET=default\--env=DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=token\--volume="$PWD/var/lib/influxdb2:/var/lib/influxdb2"\influxdb:2.7https://github.com/docker-library/docs/blob/master/influxdb/README.mddockerrun--rm-it--publish=4200:4200--publish=5432:5432\--volume="$PWD/var/lib/cratedb:/data"\crate:5.5-Cdiscovery.type=single-nodehttps://github.com/docker-library/docs/blob/master/crate/README.mdCommand line useHelpinfluxio--helpinfluxioinfoinfluxiocopy--helpImport# From test data to API.
# Choose one of dummy, mixed, dateindex, wide.influxiocopy\"testdata://dateindex/"\"http://example:token@localhost:8086/testdrive/demo"# With selected amount of rows.influxiocopy\"testdata://dateindex/?rows=42"\"http://example:token@localhost:8086/testdrive/demo"# With selected amount of rows and columns (only supported by certain test data sources).influxiocopy\"testdata://wide/?rows=42&columns=42"\"http://example:token@localhost:8086/testdrive/demo"# From line protocol file to API.influxiocopy\"file://tests/testdata/basic.lp"\"http://example:token@localhost:8086/testdrive/demo"# From line protocol file to API.influxiocopy\"https://github.com/influxdata/influxdb2-sample-data/raw/master/air-sensor-data/air-sensor-data.lp"\"http://example:token@localhost:8086/testdrive/demo"Export# From API to database file.influxiocopy\"http://example:token@localhost:8086/testdrive/demo"\"sqlite://export.sqlite?table=demo"# From API to database server.influxiocopy\"http://example:token@localhost:8086/testdrive/demo"\"crate://crate@localhost:4200/testdrive?table=demo"# From API to line protocol file.influxiocopy\"http://example:token@localhost:8086/testdrive/demo"\"file://export.lp"# From data directory to line protocol file.influxiocopy\"file:///path/to/data/engine?org=example&bucket=testdrive&measurement=demo"\"file://export.lp"# From line protocol file to database.influxiocopy\"file://export.lp"\"sqlite://export.sqlite?table=export"OCIOCI images are available on the GitHub Container Registry (GHCR). In order to
run them on Podman or Docker, invoke:dockerrun--rm--network=hostghcr.io/daq-tools/influxio\influxiocopy\"http://example:token@localhost:8086/testdrive/demo"\"stdout://export.lp"If you want to work with files on your filesystem, you will need to either
mount the working directory into the container using the--volumeoption,
or use the--interactiveoption to consume STDIN, like:dockerrun--rm--volume=$(pwd):/dataghcr.io/daq-tools/influxio\influxiocopy"file:///data/export.lp""sqlite:///data/export.sqlite?table=export"catexport.lp|\dockerrun--rm--interactive--network=hostghcr.io/daq-tools/influxio\influxiocopy"stdin://?format=lp""crate://crate@localhost:4200/testdrive/export"In order to always run the latestnightlydevelopment version, and to use a
shortcut for that, this section outlines how to use an alias forinfluxio,
and a variable for storing the input URL. It may be useful to save a few
keystrokes on subsequent invocations.dockerpullghcr.io/daq-tools/influxio:nightlyaliasinfluxio="docker run --rm --interactive ghcr.io/daq-tools/influxio:nightly influxio"SOURCE=https://github.com/daq-tools/influxio/raw/main/tests/testdata/basic.lpTARGET=crate://crate@localhost:4200/testdrive/basicinfluxiocopy"${SOURCE}""${TARGET}"Project informationDevelopmentFor installing the project from source, please follow thedevelopmentdocumentation.Prior artThere are a few other projects which are aiming at similar goals.InfluxDB Fetcherinfluxdb-write-to-postgresql(IW2PG)Outflux