eventum-core


Nameeventum-core JSON
Version 1.1.4 PyPI version JSON
download
home_pagehttps://github.com/Eventum-Generatives/EventumCore
SummaryFlexible event generator
upload_time2024-07-31 05:26:23
maintainerNone
docs_urlNone
authorNikita Reznikov
requires_python<4.0,>=3.11
licenseApache-2.0
keywords generator testing data event
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Eventum

## What is Eventum

**[Eventum](https://eventum-generatives.github.io/Website/)** is a flexible event generator that provides synthetic data for various purposes.

The most popular tasks where Eventum is used are:
- Generation of datasets
- Simulation of processes in real time
- Filling different systems with demo data
- Testing on arbitrary data and stress testing


## How it works
The working pipeline of Eventum consists of three parts:
- **Input plugin** - it creates signals in time represented as timestamps
- **Event plugin** - for each incoming signal, renders the event according to the template
- **Output plugin** - sends generated events to specified endpoints

Thus, to launch the application you only need to set parameters for these three parts in a single configuration file.

You may notice that parts are called "plugins". It is so because in addition to using existing ones, you can develop your own plugins and use them easily.

## Events Scheduling 
### Time modes
Eventum supports two time modes:
- **Sample mode** - it is applicable when you want to generate events without reference to the present time (e.g. create a dataset)
- **Live mode** - in this case, each event will be published as the present time passes event timestamp

### Scheduling methods
With the variety of input plugins you can flexibly adjust when to generate the events. For example, in case when events linearly spaced in time you can use **Timer input plugin** for live mode and **Linspace input plugin** for sample mode. For more detailed uncomplicated scheduling the **Cron input plugin** is a great choice. If you want maximum flexibility, then just use **Time patterns input plugin** which offers you to operate probability distribution functions and mix them if needed.

## Event Templates
### Stateful rendering
In the default event plugin Eventum uses Jinja template engine. With basic use of Jinja, we cannot access variables from previous template renders. But with **State API** of **Jinja event plugin** it is easy to achieve it.

Template:
```javascript
{% set id = locals.get('id', 1) %}

{
    "userID": {{ id }}
}

{% set id = locals.set('id', id + 1) %}
```

Output:
```json
// first render
{
    "userID": 1,
}
// second render
{
    "userID": 2,
}
```

### Use your own samples 
It's easy to use data samples in templates because Jinja event plugin provides **Sample API**.

Need to change data in your events? - Just update your sample and keep template without any changes.

Template:
```javascript
{% set computer = samples.computers | random %}
{% set hostname = computer[0] %}
{% set ip = computer[1] %}

{
    "sampleRow": "{{ computer }}",
    "hostname": "{{ hostname }}",
    "ip": "{{ ip }}"
}
```

Output:
```json
{
    "sampleRow": "('wks02', '172.16.0.4')",
    "hostname": "wks02",
    "ip": "172.16.0.4"
}
```

In the above example, sample `computers` is accessed by its alias which is set along with the csv file path in application configuration.

### Connect to reality
Eventum is not only about synthetic data. You can run subprocesses and obtain their result in templates using **Subprocess API**.

Template:
```javascript
{% set my_name = subprocess.run('git config user.name', true) | trim %}

{
    "name": "Shell says, that I'm {{ my_name }}"
}
```

Output:
```json
{
    "name": "Shell says, that I'm Nikita Reznikov"
}
```

### Use modules
You are able to write any python function and run it from template just referencing to it. For example there is default module named **`rand`** with different functions for generating random values.

```javascript
{% set ip = rand.network.ip_v4() %}

{
    "ip": "{{ ip }}"
}
```
Output:
```json
{
    "ip": "244.203.128.130"
}
```

Content of `rand.py`:
```py
...
class network:
    @staticmethod
    def ip_v4() -> str:
        """Return random IPv4 address."""
        return '.'.join(str(random.randint(0, 255)) for _ in range(4))
...
```

The only think you need to do to make this work is to put your python module to `jinja_modules` directory of Jinja event plugin. All modules in this directory are accessible from all templates.

## Outputting
### Send events anywhere
Direct your generated events with output plugins easily. Use different destinations like stdout, files, OpenSearch. There is also the possibility to specify multiple destination per running instance of Eventum. That gives you the flexibility to manage and utilize your data as needed.

## Designing with Eventum Studio

**Eventum Studio** is the important part of Eventum that empowers you to develop content such as time distribution configurations and event templates in user friendly way.

Using Eventum Studio you can change parameters and visualize the result on the fly.

It's available to edit event templates, render them with pretty highlighting and even debug them by exploring state of render runs. Once you are done with it, you can save your result to file directly from Eventum Studio interface.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Eventum-Generatives/EventumCore",
    "name": "eventum-core",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": "generator, testing, data, event",
    "author": "Nikita Reznikov",
    "author_email": "nikita.reznikov.public@mail.ru",
    "download_url": "https://files.pythonhosted.org/packages/11/08/563d8a2f943f898e62f869b9ce138d42d70a2b9c03b4430b040ed0de9496/eventum_core-1.1.4.tar.gz",
    "platform": null,
    "description": "# Eventum\n\n## What is Eventum\n\n**[Eventum](https://eventum-generatives.github.io/Website/)** is a flexible event generator that provides synthetic data for various purposes.\n\nThe most popular tasks where Eventum is used are:\n- Generation of datasets\n- Simulation of processes in real time\n- Filling different systems with demo data\n- Testing on arbitrary data and stress testing\n\n\n## How it works\nThe working pipeline of Eventum consists of three parts:\n- **Input plugin** - it creates signals in time represented as timestamps\n- **Event plugin** - for each incoming signal, renders the event according to the template\n- **Output plugin** - sends generated events to specified endpoints\n\nThus, to launch the application you only need to set parameters for these three parts in a single configuration file.\n\nYou may notice that parts are called \"plugins\". It is so because in addition to using existing ones, you can develop your own plugins and use them easily.\n\n## Events Scheduling \n### Time modes\nEventum supports two time modes:\n- **Sample mode** - it is applicable when you want to generate events without reference to the present time (e.g. create a dataset)\n- **Live mode** - in this case, each event will be published as the present time passes event timestamp\n\n### Scheduling methods\nWith the variety of input plugins you can flexibly adjust when to generate the events. For example, in case when events linearly spaced in time you can use **Timer input plugin** for live mode and **Linspace input plugin** for sample mode. For more detailed uncomplicated scheduling the **Cron input plugin** is a great choice. If you want maximum flexibility, then just use **Time patterns input plugin** which offers you to operate probability distribution functions and mix them if needed.\n\n## Event Templates\n### Stateful rendering\nIn the default event plugin Eventum uses Jinja template engine. With basic use of Jinja, we cannot access variables from previous template renders. But with **State API** of **Jinja event plugin** it is easy to achieve it.\n\nTemplate:\n```javascript\n{% set id = locals.get('id', 1) %}\n\n{\n    \"userID\": {{ id }}\n}\n\n{% set id = locals.set('id', id + 1) %}\n```\n\nOutput:\n```json\n// first render\n{\n    \"userID\": 1,\n}\n// second render\n{\n    \"userID\": 2,\n}\n```\n\n### Use your own samples \nIt's easy to use data samples in templates because Jinja event plugin provides **Sample API**.\n\nNeed to change data in your events? - Just update your sample and keep template without any changes.\n\nTemplate:\n```javascript\n{% set computer = samples.computers | random %}\n{% set hostname = computer[0] %}\n{% set ip = computer[1] %}\n\n{\n    \"sampleRow\": \"{{ computer }}\",\n    \"hostname\": \"{{ hostname }}\",\n    \"ip\": \"{{ ip }}\"\n}\n```\n\nOutput:\n```json\n{\n    \"sampleRow\": \"('wks02', '172.16.0.4')\",\n    \"hostname\": \"wks02\",\n    \"ip\": \"172.16.0.4\"\n}\n```\n\nIn the above example, sample `computers` is accessed by its alias which is set along with the csv file path in application configuration.\n\n### Connect to reality\nEventum is not only about synthetic data. You can run subprocesses and obtain their result in templates using **Subprocess API**.\n\nTemplate:\n```javascript\n{% set my_name = subprocess.run('git config user.name', true) | trim %}\n\n{\n    \"name\": \"Shell says, that I'm {{ my_name }}\"\n}\n```\n\nOutput:\n```json\n{\n    \"name\": \"Shell says, that I'm Nikita Reznikov\"\n}\n```\n\n### Use modules\nYou are able to write any python function and run it from template just referencing to it. For example there is default module named **`rand`** with different functions for generating random values.\n\n```javascript\n{% set ip = rand.network.ip_v4() %}\n\n{\n    \"ip\": \"{{ ip }}\"\n}\n```\nOutput:\n```json\n{\n    \"ip\": \"244.203.128.130\"\n}\n```\n\nContent of `rand.py`:\n```py\n...\nclass network:\n    @staticmethod\n    def ip_v4() -> str:\n        \"\"\"Return random IPv4 address.\"\"\"\n        return '.'.join(str(random.randint(0, 255)) for _ in range(4))\n...\n```\n\nThe only think you need to do to make this work is to put your python module to `jinja_modules` directory of Jinja event plugin. All modules in this directory are accessible from all templates.\n\n## Outputting\n### Send events anywhere\nDirect your generated events with output plugins easily. Use different destinations like stdout, files, OpenSearch. There is also the possibility to specify multiple destination per running instance of Eventum. That gives you the flexibility to manage and utilize your data as needed.\n\n## Designing with Eventum Studio\n\n**Eventum Studio** is the important part of Eventum that empowers you to develop content such as time distribution configurations and event templates in user friendly way.\n\nUsing Eventum Studio you can change parameters and visualize the result on the fly.\n\nIt's available to edit event templates, render them with pretty highlighting and even debug them by exploring state of render runs. Once you are done with it, you can save your result to file directly from Eventum Studio interface.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Flexible event generator",
    "version": "1.1.4",
    "project_urls": {
        "Documentation": "https://eventum-generatives.github.io/Website/",
        "Homepage": "https://github.com/Eventum-Generatives/EventumCore",
        "Repository": "https://github.com/Eventum-Generatives/EventumCore"
    },
    "split_keywords": [
        "generator",
        " testing",
        " data",
        " event"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3bac6cff9df9dcbbfe28d31d77ef20227000e4764b97dc7b2818ec03c6955b3e",
                "md5": "0fc663fec624c5573e8d06635a8bffa2",
                "sha256": "fffd7092821b779cbc1e3b1ba4eddf8294a19c32ad6e50e9cc9e3dedbbbed2a2"
            },
            "downloads": -1,
            "filename": "eventum_core-1.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0fc663fec624c5573e8d06635a8bffa2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 15813,
            "upload_time": "2024-07-31T05:26:21",
            "upload_time_iso_8601": "2024-07-31T05:26:21.744811Z",
            "url": "https://files.pythonhosted.org/packages/3b/ac/6cff9df9dcbbfe28d31d77ef20227000e4764b97dc7b2818ec03c6955b3e/eventum_core-1.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1108563d8a2f943f898e62f869b9ce138d42d70a2b9c03b4430b040ed0de9496",
                "md5": "65b2dd24a1293a777103dfe4a65f1d82",
                "sha256": "df88f62664c557c712e9f8cf9128759c0308a520c96522dcef3502fdc14695e5"
            },
            "downloads": -1,
            "filename": "eventum_core-1.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "65b2dd24a1293a777103dfe4a65f1d82",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 15418,
            "upload_time": "2024-07-31T05:26:23",
            "upload_time_iso_8601": "2024-07-31T05:26:23.546623Z",
            "url": "https://files.pythonhosted.org/packages/11/08/563d8a2f943f898e62f869b9ce138d42d70a2b9c03b4430b040ed0de9496/eventum_core-1.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-31 05:26:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Eventum-Generatives",
    "github_project": "EventumCore",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "eventum-core"
}
        
Elapsed time: 0.29091s