vcrpy-bincon


Namevcrpy-bincon JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttp://github.com/Justintime50/vcrpy-bincon
SummaryConvert binary Python VCR cassette responses to human-readable strings.
upload_time2024-03-14 19:22:36
maintainer
docs_urlNone
authorJustintime50
requires_python>=3.8, <4
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            <div align="center">

# VCRPY Binary Converter

Convert binary Python VCR cassette responses to human-readable strings.

[![Build Status](https://github.com/Justintime50/vcrpy-bincon/workflows/build/badge.svg)](https://github.com/Justintime50/vcrpy-bincon/actions)
[![Coverage Status](https://coveralls.io/repos/github/Justintime50/vcrpy-bincon/badge.svg?branch=main)](https://coveralls.io/github/Justintime50/vcrpy-bincon?branch=main)
[![PyPi](https://img.shields.io/pypi/v/vcrpy-bincon)](https://pypi.org/project/vcrpy-bincon)
[![Licence](https://img.shields.io/github/license/Justintime50/vcrpy-bincon)](LICENSE)

<img src="https://raw.githubusercontent.com/justintime50/assets/main/src/vcrpy-bincon/showcase.png" alt="Showcase">

</div>

VCR cassette responses often get saved as binary instead of a human-readable string. This makes inspecting the content difficult and depending on the VCR configuration, cassette matching impossible. This tool takes in a cassette directory and converts all binary response interactions to a human-readable string before dumping the yaml back to the cassette file. This allows for devs to properly inspect their cassette content while retaining all the original data - super useful if switching your VCR config from binary to strings.

```yaml
# Takes something like the following from a vcrpy cassette:
interactions:
  response:
    body:
      string: !!binary |
        H4sIAAAAAAAAA4yRT0vEMBDFv0rJ1RaS/rc3xYJCVxZ3XfBUps0UI21a0lTUZb+7k0ovnvY4j997
        byY5MyVZwUCaOm8kZEkEaZwJIRChyXIedk2eAEb8VjCfjc0Htpb4OykNzjNJrUGwKGtwcsjDKBA8
        4OlRZEWSFFF0w3nBOYHLJK8DNQxISFmdng6uYBwm0N+s0Evf+2y2BtEKAqIsjb2V8vYv5aEq37z7
        6vTANiYkxvmVJTPblbv94xo4W9qDlOMzDT9qclG5EGkQC56uhYu2xnleHT69jxq3dhxA9dswjNLl
        TGaUS2vVqJ0ZjFFo6g5a1a/Nfyy9lpKorQKyW7OgzzqUaKCvLXzV7hO2+2i7f9onGtWpFlzHzIrz
        5fILAAD//wMAxbg+BbcBAAA=

# And turns it into this:
interactions:
  response:
    body:
      string: '{"id": "adr_8bda753a647111eeab7802fb85ae3091", "object": "Address",
        "created_at": "2023-10-06T17:55:33+00:00", "updated_at": "2023-10-06T17:55:33+00:00",
        "name": "ELVIS", "company": null, "street1": "3764 ELVIS PRESLEY BLVD", "street2":
        "", "city": "MEMPHIS", "state": "TN", "zip": "38116-4106", "country": "US",
        "phone": null, "email": null, "mode": "production", "carrier_facility": null,
        "residential": true, "federal_tax_id": null, "state_tax_id": null, "verifications":
        {}}'
```

## Install

```bash
# Install tool
pip3 install vcrpy_bincon

# Install locally
just install
```

## Usage

```bash
# Specify the directory where your cassette files live as the first param
vcrpy-bincon tests/cassettes
```

### Known Side Effects

Using this tool has a couple of known (low-impact) side effects:

1. `null` fields in cassettes may get replaced with nothing and become empty
2. Some already human-readable strings may get re-encoded as escaped JSON strings if VCRPY had odd line breaks such as the ending quote on a newline with no other content
3. Long URL and other field values may get bumped down a line from its key pair due to the default line length of 80

## Development

```bash
# Get a comprehensive list of development tools
just --list
```

            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/Justintime50/vcrpy-bincon",
    "name": "vcrpy-bincon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8, <4",
    "maintainer_email": "",
    "keywords": "",
    "author": "Justintime50",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/be/02/434f5c0a98e74963e6c47b70fff3571fe1f856b094f3da9a6d641f137f7c/vcrpy-bincon-0.1.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n\n# VCRPY Binary Converter\n\nConvert binary Python VCR cassette responses to human-readable strings.\n\n[![Build Status](https://github.com/Justintime50/vcrpy-bincon/workflows/build/badge.svg)](https://github.com/Justintime50/vcrpy-bincon/actions)\n[![Coverage Status](https://coveralls.io/repos/github/Justintime50/vcrpy-bincon/badge.svg?branch=main)](https://coveralls.io/github/Justintime50/vcrpy-bincon?branch=main)\n[![PyPi](https://img.shields.io/pypi/v/vcrpy-bincon)](https://pypi.org/project/vcrpy-bincon)\n[![Licence](https://img.shields.io/github/license/Justintime50/vcrpy-bincon)](LICENSE)\n\n<img src=\"https://raw.githubusercontent.com/justintime50/assets/main/src/vcrpy-bincon/showcase.png\" alt=\"Showcase\">\n\n</div>\n\nVCR cassette responses often get saved as binary instead of a human-readable string. This makes inspecting the content difficult and depending on the VCR configuration, cassette matching impossible. This tool takes in a cassette directory and converts all binary response interactions to a human-readable string before dumping the yaml back to the cassette file. This allows for devs to properly inspect their cassette content while retaining all the original data - super useful if switching your VCR config from binary to strings.\n\n```yaml\n# Takes something like the following from a vcrpy cassette:\ninteractions:\n  response:\n    body:\n      string: !!binary |\n        H4sIAAAAAAAAA4yRT0vEMBDFv0rJ1RaS/rc3xYJCVxZ3XfBUps0UI21a0lTUZb+7k0ovnvY4j997\n        byY5MyVZwUCaOm8kZEkEaZwJIRChyXIedk2eAEb8VjCfjc0Htpb4OykNzjNJrUGwKGtwcsjDKBA8\n        4OlRZEWSFFF0w3nBOYHLJK8DNQxISFmdng6uYBwm0N+s0Evf+2y2BtEKAqIsjb2V8vYv5aEq37z7\n        6vTANiYkxvmVJTPblbv94xo4W9qDlOMzDT9qclG5EGkQC56uhYu2xnleHT69jxq3dhxA9dswjNLl\n        TGaUS2vVqJ0ZjFFo6g5a1a/Nfyy9lpKorQKyW7OgzzqUaKCvLXzV7hO2+2i7f9onGtWpFlzHzIrz\n        5fILAAD//wMAxbg+BbcBAAA=\n\n# And turns it into this:\ninteractions:\n  response:\n    body:\n      string: '{\"id\": \"adr_8bda753a647111eeab7802fb85ae3091\", \"object\": \"Address\",\n        \"created_at\": \"2023-10-06T17:55:33+00:00\", \"updated_at\": \"2023-10-06T17:55:33+00:00\",\n        \"name\": \"ELVIS\", \"company\": null, \"street1\": \"3764 ELVIS PRESLEY BLVD\", \"street2\":\n        \"\", \"city\": \"MEMPHIS\", \"state\": \"TN\", \"zip\": \"38116-4106\", \"country\": \"US\",\n        \"phone\": null, \"email\": null, \"mode\": \"production\", \"carrier_facility\": null,\n        \"residential\": true, \"federal_tax_id\": null, \"state_tax_id\": null, \"verifications\":\n        {}}'\n```\n\n## Install\n\n```bash\n# Install tool\npip3 install vcrpy_bincon\n\n# Install locally\njust install\n```\n\n## Usage\n\n```bash\n# Specify the directory where your cassette files live as the first param\nvcrpy-bincon tests/cassettes\n```\n\n### Known Side Effects\n\nUsing this tool has a couple of known (low-impact) side effects:\n\n1. `null` fields in cassettes may get replaced with nothing and become empty\n2. Some already human-readable strings may get re-encoded as escaped JSON strings if VCRPY had odd line breaks such as the ending quote on a newline with no other content\n3. Long URL and other field values may get bumped down a line from its key pair due to the default line length of 80\n\n## Development\n\n```bash\n# Get a comprehensive list of development tools\njust --list\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Convert binary Python VCR cassette responses to human-readable strings.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "http://github.com/Justintime50/vcrpy-bincon"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f55ec28281786c8f0f163bfaa8f1b2167d694f8104f98346bf3d632d3504d274",
                "md5": "0ebce72fd909eae160244f9c5c2d2781",
                "sha256": "38d2c9c1c00bd861b9dd2ba2ef1693329982e6a413f372b6dadf190f5aedd31a"
            },
            "downloads": -1,
            "filename": "vcrpy_bincon-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0ebce72fd909eae160244f9c5c2d2781",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8, <4",
            "size": 5708,
            "upload_time": "2024-03-14T19:22:35",
            "upload_time_iso_8601": "2024-03-14T19:22:35.050217Z",
            "url": "https://files.pythonhosted.org/packages/f5/5e/c28281786c8f0f163bfaa8f1b2167d694f8104f98346bf3d632d3504d274/vcrpy_bincon-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "be02434f5c0a98e74963e6c47b70fff3571fe1f856b094f3da9a6d641f137f7c",
                "md5": "4c83e9d113e4bc26b11618c621ed1f35",
                "sha256": "440727c6f56d581d835327513eeffbc9884bf49ff480249de0f71b695e726bd8"
            },
            "downloads": -1,
            "filename": "vcrpy-bincon-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4c83e9d113e4bc26b11618c621ed1f35",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8, <4",
            "size": 7610,
            "upload_time": "2024-03-14T19:22:36",
            "upload_time_iso_8601": "2024-03-14T19:22:36.295774Z",
            "url": "https://files.pythonhosted.org/packages/be/02/434f5c0a98e74963e6c47b70fff3571fe1f856b094f3da9a6d641f137f7c/vcrpy-bincon-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-14 19:22:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Justintime50",
    "github_project": "vcrpy-bincon",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "vcrpy-bincon"
}
        
Elapsed time: 0.34827s