shellic


Nameshellic JSON
Version 0.0.5 PyPI version JSON
download
home_pagehttps://github.com/sayanarijit/shellic
SummaryHuman readable data format for shell outputs
upload_time2018-04-15 13:31:44
maintainer
docs_urlNone
authorArijit Basu
requires_python
licenseMIT
keywords python shell output parsing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # shellic
[![PyPI version](https://img.shields.io/pypi/v/shellic.svg)](https://pypi.org/pypi/shellic)

Human readable data format for shell outputs


## Data format

```
[: ping: success :]
[: ssh: success :]
[: kernel: Linux :]
[: mounted_file_systems :]
Filesystem      Size  Used Avail Use% Mounted on
udev            3.4G     0  3.4G   0% /dev
tmpfs           692M   19M  674M   3% /run
/dev/sda5        63G   18G   42G  30% /
tmpfs           3.4G   35M  3.4G   2% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.4G     0  3.4G   0% /sys/fs/cgroup
/dev/sda4        55G   38G   15G  73% /mnt/vmdisks
/dev/sda3        92G   79G  8.9G  90% /home
/dev/sda1       9.4G   12M  9.3G   1% /boot/efi
tmpfs           692M   20K  692M   1% /run/user/128
tmpfs           692M  1.8M  690M   1% /run/user/1000
[: --- :]
[: uptime :]
17:06:56 up  4:39,  2 users,  load average: 0.81, 0.55, 0.43
```


## Usage

### Encode data

```python
from shellic.encoder import encode

data = [
    ('hostname', 'localhost'),
    ('ssh_user', 'sayan'),
    ('ssh', 'success'),
    ('ping', 'success'),
    ('kernel', 'Linux'),
    ('uptime', '16:10:22 up  3:42,  2 users,  load average: 0.40, 0.49, 0.44')
]

encode(data)
```

### Decode data

```python
from shellic.decoder import decode

text = """
[: ping: success :]
[: ssh: success :]
[: kernel: Linux :]
[: mounted_file_systems :]
Filesystem      Size  Used Avail Use% Mounted on
udev            3.4G     0  3.4G   0% /dev
tmpfs           692M   19M  674M   3% /run
/dev/sda5        63G   18G   42G  30% /
tmpfs           3.4G   35M  3.4G   2% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.4G     0  3.4G   0% /sys/fs/cgroup
/dev/sda4        55G   38G   15G  73% /mnt/vmdisks
/dev/sda3        92G   79G  8.9G  90% /home
/dev/sda1       9.4G   12M  9.3G   1% /boot/efi
tmpfs           692M   20K  692M   1% /run/user/128
tmpfs           692M  1.8M  690M   1% /run/user/1000
[: --- :]
[: uptime :]
17:06:56 up  4:39,  2 users,  load average: 0.81, 0.55, 0.43
"""

decode(text)
```

            

Raw data

            {
    "maintainer": "", 
    "docs_url": null, 
    "requires_python": "", 
    "maintainer_email": "", 
    "cheesecake_code_kwalitee_id": null, 
    "keywords": "python shell output parsing", 
    "upload_time": "2018-04-15 13:31:44", 
    "author": "Arijit Basu", 
    "home_page": "https://github.com/sayanarijit/shellic", 
    "github_user": "sayanarijit", 
    "download_url": "https://pypi.python.org/packages/91/0d/f94e152d47e96640d1e41f35a7581d2b618c5da682653372b215cacd0b37/shellic-0.0.5.tar.gz", 
    "platform": "", 
    "version": "0.0.5", 
    "cheesecake_documentation_id": null, 
    "description": "# shellic\n[![PyPI version](https://img.shields.io/pypi/v/shellic.svg)](https://pypi.org/pypi/shellic)\n\nHuman readable data format for shell outputs\n\n\n## Data format\n\n```\n[: ping: success :]\n[: ssh: success :]\n[: kernel: Linux :]\n[: mounted_file_systems :]\nFilesystem      Size  Used Avail Use% Mounted on\nudev            3.4G     0  3.4G   0% /dev\ntmpfs           692M   19M  674M   3% /run\n/dev/sda5        63G   18G   42G  30% /\ntmpfs           3.4G   35M  3.4G   2% /dev/shm\ntmpfs           5.0M  4.0K  5.0M   1% /run/lock\ntmpfs           3.4G     0  3.4G   0% /sys/fs/cgroup\n/dev/sda4        55G   38G   15G  73% /mnt/vmdisks\n/dev/sda3        92G   79G  8.9G  90% /home\n/dev/sda1       9.4G   12M  9.3G   1% /boot/efi\ntmpfs           692M   20K  692M   1% /run/user/128\ntmpfs           692M  1.8M  690M   1% /run/user/1000\n[: --- :]\n[: uptime :]\n17:06:56 up  4:39,  2 users,  load average: 0.81, 0.55, 0.43\n```\n\n\n## Usage\n\n### Encode data\n\n```python\nfrom shellic.encoder import encode\n\ndata = [\n    ('hostname', 'localhost'),\n    ('ssh_user', 'sayan'),\n    ('ssh', 'success'),\n    ('ping', 'success'),\n    ('kernel', 'Linux'),\n    ('uptime', '16:10:22 up  3:42,  2 users,  load average: 0.40, 0.49, 0.44')\n]\n\nencode(data)\n```\n\n### Decode data\n\n```python\nfrom shellic.decoder import decode\n\ntext = \"\"\"\n[: ping: success :]\n[: ssh: success :]\n[: kernel: Linux :]\n[: mounted_file_systems :]\nFilesystem      Size  Used Avail Use% Mounted on\nudev            3.4G     0  3.4G   0% /dev\ntmpfs           692M   19M  674M   3% /run\n/dev/sda5        63G   18G   42G  30% /\ntmpfs           3.4G   35M  3.4G   2% /dev/shm\ntmpfs           5.0M  4.0K  5.0M   1% /run/lock\ntmpfs           3.4G     0  3.4G   0% /sys/fs/cgroup\n/dev/sda4        55G   38G   15G  73% /mnt/vmdisks\n/dev/sda3        92G   79G  8.9G  90% /home\n/dev/sda1       9.4G   12M  9.3G   1% /boot/efi\ntmpfs           692M   20K  692M   1% /run/user/128\ntmpfs           692M  1.8M  690M   1% /run/user/1000\n[: --- :]\n[: uptime :]\n17:06:56 up  4:39,  2 users,  load average: 0.81, 0.55, 0.43\n\"\"\"\n\ndecode(text)\n```\n", 
    "lcname": "shellic", 
    "bugtrack_url": null, 
    "github": true, 
    "coveralls": false, 
    "name": "shellic", 
    "license": "MIT", 
    "travis_ci": false, 
    "github_project": "shellic", 
    "summary": "Human readable data format for shell outputs", 
    "split_keywords": [
        "python", 
        "shell", 
        "output", 
        "parsing"
    ], 
    "author_email": "sayanarijit@gmail.com", 
    "urls": [
        {
            "has_sig": false, 
            "upload_time": "2018-04-15T13:31:44", 
            "comment_text": "", 
            "python_version": "source", 
            "url": "https://pypi.python.org/packages/91/0d/f94e152d47e96640d1e41f35a7581d2b618c5da682653372b215cacd0b37/shellic-0.0.5.tar.gz", 
            "md5_digest": "41445e38ab1e2fcc370623255b5e78bf", 
            "downloads": 0, 
            "filename": "shellic-0.0.5.tar.gz", 
            "packagetype": "sdist", 
            "path": "91/0d/f94e152d47e96640d1e41f35a7581d2b618c5da682653372b215cacd0b37/shellic-0.0.5.tar.gz", 
            "digests": {
                "sha256": "e1588af80023186ee5bd16bb5512870a3a77cf2af0969615d0f53a740f8d750c", 
                "md5": "41445e38ab1e2fcc370623255b5e78bf"
            }, 
            "sha256_digest": "e1588af80023186ee5bd16bb5512870a3a77cf2af0969615d0f53a740f8d750c", 
            "size": 3648
        }
    ], 
    "_id": null, 
    "cheesecake_installability_id": null
}