Presents CSV datasets to mosaik as models.
Project description
mosaik-csv
This is pseudo simulator that presents CSV data sets to mosaik as models.
The following code shows an example how to use the mosaik-csv simulator. The date_format and delimiter parameter are optional. If they are not defined the standard value is ‘YYYY-MM-DD HH:mm:ss’ for the date_format and ‘,’ for delimiter.
$ sim_config = { $ ‘CSV’: { $ ‘python’: ‘mosaik_csv:CSV’, $ } $ } $ world = mosaik.World(sim_config) $ csv_sim = world.start(‘CSV’, sim_start=’01.01.2016 00:00’, $ datafile=’data.csv’, $ date_format=’DD.MM.YYYY HH:mm’, $ delimiter=’,’) $ csv = csv_sim.CSV.create(20)
Installation
$ pip install mosaik-csv
Tests
You can run the tests with:
$ git clone https://gitlab.com/mosaik/mosaik-csv.git $ cd mosaik-csv $ pip install -r requirements.txt $ pip install -e . $ py.test $ tox
If installation of psutil fails, installing python developer edition and gcc should help:
$ sudo apt-get install gcc python3-dev
Changelog
1.1.0 - 2021-03-11
[FEATURE] Allow to define the delimiter.
[FEATURE] Allow to define the date format.
1.0.4 - 2021-03-04
[CHANGE] Adjustment to new arrow API.
1.0.3 – 2019-10-10
[CHANGE] Added closing of input file.
[CHANGE] Adjustment to new arrow API.
1.0.2 – 2014-09-22
[CHANGE] Updated to mosaik-api 2.0.
1.0.1 – 2014-06-23
[CHANGE] Updated to mosaik-api 2.0a3.
1.0 – 2014-03-26
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mosaik_csv-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dd9c37d520456586d4f4334b79b8a3463eb125ed2750417692f22b379b659cd |
|
MD5 | d2e9a78af7c3fa2866e22b8fd94233b1 |
|
BLAKE2b-256 | e7fe7f6fc339f9a9788f4edc014e7bceb78fc8191dd83ffefeea6307d7af7175 |