Skip to main content

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 .
$ pytest tests

If installation of psutil fails, installing python developer edition and gcc should help:

$ sudo apt-get install gcc python3-dev

Changelog

1.2.0 - 2021-05-21

  • [CHANGE] Updated to mosaik-api 3.0.

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

Authors

The mosaik CSV reader was created by Stefan Scherfke.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mosaik-csv-1.2.0.tar.gz (12.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mosaik_csv-1.2.0-py2.py3-none-any.whl (12.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file mosaik-csv-1.2.0.tar.gz.

File metadata

  • Download URL: mosaik-csv-1.2.0.tar.gz
  • Upload date:
  • Size: 12.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for mosaik-csv-1.2.0.tar.gz
Algorithm Hash digest
SHA256 9a64e2d1c410ea1a979b4dd2c923464ba746a306a2a7ee10f2bd485137fa975a
MD5 da3373c0a0c1012d0e71f6d3f88925df
BLAKE2b-256 2eaeac69af7872f0d06cecfb473b0ba8a95c603ef1a04ee7aa4c8a224b5028d8

See more details on using hashes here.

File details

Details for the file mosaik_csv-1.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: mosaik_csv-1.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.10

File hashes

Hashes for mosaik_csv-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 977f8304ebf1b54e8a52936e7031740331c0bba6ea97c1ac8d64056719d48b16
MD5 f4b7b0a29a41320b548a08d3edd749ed
BLAKE2b-256 c51a1c7c30e4d3a885641d35db9c8658b64d1790d7aeb6918c58cc650eab8a41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page