eventum-core


Nameeventum-core JSON
Version 1.0.8 PyPI version JSON
download
home_pagehttps://github.com/Eventum-Generatives/EventumCore
SummaryFlexible event generator
upload_time2024-06-08 14:47:47
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/9a/96/fe0b26aa708314ab44b275d042ed051d715b7cca36083641448b30ec0303/eventum_core-1.0.8.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.0.8",
    "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": "75cacb55e3965f3a138c19974f366b876a4816a39ff9ff9f0a2a0a0b815ab972",
                "md5": "97758ea40fd504d780dc39cbecc540fa",
                "sha256": "661f86e7f226926efb9969af47a9458be7738c2b6102a4bf92e4e789eacbc187"
            },
            "downloads": -1,
            "filename": "eventum_core-1.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "97758ea40fd504d780dc39cbecc540fa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 16576,
            "upload_time": "2024-06-08T14:47:45",
            "upload_time_iso_8601": "2024-06-08T14:47:45.759952Z",
            "url": "https://files.pythonhosted.org/packages/75/ca/cb55e3965f3a138c19974f366b876a4816a39ff9ff9f0a2a0a0b815ab972/eventum_core-1.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9a96fe0b26aa708314ab44b275d042ed051d715b7cca36083641448b30ec0303",
                "md5": "983f6e64ada6d5acbdc99662811edd65",
                "sha256": "b2008b1f7247753222d79c1c61988e7e682c0d190a91893a71ce5871020b2cd0"
            },
            "downloads": -1,
            "filename": "eventum_core-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "983f6e64ada6d5acbdc99662811edd65",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 15976,
            "upload_time": "2024-06-08T14:47:47",
            "upload_time_iso_8601": "2024-06-08T14:47:47.372729Z",
            "url": "https://files.pythonhosted.org/packages/9a/96/fe0b26aa708314ab44b275d042ed051d715b7cca36083641448b30ec0303/eventum_core-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-08 14:47:47",
    "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.55752s