netdata-pandas


Namenetdata-pandas JSON
Version 0.0.45 PyPI version JSON
download
home_pagehttps://github.com/netdata/netdata-pandas/tree/master/
SummaryA helper library for pulling data from netdata into a pandas dataframe.
upload_time2023-04-11 17:10:24
maintainer
docs_urlNone
authorAndrew Maguire
requires_python>=3.6
licenseApache Software License 2.0
keywords netdata pandas
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # netdata-pandas
> A helper library to pull data from netdata api into a pandas dataframe.


[![pypi package](https://img.shields.io/pypi/v/netdata-pandas.svg)](https://pypi.python.org/pypi/netdata-pandas/) 
[![CI](https://github.com/netdata/netdata-pandas/workflows/CI/badge.svg)](https://github.com/netdata/netdata-pandas/actions?query=workflow%3ACI)

## Install

`pip install netdata-pandas`

## Documentation

More detailed documentation can be found at https://netdata.github.io/netdata-pandas

## Quickstart

Get some data into a pandas dataframe.

```python
from netdata_pandas.data import get_data

df = get_data('london.my-netdata.io', ['system.cpu','system.load'], after=-60, before=0)
print(df.shape)
print(df.head())
```

    (60, 12)
                system.cpu|guest  system.cpu|guest_nice  system.cpu|iowait  \
    time_idx                                                                 
    1604928205               0.0                    0.0                0.0   
    1604928206               0.0                    0.0                0.0   
    1604928207               0.0                    0.0                0.0   
    1604928208               0.0                    0.0                0.0   
    1604928209               0.0                    0.0                0.0   
    
                system.cpu|irq  system.cpu|nice  system.cpu|softirq  \
    time_idx                                                          
    1604928205             0.0              0.0                 0.0   
    1604928206             0.0              0.0                 0.0   
    1604928207             0.0              0.0                 0.0   
    1604928208             0.0              0.0                 0.0   
    1604928209             0.0              0.0                 0.0   
    
                system.cpu|steal  system.cpu|system  system.cpu|user  \
    time_idx                                                           
    1604928205          0.000000           0.501253         0.501253   
    1604928206          0.000000           0.753769         0.502513   
    1604928207          0.000000           0.505050         0.505050   
    1604928208          0.000000           0.751880         0.501253   
    1604928209          0.251256           0.251256         0.502513   
    
                system.load|load1  system.load|load15  system.load|load5  
    time_idx                                                              
    1604928205               0.03                 0.0               0.04  
    1604928206               0.03                 0.0               0.04  
    1604928207               0.03                 0.0               0.04  
    1604928208               0.03                 0.0               0.04  
    1604928209               0.03                 0.0               0.04  


An alternative way to call `get_data()` is to define what hosts and charts you want via the `host_charts_dict` param:

```python
# define list of charts for each host you want data for
host_charts_dict = {
    "london.my-netdata.io" : ['system.io','system.ip'],
    "newyork.my-netdata.io" : ['system.io','system.net'],
}
df = get_data(host_charts_dict=host_charts_dict, host_prefix=True)
print(df.shape)
print(df.head())
```

    (61, 8)
                london.my-netdata.io::system.io|in  \
    time_idx                                         
    1604928340                                 NaN   
    1604928341                                 0.0   
    1604928342                                 0.0   
    1604928343                                 0.0   
    1604928344                                 0.0   
    
                london.my-netdata.io::system.io|out  \
    time_idx                                          
    1604928340                                  NaN   
    1604928341                            -53.89722   
    1604928342                            -26.10278   
    1604928343                              0.00000   
    1604928344                              0.00000   
    
                london.my-netdata.io::system.ip|received  \
    time_idx                                               
    1604928340                                       NaN   
    1604928341                                  49.25227   
    1604928342                                 227.22840   
    1604928343                                 123.56787   
    1604928344                                  31.99060   
    
                london.my-netdata.io::system.ip|sent  \
    time_idx                                           
    1604928340                                   NaN   
    1604928341                             -51.85469   
    1604928342                             -85.22854   
    1604928343                             -43.00154   
    1604928344                             -19.55536   
    
                newyork.my-netdata.io::system.io|in  \
    time_idx                                          
    1604928340                                  0.0   
    1604928341                                  0.0   
    1604928342                                  0.0   
    1604928343                                  0.0   
    1604928344                                  0.0   
    
                newyork.my-netdata.io::system.io|out  \
    time_idx                                           
    1604928340                              0.000000   
    1604928341                             -6.545929   
    1604928342                             -9.454071   
    1604928343                              0.000000   
    1604928344                              0.000000   
    
                newyork.my-netdata.io::system.net|received  \
    time_idx                                                 
    1604928340                                   13.778033   
    1604928341                                   18.281470   
    1604928342                                   24.811770   
    1604928343                                   26.406000   
    1604928344                                   26.457510   
    
                newyork.my-netdata.io::system.net|sent  
    time_idx                                            
    1604928340                               -16.97193  
    1604928341                               -19.23857  
    1604928342                               -76.86994  
    1604928343                              -165.55492  
    1604928344                              -115.83034  


## Examples

You can find some more examples in the [examples](https://github.com/netdata/netdata-pandas/tree/master/examples) folder. 

Or if you just want to play with it right now you can use [this Google Colab notebook](https://colab.research.google.com/drive/1SGF3Ij1r8gNJOwdk-3cVhCvyUGwGiTnc?usp=sharing) to quickly get started.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/netdata/netdata-pandas/tree/master/",
    "name": "netdata-pandas",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "netdata pandas",
    "author": "Andrew Maguire",
    "author_email": "andrewmaguire@netdata.cloud",
    "download_url": "https://files.pythonhosted.org/packages/19/f4/b49636aafa3eb586443955c693e1826a2aae1c208c825d9a2c01557374a5/netdata_pandas-0.0.45.tar.gz",
    "platform": null,
    "description": "# netdata-pandas\r\n> A helper library to pull data from netdata api into a pandas dataframe.\r\n\r\n\r\n[![pypi package](https://img.shields.io/pypi/v/netdata-pandas.svg)](https://pypi.python.org/pypi/netdata-pandas/) \r\n[![CI](https://github.com/netdata/netdata-pandas/workflows/CI/badge.svg)](https://github.com/netdata/netdata-pandas/actions?query=workflow%3ACI)\r\n\r\n## Install\r\n\r\n`pip install netdata-pandas`\r\n\r\n## Documentation\r\n\r\nMore detailed documentation can be found at https://netdata.github.io/netdata-pandas\r\n\r\n## Quickstart\r\n\r\nGet some data into a pandas dataframe.\r\n\r\n```python\r\nfrom netdata_pandas.data import get_data\r\n\r\ndf = get_data('london.my-netdata.io', ['system.cpu','system.load'], after=-60, before=0)\r\nprint(df.shape)\r\nprint(df.head())\r\n```\r\n\r\n    (60, 12)\r\n                system.cpu|guest  system.cpu|guest_nice  system.cpu|iowait  \\\r\n    time_idx                                                                 \r\n    1604928205               0.0                    0.0                0.0   \r\n    1604928206               0.0                    0.0                0.0   \r\n    1604928207               0.0                    0.0                0.0   \r\n    1604928208               0.0                    0.0                0.0   \r\n    1604928209               0.0                    0.0                0.0   \r\n    \r\n                system.cpu|irq  system.cpu|nice  system.cpu|softirq  \\\r\n    time_idx                                                          \r\n    1604928205             0.0              0.0                 0.0   \r\n    1604928206             0.0              0.0                 0.0   \r\n    1604928207             0.0              0.0                 0.0   \r\n    1604928208             0.0              0.0                 0.0   \r\n    1604928209             0.0              0.0                 0.0   \r\n    \r\n                system.cpu|steal  system.cpu|system  system.cpu|user  \\\r\n    time_idx                                                           \r\n    1604928205          0.000000           0.501253         0.501253   \r\n    1604928206          0.000000           0.753769         0.502513   \r\n    1604928207          0.000000           0.505050         0.505050   \r\n    1604928208          0.000000           0.751880         0.501253   \r\n    1604928209          0.251256           0.251256         0.502513   \r\n    \r\n                system.load|load1  system.load|load15  system.load|load5  \r\n    time_idx                                                              \r\n    1604928205               0.03                 0.0               0.04  \r\n    1604928206               0.03                 0.0               0.04  \r\n    1604928207               0.03                 0.0               0.04  \r\n    1604928208               0.03                 0.0               0.04  \r\n    1604928209               0.03                 0.0               0.04  \r\n\r\n\r\nAn alternative way to call `get_data()` is to define what hosts and charts you want via the `host_charts_dict` param:\r\n\r\n```python\r\n# define list of charts for each host you want data for\r\nhost_charts_dict = {\r\n    \"london.my-netdata.io\" : ['system.io','system.ip'],\r\n    \"newyork.my-netdata.io\" : ['system.io','system.net'],\r\n}\r\ndf = get_data(host_charts_dict=host_charts_dict, host_prefix=True)\r\nprint(df.shape)\r\nprint(df.head())\r\n```\r\n\r\n    (61, 8)\r\n                london.my-netdata.io::system.io|in  \\\r\n    time_idx                                         \r\n    1604928340                                 NaN   \r\n    1604928341                                 0.0   \r\n    1604928342                                 0.0   \r\n    1604928343                                 0.0   \r\n    1604928344                                 0.0   \r\n    \r\n                london.my-netdata.io::system.io|out  \\\r\n    time_idx                                          \r\n    1604928340                                  NaN   \r\n    1604928341                            -53.89722   \r\n    1604928342                            -26.10278   \r\n    1604928343                              0.00000   \r\n    1604928344                              0.00000   \r\n    \r\n                london.my-netdata.io::system.ip|received  \\\r\n    time_idx                                               \r\n    1604928340                                       NaN   \r\n    1604928341                                  49.25227   \r\n    1604928342                                 227.22840   \r\n    1604928343                                 123.56787   \r\n    1604928344                                  31.99060   \r\n    \r\n                london.my-netdata.io::system.ip|sent  \\\r\n    time_idx                                           \r\n    1604928340                                   NaN   \r\n    1604928341                             -51.85469   \r\n    1604928342                             -85.22854   \r\n    1604928343                             -43.00154   \r\n    1604928344                             -19.55536   \r\n    \r\n                newyork.my-netdata.io::system.io|in  \\\r\n    time_idx                                          \r\n    1604928340                                  0.0   \r\n    1604928341                                  0.0   \r\n    1604928342                                  0.0   \r\n    1604928343                                  0.0   \r\n    1604928344                                  0.0   \r\n    \r\n                newyork.my-netdata.io::system.io|out  \\\r\n    time_idx                                           \r\n    1604928340                              0.000000   \r\n    1604928341                             -6.545929   \r\n    1604928342                             -9.454071   \r\n    1604928343                              0.000000   \r\n    1604928344                              0.000000   \r\n    \r\n                newyork.my-netdata.io::system.net|received  \\\r\n    time_idx                                                 \r\n    1604928340                                   13.778033   \r\n    1604928341                                   18.281470   \r\n    1604928342                                   24.811770   \r\n    1604928343                                   26.406000   \r\n    1604928344                                   26.457510   \r\n    \r\n                newyork.my-netdata.io::system.net|sent  \r\n    time_idx                                            \r\n    1604928340                               -16.97193  \r\n    1604928341                               -19.23857  \r\n    1604928342                               -76.86994  \r\n    1604928343                              -165.55492  \r\n    1604928344                              -115.83034  \r\n\r\n\r\n## Examples\r\n\r\nYou can find some more examples in the [examples](https://github.com/netdata/netdata-pandas/tree/master/examples) folder. \r\n\r\nOr if you just want to play with it right now you can use [this Google Colab notebook](https://colab.research.google.com/drive/1SGF3Ij1r8gNJOwdk-3cVhCvyUGwGiTnc?usp=sharing) to quickly get started.\r\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "A helper library for pulling data from netdata into a pandas dataframe.",
    "version": "0.0.45",
    "split_keywords": [
        "netdata",
        "pandas"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "201aa96a6e404216bea148f94bb1516f368f7d5984b7e48cd1754a1073056899",
                "md5": "5ad25ccf2b174a7ecfbb32c800b4c4fe",
                "sha256": "4abd7d827e33251b5c3ab198a24ee09b9b07a6ce03e2874f3051f73c284db9c8"
            },
            "downloads": -1,
            "filename": "netdata_pandas-0.0.45-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5ad25ccf2b174a7ecfbb32c800b4c4fe",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 14561,
            "upload_time": "2023-04-11T17:08:48",
            "upload_time_iso_8601": "2023-04-11T17:08:48.861155Z",
            "url": "https://files.pythonhosted.org/packages/20/1a/a96a6e404216bea148f94bb1516f368f7d5984b7e48cd1754a1073056899/netdata_pandas-0.0.45-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "19f4b49636aafa3eb586443955c693e1826a2aae1c208c825d9a2c01557374a5",
                "md5": "cabdeefc3a85b1d2acbc4dfb2c8bd82b",
                "sha256": "0994387436bc26172b6c3a119c1293b30cec03eb60221787080b3df7cfd5cbc1"
            },
            "downloads": -1,
            "filename": "netdata_pandas-0.0.45.tar.gz",
            "has_sig": false,
            "md5_digest": "cabdeefc3a85b1d2acbc4dfb2c8bd82b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16419,
            "upload_time": "2023-04-11T17:10:24",
            "upload_time_iso_8601": "2023-04-11T17:10:24.607028Z",
            "url": "https://files.pythonhosted.org/packages/19/f4/b49636aafa3eb586443955c693e1826a2aae1c208c825d9a2c01557374a5/netdata_pandas-0.0.45.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-11 17:10:24",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "netdata-pandas"
}
        
Elapsed time: 0.05615s