pym2v


Namepym2v JSON
Version 0.1.4 PyPI version JSON
download
home_pageNone
SummaryPython wrapper to interact with the Eurogard m2v IoT platform
upload_time2025-10-19 15:53:59
maintainerStefan Langenbach
docs_urlNone
authorStefan Langenbach
requires_python>=3.12
licenseNone
keywords eurogard m2v iot iiot api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![CI](https://github.com/bytecaretech/pym2v/actions/workflows/ci.yml/badge.svg)
![Docs](https://github.com/bytecaretech/pym2v/actions/workflows/docs.yml/badge.svg)


# pym2v

Python wrapper to inteact with [m2v][1] industrial IoT platform from [Eurogard][2].

## Prerequisites

- Python 3.12+
- Programmatic access to the Eurogard API

## Installation

py2mv is available as a Python package and can be installed via pip or [uv][3].

### Via pip

1. Create a virtual environment: `python3 -m venv .venv`
1. Activate the virtual environment: `source .venv/bin/active`
1. Install pym2v via pip: `pip install pym2v`

### Via uv

1. Install pym2v via uv: `uv add pym2v`

## Configuration

To authenticate with the Eurogard API, you need to provide the following credentials:

- Username
- Password
- Client ID
- Client Secret

You can do this either by using an `.env` file (recommended) or by setting environment variables directly.

### Using an .env file

Rename the `.env.example` at the root of the project to `.env`, and replace the placeholder values with your actual credentials.

```
EUROGARD_BASEURL=https://eurogard.cloud
EUROGARD_USERNAME=your_username_here
EUROGARD_PASSWORD=your_password_here
EUROGARD_CLIENT_ID=your_client_id_here
EUROGARD_CLIENT_SECRET=your_client_secret_here
```

## Usage

Import the `EuroGardAPI` object and create an instance of it

```python
from pym2v.api import EurogardAPI


api = EurogardAPI()
```

Retrieve a list of machines

```python
machines = api.get_machines()
```

Get the UUID of the machine your are interested in

```python
MACHINE_NAME = "1337Machine"

machine_uuid = api.get_machine_uuid(MACHINE_NAME, machines)
```

Get the names of measurements for which you like to pull data

```python
result = api.get_machine_measurements(machine_uuid)
```

Turn the data returned by the API into a DataFrame for easier handling

```python
measurements_df = pd.DataFrame.from_dict(result["entities"])
```

Get actual data

```python
START_DATE = "2025-01-01"
END_DATE = "2025-01-13"
INTERVAL = "60s"
MAX_FRAME_LENGTH = "30D"

data_df = api.get_long_frame_from_names(
    machine_uuid=machine_uuid,
    names=measurements_df.name.to_list(),
    start=START_DATE,
    end=END_DATE,
    interval=INTERVAL,
    max_frame_length=MAX_FRAME_LENGTH,
)
```

## Contributing

Check out [CONTRIBUTING.md](CONTRIBUTING.md) for further information.


[1]: https://eurogard.de
[2]: https://eurogard.de/software/m2v/
[3]: https://docs.astral.sh/uv/

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pym2v",
    "maintainer": "Stefan Langenbach",
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": "Stefan Langenbach <stefan.langenbach@bytecare.tech>",
    "keywords": "eurogard, m2v, iot, iiot, api",
    "author": "Stefan Langenbach",
    "author_email": "Stefan Langenbach <stefan.langenbach@bytecare.tech>",
    "download_url": "https://files.pythonhosted.org/packages/f1/2c/41acf285d0594873c7755ee3658c8cc822a83a0c68155e725568982b1406/pym2v-0.1.4.tar.gz",
    "platform": null,
    "description": "![CI](https://github.com/bytecaretech/pym2v/actions/workflows/ci.yml/badge.svg)\n![Docs](https://github.com/bytecaretech/pym2v/actions/workflows/docs.yml/badge.svg)\n\n\n# pym2v\n\nPython wrapper to inteact with [m2v][1] industrial IoT platform from [Eurogard][2].\n\n## Prerequisites\n\n- Python 3.12+\n- Programmatic access to the Eurogard API\n\n## Installation\n\npy2mv is available as a Python package and can be installed via pip or [uv][3].\n\n### Via pip\n\n1. Create a virtual environment: `python3 -m venv .venv`\n1. Activate the virtual environment: `source .venv/bin/active`\n1. Install pym2v via pip: `pip install pym2v`\n\n### Via uv\n\n1. Install pym2v via uv: `uv add pym2v`\n\n## Configuration\n\nTo authenticate with the Eurogard API, you need to provide the following credentials:\n\n- Username\n- Password\n- Client ID\n- Client Secret\n\nYou can do this either by using an `.env` file (recommended) or by setting environment variables directly.\n\n### Using an .env file\n\nRename the `.env.example` at the root of the project to `.env`, and replace the placeholder values with your actual credentials.\n\n```\nEUROGARD_BASEURL=https://eurogard.cloud\nEUROGARD_USERNAME=your_username_here\nEUROGARD_PASSWORD=your_password_here\nEUROGARD_CLIENT_ID=your_client_id_here\nEUROGARD_CLIENT_SECRET=your_client_secret_here\n```\n\n## Usage\n\nImport the `EuroGardAPI` object and create an instance of it\n\n```python\nfrom pym2v.api import EurogardAPI\n\n\napi = EurogardAPI()\n```\n\nRetrieve a list of machines\n\n```python\nmachines = api.get_machines()\n```\n\nGet the UUID of the machine your are interested in\n\n```python\nMACHINE_NAME = \"1337Machine\"\n\nmachine_uuid = api.get_machine_uuid(MACHINE_NAME, machines)\n```\n\nGet the names of measurements for which you like to pull data\n\n```python\nresult = api.get_machine_measurements(machine_uuid)\n```\n\nTurn the data returned by the API into a DataFrame for easier handling\n\n```python\nmeasurements_df = pd.DataFrame.from_dict(result[\"entities\"])\n```\n\nGet actual data\n\n```python\nSTART_DATE = \"2025-01-01\"\nEND_DATE = \"2025-01-13\"\nINTERVAL = \"60s\"\nMAX_FRAME_LENGTH = \"30D\"\n\ndata_df = api.get_long_frame_from_names(\n    machine_uuid=machine_uuid,\n    names=measurements_df.name.to_list(),\n    start=START_DATE,\n    end=END_DATE,\n    interval=INTERVAL,\n    max_frame_length=MAX_FRAME_LENGTH,\n)\n```\n\n## Contributing\n\nCheck out [CONTRIBUTING.md](CONTRIBUTING.md) for further information.\n\n\n[1]: https://eurogard.de\n[2]: https://eurogard.de/software/m2v/\n[3]: https://docs.astral.sh/uv/\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python wrapper to interact with the Eurogard m2v IoT platform",
    "version": "0.1.4",
    "project_urls": {
        "Documentation": "https://www.bytecare.tech/pym2v",
        "Homepage": "https://www.bytecare.tech",
        "Repository": "https://github.com/bytecaretech/pym2v"
    },
    "split_keywords": [
        "eurogard",
        " m2v",
        " iot",
        " iiot",
        " api"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d9d597296ed06c9cc841f29badc4ae0fbef4cd90762c5d035d2f5be542a2efac",
                "md5": "2fbb0f937b287402180e198cb3f37131",
                "sha256": "8f6d0bce2afafbbe40bc80593911d23038dc4aa37bbf51bfbcdbae1fc5bb75a8"
            },
            "downloads": -1,
            "filename": "pym2v-0.1.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2fbb0f937b287402180e198cb3f37131",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 20456,
            "upload_time": "2025-10-19T15:53:58",
            "upload_time_iso_8601": "2025-10-19T15:53:58.631013Z",
            "url": "https://files.pythonhosted.org/packages/d9/d5/97296ed06c9cc841f29badc4ae0fbef4cd90762c5d035d2f5be542a2efac/pym2v-0.1.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f12c41acf285d0594873c7755ee3658c8cc822a83a0c68155e725568982b1406",
                "md5": "05d963edfc593c30673040db1b1e9d4e",
                "sha256": "3f2470c34ab9f3fc4309f35444920e5deb84e0b05131ab5f735ef32b4280df6b"
            },
            "downloads": -1,
            "filename": "pym2v-0.1.4.tar.gz",
            "has_sig": false,
            "md5_digest": "05d963edfc593c30673040db1b1e9d4e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 20201,
            "upload_time": "2025-10-19T15:53:59",
            "upload_time_iso_8601": "2025-10-19T15:53:59.688121Z",
            "url": "https://files.pythonhosted.org/packages/f1/2c/41acf285d0594873c7755ee3658c8cc822a83a0c68155e725568982b1406/pym2v-0.1.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-19 15:53:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bytecaretech",
    "github_project": "pym2v",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pym2v"
}
        
Elapsed time: 1.72597s