tmconfpy


Nametmconfpy JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttps://github.com/simonkowallik/tmconfpy
SummaryA Python library to serialize F5 BIG-IP configuration files to a python dict or JSON.
upload_time2024-08-02 20:43:49
maintainerNone
docs_urlNone
authorSimon Kowallik
requires_python<4.0,>=3.10
licenseNone
keywords f5 devops security
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # tmconfpy

<p align="center" style="text-decoration: none;">
<a href="https://github.com/simonkowallik/tmconfpy/actions/workflows/ci-pipeline.yaml" target="_blank">
    <img src="https://github.com/simonkowallik/tmconfpy/actions/workflows/ci-pipeline.yaml/badge.svg" alt="ci-pipeline">
</a>
<a href="https://codeclimate.com/github/simonkowallik/tmconfpy/test_coverage" target="_blank">
    <img src="https://api.codeclimate.com/v1/badges/3f404be294dceae16361/test_coverage" alt="test coverage">
</a>
<a href="https://hub.docker.com/r/simonkowallik/tmconfpy" target="_blank">
    <img src="https://img.shields.io/docker/image-size/simonkowallik/tmconfpy" alt="container image size">
</a>
<a href="https://pypi.org/project/tmconfpy" target="_blank" target="_blank">
    <img src="https://img.shields.io/pypi/v/tmconfpy?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://github.com/simonkowallik/tmconfpy/releases" target="_blank">
    <img src="https://img.shields.io/github/v/release/simonkowallik/tmconfpy" alt="releases">
</a>
</p>

---

**tmconfpy** provides a simple parser (`tmconfpy` command) to serialize a tmconf file (eg. `/config/bigip.conf`) to JSON (or python `dict`). The produced JSON is printed to `STDOUT` or a specified output (`--output`) file. It is also usable as a python module for easy consumption in your own projects.

This project aims to be a minimalistic dependency free tool. It is based on [tmconfjs](https://github.com/simonkowallik/tmconfjs), it's parsing implementation leans heavily on the community project [F5 BIG-IP Automation Config Converter (BIG-IP ACC)](https://github.com/f5devcentral/f5-automation-config-converter/).

The TMOS configuration parser [f5-corkscrew](https://github.com/f5devcentral/f5-corkscrew) is a more sophisticated alternative with advanced functionality and active development.

Also checkout the jupyter notebook: [example/notebook.ipynb](https://github.com/simonkowallik/tmconfpy/blob/main/example/notebook.ipynb).

For more details about the relevant configuration files, [data formats](https://simonkowallik.github.io/tmconfpy/data-formats.html), tmconfpy and its ansible collection please have a look at the [documentation](https://simonkowallik.github.io/tmconfpy/).

## Using tmconfpy with ansible

tmconfpy is available as an ansible module, please see [ansible_collections/simonkowallik/tmconfpy/README.md](./ansible_collections/simonkowallik/tmconfpy/README.md) or the [Ansible documentation](https://simonkowallik.github.io/tmconfpy/ansible.html).

## Documentation by example

### Installation

```shell
pip3 install tmconfpy
```

### Command line usage

When installed globally, `tmconfpy` can be invoked as a command:

```shell
tmconfpy example/test.tmconf 2>/dev/null \
    | jq '."ltm profile client-ssl clientssl-secure"'
```

```json
{
  "app-service": "none",
  "cert": "/Common/default.crt",
  "cert-key-chain": {
    "default": {
      "cert": "/Common/default.crt",
      "key": "/Common/default.key"
    }
  },
  "chain": "none",
  "ciphers": "ecdhe:rsa:!sslv3:!rc4:!exp:!des",
  "defaults-from": "/Common/clientssl",
  "inherit-certkeychain": "true",
  "key": "/Common/default.key",
  "options": [
    "no-ssl",
    "no-tlsv1.3"
  ],
  "passphrase": "none",
  "renegotiation": "disabled"
}
```

Errors, warnings or any debug information is written to `STDERR`:

```shell
tmconfpy example/test.tmconf \
    >/dev/null 2> example/test.tmconf.log

cat example/test.tmconf.log
```

```shell
2024-06-30T18:39:16Z - WARNING - tmconfpy.parser - UNRECOGNIZED LINE for object 'sys software update': '     auto-check enabled'
2024-06-30T18:39:16Z - WARNING - tmconfpy.parser - UNRECOGNIZED LINE for object 'sys software update': '     auto-phonehome enabled'
2024-06-30T18:39:16Z - WARNING - tmconfpy.parser - UNRECOGNIZED LINE for object 'fatal-grace-time': '	time 500'
2024-06-30T18:39:16Z - WARNING - tmconfpy.parser - UNRECOGNIZED LINE for object 'fatal-grace-time': '	enabled yes'
```

Input is also accepted from `STDIN`:

```shell
cat example/imap.tmconf | tmconfpy
```

```json
{
    "ltm profile imap imap": {
        "activation-mode": "require"
    }
}
```

The `<file_path>` argument is preferred over `STDIN` however:

```shell
cat example/imap.tmconf | tmconfpy example/pop3.tmconf
```

```json
{
    "ltm profile pop3 pop3": {
        "activation-mode": "require"
    }
}
```

The output can be written to a specified file using `--output` or `-o` when `STDOUT` is not desired:

```shell
tmconfpy --output example/pop3.tmconf.json example/pop3.tmconf
cat example/pop3.tmconf.json
```

```json
{
    "ltm profile pop3 pop3": {
        "activation-mode": "require"
    }
}
```

tmconfpy supports multiple output formats of the parsed tmconf data, which can be specified via `--format`.

```shell
(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \
  tmconfpy --format jsonl
```

```json
{"path": "ltm profile imap", "name": "imap", "object": {"activation-mode": "require"}}
{"path": "ltm profile pop3", "name": "pop3", "object": {"activation-mode": "require"}}
```

```shell
(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \
  tmconfpy --format tabular
```

```json
[
  ["ltm profile imap", "imap", {"activation-mode": "require"}],
  ["ltm profile pop3", "pop3", {"activation-mode": "require"}]
]
```

```shell
(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \
  tmconfpy --format tabular_kv
```

```json
[
  {"path":"ltm profile imap","name":"imap","object":{"activation-mode":"require"}},
  {"path":"ltm profile pop3","name":"pop3","object":{"activation-mode":"require"}}
]
```

Sorting the output is also supported since version 1.1.0. This is helpful when comparing data. tmconfpy uses python `sorted()` and will sort all data within the tmconf (all dicts, and lists).

```shell
cat <<EOF | tmconfpy --sort | jq 
ltm profile profile-type zProfile { }
ltm profile profile-type MyProfile {
    b {
        Z { 3 2 A 1 0 }
        a 1
        A 2
    }
    aaa 0
    AA { a c b }
}
EOF
```

```json
{
  "ltm profile profile-type MyProfile": {
    "AA": [ "a", "b", "c" ],
    "aaa": "0",
    "b": {
      "A": "2",
      "Z": [ "0", "1", "2", "3", "A" ],
      "a": "1"
    }
  },
  "ltm profile profile-type zProfile": {}
}
```

### Use as python module

```python
>>> from tmconfpy import Parser
>>> parsed = Parser('example/imap.tmconf', is_filepath=True)
>>> parsed.dict
{'ltm profile imap imap': {'activation-mode': 'require'}}
>>> tmconf = r"""
... ltm profile pop3 pop3 {
...     activation-mode require
... }
... ltm profile imap imap {
...     activation-mode require
... }
... """
>>> parsed = Parser(tmconf)
>>> parsed.json
'{"ltm profile pop3 pop3": {"activation-mode": "require"}, "ltm profile imap imap": {"activation-mode": "require"}}'
>>> parsed.tabular
[tabularTmconf(path='ltm profile pop3', name='pop3', object={'activation-mode': 'require'}), tabularTmconf(path='ltm profile imap', name='imap', object={'activation-mode': 'require'})]
>>> parsed.tabular_kv
[{'path': 'ltm profile pop3',
  'name': 'pop3',
  'object': {'activation-mode': 'require'}},
 {'path': 'ltm profile imap',
  'name': 'imap',
  'object': {'activation-mode': 'require'}}]
>>> parsed.tabular_json
'[["ltm profile pop3", "pop3", {"activation-mode": "require"}], ["ltm profile imap", "imap", {"activation-mode": "require"}]]'
>>> parsed.jsonl
'{"path": "ltm profile pop3", "name": "pop3", "object": {"activation-mode": "require"}}\n{"path": "ltm profile imap", "name": "imap", "object": {"activation-mode": "require"}}'
```

### Using the (optional) apiserver / container

Run the container, the API listens on port 8000 (http).

```shell
docker run --rm -p 8000:8000 simonkowallik/tmconfpy
```

The container is also available on [ghcr.io](https://github.com/simonkowallik/tmconfpy/pkgs/container/tmconfpy) as an alternative to docker hub.

```shell
docker run --rm -p 8000:8000 ghcr.io/simonkowallik/tmconfpy
```

The apiserver can be reached at [http://localhost:8000/](http://localhost:8000/) and offers two endpoints which are described by the OpenAPI specification.

API documentation can be reached at [/](http://localhost:8000/) and [/redoc](http://localhost:8000/redoc) for interactive use.

Parsing a single file by using POST, note `--data-binary` is required to avoid interpretation of the file content:

```shell
curl -X POST -s http://localhost:8000/parser/ \
  --data-binary @example/imap.tmconf
```

```json
{"ltm profile imap imap":{"activation-mode":"require"}}
```

Parsing multiple files via multipart form:

```shell
curl -X POST -s http://localhost:8000/fileparser/ \
  -F 'filename=@example/imap.tmconf' \
  -F 'filename=@example/pop3.tmconf'
```

```json
[
  {"filename":"imap.tmconf",
   "output":{"ltm profile imap imap":{"activation-mode":"require"}}
  },
  {"filename":"pop3.tmconf",
   "output":{"ltm profile pop3 pop3":{"activation-mode":"require"}}
  }
]
```

#### JSONL and tabular data

The `/parser/` api-endpoint also supports returning the parsed tmconf as JSONL or tabular data using the query parameter `?response_format=<format>`.

```shell
(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \
  curl -X POST -s http://localhost:8000/parser/?response_format=jsonl \
  --data-binary @-
```

```json
{"path": "ltm profile imap", "name": "imap", "object": {"activation-mode": "require"}}
{"path": "ltm profile pop3", "name": "pop3", "object": {"activation-mode": "require"}}
```

```shell
(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \
  curl -X POST -s http://localhost:8000/parser/?response_format=tabular \
  --data-binary @-
```

```json
[
  ["ltm profile imap","imap",{"activation-mode":"require"}],
  ["ltm profile pop3","pop3",{"activation-mode":"require"}]
]
```

#### Using the container as a command line tool

Use the `--entrypoint` argument with `tmconfpy` to invoke the tmconfpy tool instead of the apiserver (which is the default). Don't forget to pass `--interactive | -i` to the container.

```shell
cat example/imap.tmconf | docker run --rm --interactive --entrypoint tmconfpy simonkowallik/tmconfpy
```

```json
{
    "ltm profile imap imap": {
        "activation-mode": "require"
    }
}
```

**Note** that you can't use `--output | -o` to write the output to a file using the above method unless you mount a volume into the container.

## Disclaimer, Support, License

Please read and understand the [LICENSE](https://github.com/simonkowallik/tmconfpy/blob/main/LICENSE) first.

```text
There is no support on this project.

It is maintained on best effort basis without any warranties.

For any software or components used in this project, read their own LICENSE and SUPPORT policies.

If you decide to use this project, you are solely responsible.
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/simonkowallik/tmconfpy",
    "name": "tmconfpy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "F5, DevOps, Security",
    "author": "Simon Kowallik",
    "author_email": "sk-github@simonkowallik.com",
    "download_url": "https://files.pythonhosted.org/packages/0f/b9/e3186a5f8b4e445069c756679bc5d86a642c4125097b7160bc829b8415a1/tmconfpy-1.1.0.tar.gz",
    "platform": null,
    "description": "# tmconfpy\n\n<p align=\"center\" style=\"text-decoration: none;\">\n<a href=\"https://github.com/simonkowallik/tmconfpy/actions/workflows/ci-pipeline.yaml\" target=\"_blank\">\n    <img src=\"https://github.com/simonkowallik/tmconfpy/actions/workflows/ci-pipeline.yaml/badge.svg\" alt=\"ci-pipeline\">\n</a>\n<a href=\"https://codeclimate.com/github/simonkowallik/tmconfpy/test_coverage\" target=\"_blank\">\n    <img src=\"https://api.codeclimate.com/v1/badges/3f404be294dceae16361/test_coverage\" alt=\"test coverage\">\n</a>\n<a href=\"https://hub.docker.com/r/simonkowallik/tmconfpy\" target=\"_blank\">\n    <img src=\"https://img.shields.io/docker/image-size/simonkowallik/tmconfpy\" alt=\"container image size\">\n</a>\n<a href=\"https://pypi.org/project/tmconfpy\" target=\"_blank\" target=\"_blank\">\n    <img src=\"https://img.shields.io/pypi/v/tmconfpy?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n</a>\n<a href=\"https://github.com/simonkowallik/tmconfpy/releases\" target=\"_blank\">\n    <img src=\"https://img.shields.io/github/v/release/simonkowallik/tmconfpy\" alt=\"releases\">\n</a>\n</p>\n\n---\n\n**tmconfpy** provides a simple parser (`tmconfpy` command) to serialize a tmconf file (eg. `/config/bigip.conf`) to JSON (or python `dict`). The produced JSON is printed to `STDOUT` or a specified output (`--output`) file. It is also usable as a python module for easy consumption in your own projects.\n\nThis project aims to be a minimalistic dependency free tool. It is based on [tmconfjs](https://github.com/simonkowallik/tmconfjs), it's parsing implementation leans heavily on the community project [F5 BIG-IP Automation Config Converter (BIG-IP ACC)](https://github.com/f5devcentral/f5-automation-config-converter/).\n\nThe TMOS configuration parser [f5-corkscrew](https://github.com/f5devcentral/f5-corkscrew) is a more sophisticated alternative with advanced functionality and active development.\n\nAlso checkout the jupyter notebook: [example/notebook.ipynb](https://github.com/simonkowallik/tmconfpy/blob/main/example/notebook.ipynb).\n\nFor more details about the relevant configuration files, [data formats](https://simonkowallik.github.io/tmconfpy/data-formats.html), tmconfpy and its ansible collection please have a look at the [documentation](https://simonkowallik.github.io/tmconfpy/).\n\n## Using tmconfpy with ansible\n\ntmconfpy is available as an ansible module, please see [ansible_collections/simonkowallik/tmconfpy/README.md](./ansible_collections/simonkowallik/tmconfpy/README.md) or the [Ansible documentation](https://simonkowallik.github.io/tmconfpy/ansible.html).\n\n## Documentation by example\n\n### Installation\n\n```shell\npip3 install tmconfpy\n```\n\n### Command line usage\n\nWhen installed globally, `tmconfpy` can be invoked as a command:\n\n```shell\ntmconfpy example/test.tmconf 2>/dev/null \\\n    | jq '.\"ltm profile client-ssl clientssl-secure\"'\n```\n\n```json\n{\n  \"app-service\": \"none\",\n  \"cert\": \"/Common/default.crt\",\n  \"cert-key-chain\": {\n    \"default\": {\n      \"cert\": \"/Common/default.crt\",\n      \"key\": \"/Common/default.key\"\n    }\n  },\n  \"chain\": \"none\",\n  \"ciphers\": \"ecdhe:rsa:!sslv3:!rc4:!exp:!des\",\n  \"defaults-from\": \"/Common/clientssl\",\n  \"inherit-certkeychain\": \"true\",\n  \"key\": \"/Common/default.key\",\n  \"options\": [\n    \"no-ssl\",\n    \"no-tlsv1.3\"\n  ],\n  \"passphrase\": \"none\",\n  \"renegotiation\": \"disabled\"\n}\n```\n\nErrors, warnings or any debug information is written to `STDERR`:\n\n```shell\ntmconfpy example/test.tmconf \\\n    >/dev/null 2> example/test.tmconf.log\n\ncat example/test.tmconf.log\n```\n\n```shell\n2024-06-30T18:39:16Z - WARNING - tmconfpy.parser - UNRECOGNIZED LINE for object 'sys software update': '     auto-check enabled'\n2024-06-30T18:39:16Z - WARNING - tmconfpy.parser - UNRECOGNIZED LINE for object 'sys software update': '     auto-phonehome enabled'\n2024-06-30T18:39:16Z - WARNING - tmconfpy.parser - UNRECOGNIZED LINE for object 'fatal-grace-time': '\ttime 500'\n2024-06-30T18:39:16Z - WARNING - tmconfpy.parser - UNRECOGNIZED LINE for object 'fatal-grace-time': '\tenabled yes'\n```\n\nInput is also accepted from `STDIN`:\n\n```shell\ncat example/imap.tmconf | tmconfpy\n```\n\n```json\n{\n    \"ltm profile imap imap\": {\n        \"activation-mode\": \"require\"\n    }\n}\n```\n\nThe `<file_path>` argument is preferred over `STDIN` however:\n\n```shell\ncat example/imap.tmconf | tmconfpy example/pop3.tmconf\n```\n\n```json\n{\n    \"ltm profile pop3 pop3\": {\n        \"activation-mode\": \"require\"\n    }\n}\n```\n\nThe output can be written to a specified file using `--output` or `-o` when `STDOUT` is not desired:\n\n```shell\ntmconfpy --output example/pop3.tmconf.json example/pop3.tmconf\ncat example/pop3.tmconf.json\n```\n\n```json\n{\n    \"ltm profile pop3 pop3\": {\n        \"activation-mode\": \"require\"\n    }\n}\n```\n\ntmconfpy supports multiple output formats of the parsed tmconf data, which can be specified via `--format`.\n\n```shell\n(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \\\n  tmconfpy --format jsonl\n```\n\n```json\n{\"path\": \"ltm profile imap\", \"name\": \"imap\", \"object\": {\"activation-mode\": \"require\"}}\n{\"path\": \"ltm profile pop3\", \"name\": \"pop3\", \"object\": {\"activation-mode\": \"require\"}}\n```\n\n```shell\n(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \\\n  tmconfpy --format tabular\n```\n\n```json\n[\n  [\"ltm profile imap\", \"imap\", {\"activation-mode\": \"require\"}],\n  [\"ltm profile pop3\", \"pop3\", {\"activation-mode\": \"require\"}]\n]\n```\n\n```shell\n(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \\\n  tmconfpy --format tabular_kv\n```\n\n```json\n[\n  {\"path\":\"ltm profile imap\",\"name\":\"imap\",\"object\":{\"activation-mode\":\"require\"}},\n  {\"path\":\"ltm profile pop3\",\"name\":\"pop3\",\"object\":{\"activation-mode\":\"require\"}}\n]\n```\n\nSorting the output is also supported since version 1.1.0. This is helpful when comparing data. tmconfpy uses python `sorted()` and will sort all data within the tmconf (all dicts, and lists).\n\n```shell\ncat <<EOF | tmconfpy --sort | jq \nltm profile profile-type zProfile { }\nltm profile profile-type MyProfile {\n    b {\n        Z { 3 2 A 1 0 }\n        a 1\n        A 2\n    }\n    aaa 0\n    AA { a c b }\n}\nEOF\n```\n\n```json\n{\n  \"ltm profile profile-type MyProfile\": {\n    \"AA\": [ \"a\", \"b\", \"c\" ],\n    \"aaa\": \"0\",\n    \"b\": {\n      \"A\": \"2\",\n      \"Z\": [ \"0\", \"1\", \"2\", \"3\", \"A\" ],\n      \"a\": \"1\"\n    }\n  },\n  \"ltm profile profile-type zProfile\": {}\n}\n```\n\n### Use as python module\n\n```python\n>>> from tmconfpy import Parser\n>>> parsed = Parser('example/imap.tmconf', is_filepath=True)\n>>> parsed.dict\n{'ltm profile imap imap': {'activation-mode': 'require'}}\n>>> tmconf = r\"\"\"\n... ltm profile pop3 pop3 {\n...     activation-mode require\n... }\n... ltm profile imap imap {\n...     activation-mode require\n... }\n... \"\"\"\n>>> parsed = Parser(tmconf)\n>>> parsed.json\n'{\"ltm profile pop3 pop3\": {\"activation-mode\": \"require\"}, \"ltm profile imap imap\": {\"activation-mode\": \"require\"}}'\n>>> parsed.tabular\n[tabularTmconf(path='ltm profile pop3', name='pop3', object={'activation-mode': 'require'}), tabularTmconf(path='ltm profile imap', name='imap', object={'activation-mode': 'require'})]\n>>> parsed.tabular_kv\n[{'path': 'ltm profile pop3',\n  'name': 'pop3',\n  'object': {'activation-mode': 'require'}},\n {'path': 'ltm profile imap',\n  'name': 'imap',\n  'object': {'activation-mode': 'require'}}]\n>>> parsed.tabular_json\n'[[\"ltm profile pop3\", \"pop3\", {\"activation-mode\": \"require\"}], [\"ltm profile imap\", \"imap\", {\"activation-mode\": \"require\"}]]'\n>>> parsed.jsonl\n'{\"path\": \"ltm profile pop3\", \"name\": \"pop3\", \"object\": {\"activation-mode\": \"require\"}}\\n{\"path\": \"ltm profile imap\", \"name\": \"imap\", \"object\": {\"activation-mode\": \"require\"}}'\n```\n\n### Using the (optional) apiserver / container\n\nRun the container, the API listens on port 8000 (http).\n\n```shell\ndocker run --rm -p 8000:8000 simonkowallik/tmconfpy\n```\n\nThe container is also available on [ghcr.io](https://github.com/simonkowallik/tmconfpy/pkgs/container/tmconfpy) as an alternative to docker hub.\n\n```shell\ndocker run --rm -p 8000:8000 ghcr.io/simonkowallik/tmconfpy\n```\n\nThe apiserver can be reached at [http://localhost:8000/](http://localhost:8000/) and offers two endpoints which are described by the OpenAPI specification.\n\nAPI documentation can be reached at [/](http://localhost:8000/) and [/redoc](http://localhost:8000/redoc) for interactive use.\n\nParsing a single file by using POST, note `--data-binary` is required to avoid interpretation of the file content:\n\n```shell\ncurl -X POST -s http://localhost:8000/parser/ \\\n  --data-binary @example/imap.tmconf\n```\n\n```json\n{\"ltm profile imap imap\":{\"activation-mode\":\"require\"}}\n```\n\nParsing multiple files via multipart form:\n\n```shell\ncurl -X POST -s http://localhost:8000/fileparser/ \\\n  -F 'filename=@example/imap.tmconf' \\\n  -F 'filename=@example/pop3.tmconf'\n```\n\n```json\n[\n  {\"filename\":\"imap.tmconf\",\n   \"output\":{\"ltm profile imap imap\":{\"activation-mode\":\"require\"}}\n  },\n  {\"filename\":\"pop3.tmconf\",\n   \"output\":{\"ltm profile pop3 pop3\":{\"activation-mode\":\"require\"}}\n  }\n]\n```\n\n#### JSONL and tabular data\n\nThe `/parser/` api-endpoint also supports returning the parsed tmconf as JSONL or tabular data using the query parameter `?response_format=<format>`.\n\n```shell\n(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \\\n  curl -X POST -s http://localhost:8000/parser/?response_format=jsonl \\\n  --data-binary @-\n```\n\n```json\n{\"path\": \"ltm profile imap\", \"name\": \"imap\", \"object\": {\"activation-mode\": \"require\"}}\n{\"path\": \"ltm profile pop3\", \"name\": \"pop3\", \"object\": {\"activation-mode\": \"require\"}}\n```\n\n```shell\n(cat example/imap.tmconf; echo; cat example/pop3.tmconf) | \\\n  curl -X POST -s http://localhost:8000/parser/?response_format=tabular \\\n  --data-binary @-\n```\n\n```json\n[\n  [\"ltm profile imap\",\"imap\",{\"activation-mode\":\"require\"}],\n  [\"ltm profile pop3\",\"pop3\",{\"activation-mode\":\"require\"}]\n]\n```\n\n#### Using the container as a command line tool\n\nUse the `--entrypoint` argument with `tmconfpy` to invoke the tmconfpy tool instead of the apiserver (which is the default). Don't forget to pass `--interactive | -i` to the container.\n\n```shell\ncat example/imap.tmconf | docker run --rm --interactive --entrypoint tmconfpy simonkowallik/tmconfpy\n```\n\n```json\n{\n    \"ltm profile imap imap\": {\n        \"activation-mode\": \"require\"\n    }\n}\n```\n\n**Note** that you can't use `--output | -o` to write the output to a file using the above method unless you mount a volume into the container.\n\n## Disclaimer, Support, License\n\nPlease read and understand the [LICENSE](https://github.com/simonkowallik/tmconfpy/blob/main/LICENSE) first.\n\n```text\nThere is no support on this project.\n\nIt is maintained on best effort basis without any warranties.\n\nFor any software or components used in this project, read their own LICENSE and SUPPORT policies.\n\nIf you decide to use this project, you are solely responsible.\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A Python library to serialize F5 BIG-IP configuration files to a python dict or JSON.",
    "version": "1.1.0",
    "project_urls": {
        "Documentation": "https://github.com/simonkowallik/tmconfpy",
        "Homepage": "https://github.com/simonkowallik/tmconfpy",
        "Repository": "https://github.com/simonkowallik/tmconfpy"
    },
    "split_keywords": [
        "f5",
        " devops",
        " security"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "66e77898cd07f5073cc3e5d9e3ab0d73cc3f9195ca02685190503d07adbf9e12",
                "md5": "0e4b28eafd69d0e82ec34ee5490da3f4",
                "sha256": "74161337388d5a803ee9c479877cf9a5b4cb11342ae8d540fab55c5d380187b5"
            },
            "downloads": -1,
            "filename": "tmconfpy-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0e4b28eafd69d0e82ec34ee5490da3f4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 16970,
            "upload_time": "2024-08-02T20:43:46",
            "upload_time_iso_8601": "2024-08-02T20:43:46.666855Z",
            "url": "https://files.pythonhosted.org/packages/66/e7/7898cd07f5073cc3e5d9e3ab0d73cc3f9195ca02685190503d07adbf9e12/tmconfpy-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0fb9e3186a5f8b4e445069c756679bc5d86a642c4125097b7160bc829b8415a1",
                "md5": "f9581e90da110e1bd6446429ef35605d",
                "sha256": "9c1e30d52fcb6a09e290439e6c88710c1883a9691ce4bcce6861ae7ad425ec33"
            },
            "downloads": -1,
            "filename": "tmconfpy-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f9581e90da110e1bd6446429ef35605d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 17932,
            "upload_time": "2024-08-02T20:43:49",
            "upload_time_iso_8601": "2024-08-02T20:43:49.061674Z",
            "url": "https://files.pythonhosted.org/packages/0f/b9/e3186a5f8b4e445069c756679bc5d86a642c4125097b7160bc829b8415a1/tmconfpy-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-02 20:43:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "simonkowallik",
    "github_project": "tmconfpy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "tmconfpy"
}
        
Elapsed time: 0.31891s