khulnasoft-pandas


Namekhulnasoft-pandas JSON
Version 0.0.46 PyPI version JSON
download
home_pagehttps://github.com/khulnasoft/khulnasoft-pandas/tree/master/
SummaryA helper library for pulling data from khulnasoft into a pandas dataframe.
upload_time2024-06-04 13:51:09
maintainerNone
docs_urlNone
authorKhulnaSoft DevOps
requires_python>=3.6
licenseApache Software License 2.0
keywords khulnasoft pandas
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # khulnasoft-pandas
> A helper library to pull data from khulnasoft api into a pandas dataframe.


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

## Install

`pip install khulnasoft-pandas`

## Documentation

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

## Quickstart

Get some data into a pandas dataframe.

```python
from khulnasoft_pandas.data import get_data

df = get_data('london.my-khulnasoft.com', ['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-khulnasoft.com" : ['system.io','system.ip'],
    "newyork.my-khulnasoft.com" : ['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-khulnasoft.com::system.io|in  \
    time_idx                                         
    1604928340                                 NaN   
    1604928341                                 0.0   
    1604928342                                 0.0   
    1604928343                                 0.0   
    1604928344                                 0.0   
    
                london.my-khulnasoft.com::system.io|out  \
    time_idx                                          
    1604928340                                  NaN   
    1604928341                            -53.89722   
    1604928342                            -26.10278   
    1604928343                              0.00000   
    1604928344                              0.00000   
    
                london.my-khulnasoft.com::system.ip|received  \
    time_idx                                               
    1604928340                                       NaN   
    1604928341                                  49.25227   
    1604928342                                 227.22840   
    1604928343                                 123.56787   
    1604928344                                  31.99060   
    
                london.my-khulnasoft.com::system.ip|sent  \
    time_idx                                           
    1604928340                                   NaN   
    1604928341                             -51.85469   
    1604928342                             -85.22854   
    1604928343                             -43.00154   
    1604928344                             -19.55536   
    
                newyork.my-khulnasoft.com::system.io|in  \
    time_idx                                          
    1604928340                                  0.0   
    1604928341                                  0.0   
    1604928342                                  0.0   
    1604928343                                  0.0   
    1604928344                                  0.0   
    
                newyork.my-khulnasoft.com::system.io|out  \
    time_idx                                           
    1604928340                              0.000000   
    1604928341                             -6.545929   
    1604928342                             -9.454071   
    1604928343                              0.000000   
    1604928344                              0.000000   
    
                newyork.my-khulnasoft.com::system.net|received  \
    time_idx                                                 
    1604928340                                   13.778033   
    1604928341                                   18.281470   
    1604928342                                   24.811770   
    1604928343                                   26.406000   
    1604928344                                   26.457510   
    
                newyork.my-khulnasoft.com::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/khulnasoft/khulnasoft-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/khulnasoft/khulnasoft-pandas/tree/master/",
    "name": "khulnasoft-pandas",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "khulnasoft pandas",
    "author": "KhulnaSoft DevOps",
    "author_email": "admin@khulnasoft.com",
    "download_url": "https://files.pythonhosted.org/packages/8d/f1/9f0792a94b3ec3c66b6ab8a5a6aeb6e9ccf09cdf1ec8316165d0e19c2666/khulnasoft_pandas-0.0.46.tar.gz",
    "platform": null,
    "description": "# khulnasoft-pandas\n> A helper library to pull data from khulnasoft api into a pandas dataframe.\n\n\n[![pypi package](https://img.shields.io/pypi/v/khulnasoft-pandas.svg)](https://pypi.python.org/pypi/khulnasoft-pandas/) \n[![CI](https://github.com/khulnasoft/khulnasoft-pandas/workflows/CI/badge.svg)](https://github.com/khulnasoft/khulnasoft-pandas/actions?query=workflow%3ACI)\n\n## Install\n\n`pip install khulnasoft-pandas`\n\n## Documentation\n\nMore detailed documentation can be found at https://khulnasoft.github.io/khulnasoft-pandas\n\n## Quickstart\n\nGet some data into a pandas dataframe.\n\n```python\nfrom khulnasoft_pandas.data import get_data\n\ndf = get_data('london.my-khulnasoft.com', ['system.cpu','system.load'], after=-60, before=0)\nprint(df.shape)\nprint(df.head())\n```\n\n    (60, 12)\n                system.cpu|guest  system.cpu|guest_nice  system.cpu|iowait  \\\n    time_idx                                                                 \n    1604928205               0.0                    0.0                0.0   \n    1604928206               0.0                    0.0                0.0   \n    1604928207               0.0                    0.0                0.0   \n    1604928208               0.0                    0.0                0.0   \n    1604928209               0.0                    0.0                0.0   \n    \n                system.cpu|irq  system.cpu|nice  system.cpu|softirq  \\\n    time_idx                                                          \n    1604928205             0.0              0.0                 0.0   \n    1604928206             0.0              0.0                 0.0   \n    1604928207             0.0              0.0                 0.0   \n    1604928208             0.0              0.0                 0.0   \n    1604928209             0.0              0.0                 0.0   \n    \n                system.cpu|steal  system.cpu|system  system.cpu|user  \\\n    time_idx                                                           \n    1604928205          0.000000           0.501253         0.501253   \n    1604928206          0.000000           0.753769         0.502513   \n    1604928207          0.000000           0.505050         0.505050   \n    1604928208          0.000000           0.751880         0.501253   \n    1604928209          0.251256           0.251256         0.502513   \n    \n                system.load|load1  system.load|load15  system.load|load5  \n    time_idx                                                              \n    1604928205               0.03                 0.0               0.04  \n    1604928206               0.03                 0.0               0.04  \n    1604928207               0.03                 0.0               0.04  \n    1604928208               0.03                 0.0               0.04  \n    1604928209               0.03                 0.0               0.04  \n\n\nAn alternative way to call `get_data()` is to define what hosts and charts you want via the `host_charts_dict` param:\n\n```python\n# define list of charts for each host you want data for\nhost_charts_dict = {\n    \"london.my-khulnasoft.com\" : ['system.io','system.ip'],\n    \"newyork.my-khulnasoft.com\" : ['system.io','system.net'],\n}\ndf = get_data(host_charts_dict=host_charts_dict, host_prefix=True)\nprint(df.shape)\nprint(df.head())\n```\n\n    (61, 8)\n                london.my-khulnasoft.com::system.io|in  \\\n    time_idx                                         \n    1604928340                                 NaN   \n    1604928341                                 0.0   \n    1604928342                                 0.0   \n    1604928343                                 0.0   \n    1604928344                                 0.0   \n    \n                london.my-khulnasoft.com::system.io|out  \\\n    time_idx                                          \n    1604928340                                  NaN   \n    1604928341                            -53.89722   \n    1604928342                            -26.10278   \n    1604928343                              0.00000   \n    1604928344                              0.00000   \n    \n                london.my-khulnasoft.com::system.ip|received  \\\n    time_idx                                               \n    1604928340                                       NaN   \n    1604928341                                  49.25227   \n    1604928342                                 227.22840   \n    1604928343                                 123.56787   \n    1604928344                                  31.99060   \n    \n                london.my-khulnasoft.com::system.ip|sent  \\\n    time_idx                                           \n    1604928340                                   NaN   \n    1604928341                             -51.85469   \n    1604928342                             -85.22854   \n    1604928343                             -43.00154   \n    1604928344                             -19.55536   \n    \n                newyork.my-khulnasoft.com::system.io|in  \\\n    time_idx                                          \n    1604928340                                  0.0   \n    1604928341                                  0.0   \n    1604928342                                  0.0   \n    1604928343                                  0.0   \n    1604928344                                  0.0   \n    \n                newyork.my-khulnasoft.com::system.io|out  \\\n    time_idx                                           \n    1604928340                              0.000000   \n    1604928341                             -6.545929   \n    1604928342                             -9.454071   \n    1604928343                              0.000000   \n    1604928344                              0.000000   \n    \n                newyork.my-khulnasoft.com::system.net|received  \\\n    time_idx                                                 \n    1604928340                                   13.778033   \n    1604928341                                   18.281470   \n    1604928342                                   24.811770   \n    1604928343                                   26.406000   \n    1604928344                                   26.457510   \n    \n                newyork.my-khulnasoft.com::system.net|sent  \n    time_idx                                            \n    1604928340                               -16.97193  \n    1604928341                               -19.23857  \n    1604928342                               -76.86994  \n    1604928343                              -165.55492  \n    1604928344                              -115.83034  \n\n\n## Examples\n\nYou can find some more examples in the [examples](https://github.com/khulnasoft/khulnasoft-pandas/tree/master/examples) folder. \n\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.\n",
    "bugtrack_url": null,
    "license": "Apache Software License 2.0",
    "summary": "A helper library for pulling data from khulnasoft into a pandas dataframe.",
    "version": "0.0.46",
    "project_urls": {
        "Homepage": "https://github.com/khulnasoft/khulnasoft-pandas/tree/master/"
    },
    "split_keywords": [
        "khulnasoft",
        "pandas"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "eeb6365d9d79443168d17c2083ba91301fde3aef72db7785753b6ad905eaff5a",
                "md5": "cf72f49ab972a0365814bd29fcddbc1c",
                "sha256": "0e6bf701c3d3972c3c4d8e705581c6c9ced1d7e156103e1cc426266ed5f22c49"
            },
            "downloads": -1,
            "filename": "khulnasoft_pandas-0.0.46-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cf72f49ab972a0365814bd29fcddbc1c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 14669,
            "upload_time": "2024-06-04T13:51:08",
            "upload_time_iso_8601": "2024-06-04T13:51:08.409539Z",
            "url": "https://files.pythonhosted.org/packages/ee/b6/365d9d79443168d17c2083ba91301fde3aef72db7785753b6ad905eaff5a/khulnasoft_pandas-0.0.46-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8df19f0792a94b3ec3c66b6ab8a5a6aeb6e9ccf09cdf1ec8316165d0e19c2666",
                "md5": "2bf920d716cd0a07d871769fae62b361",
                "sha256": "8236ce1ece34f1f28619c658eb216c95badb52e5b47eeb52e0c60fa962949b7d"
            },
            "downloads": -1,
            "filename": "khulnasoft_pandas-0.0.46.tar.gz",
            "has_sig": false,
            "md5_digest": "2bf920d716cd0a07d871769fae62b361",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16428,
            "upload_time": "2024-06-04T13:51:09",
            "upload_time_iso_8601": "2024-06-04T13:51:09.971839Z",
            "url": "https://files.pythonhosted.org/packages/8d/f1/9f0792a94b3ec3c66b6ab8a5a6aeb6e9ccf09cdf1ec8316165d0e19c2666/khulnasoft_pandas-0.0.46.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-04 13:51:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "khulnasoft",
    "github_project": "khulnasoft-pandas",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "khulnasoft-pandas"
}
        
Elapsed time: 0.29809s