Skip to main content

mosaik-influxdb2

Description

This package contains an adapter to write data from a mosaik simulation into an InfluxDB 2 database.

Usage

To use the simulator, first add it to your sim_config:

sim_config = {
    "InfluxWriter": {"python": "mosaik.influxdb2.writer:Simulator"},
    # ...
}

Next, you need to start the simulator. Here, you have two choices to make:

  1. The simulator can run both in time-based mode with a fixed step size or in event-based mode without a step size. You can choose the time-based mode by giving the parameter step_size when starting the simulator. If you give step_size=None (or don’t specify anything), the simulator will use the event-based mode.
  2. You can either supply a start date (as a string parseable by Python’s datetime module) which will be combined with the (mosaik) time and time resolution to calculate each step’s time, or you can supply the time for each step on the local_time attribute (again, as a string). If you give both, the value on the local_time attribute will take precedence.

So one possible invocation would be

influx_sim = world.start("InfluxWriter",
    step_size=900,
    start_date="2022-01-01 00:00:00Z",
)

to start the simulator in time-based mode with a step size of 900 and times based on the given start date. You can leave off either argument with the effects described above.

Finally, the model needs to be started with your Influx credentials:

influx = influx_sim.Database(
    url="http://localhost:8086",
    org='.',
    bucket='my_bucket',
    token='secret_token',
    measurement='experiment_0001'
)

We recommend setting a new value for the measurement on each simulation run. (For example, you can use the start time of your simulation or a random UUID.)

Afterwards, you can define world.connect(other_entity, influx, attrs) as you like.

The simulator supports only one instance of the Database model. If you want to connect to several databases, you will need to start several instances of the simulator as well.

Metadata

Release files for mosaik-influxdb2 0.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 mosaik-influxdb2 0.1.0
File Size Uploaded Provenance Actions
mosaik_influxdb2-0.1.0.tar.gz 4.8 kB Without provenance Details for mosaik_influxdb2-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mosaik-influxdb2 0.1.0
File Interpreter ABI Platform Actions
mosaik_influxdb2-0.1.0-py3-none-any.whl Python 3 none any Details for mosaik_influxdb2-0.1.0-py3-none-any.whl

Total release size: 9.9 kB

Release files / mosaik_influxdb2-0.1.0.tar.gz

Download URL mosaik_influxdb2-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b347f2520f81f9de531974984a982f2d162fdb1dda7e0f9e303f706d0aada969
BLAKE2b-256 checksum
How to use checksums
8addef08bca83462c30b4cdd7b98e468f9465f76191a4f977ad2ae0e91cf386f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.9 Linux/5.4.109+

Release files / mosaik_influxdb2-0.1.0-py3-none-any.whl

Download URL mosaik_influxdb2-0.1.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d8182b832b227d6748948f192065635d2f2374c3b6b88481d6f333cb4f928cc
BLAKE2b-256 checksum
How to use checksums
7249c60dde8deb9389475dffe118dae328c34b5308bf2d9169a55766052d4f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.1 CPython/3.10.9 Linux/5.4.109+

Security for mosaik-influxdb2 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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