get-the-hell-out-of-here


Nameget-the-hell-out-of-here JSON
Version 0.12 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/get_the_hell_out_of_here
SummaryRemoves control characters / non-printing characters from strings and binaries
upload_time2022-12-06 22:58:43
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords string binary escaped characters non-printing characters control characters
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
##### A function to remove control characters / non-printing characters from strings and binaries







```python

$pip install get-the-hell-out-of-here

from get_the_hell_out_of_here import remove_escaped_characters

import numpy as np

test1 = np.array(["hi, my friend", "are you fine?"]).tobytes() #lets create some test data



#numpy as bytes

b"h\x00\x00\x00i\x00\x00\x00,\x00\x00\x00 \x00\x00\x00m\x00\x00\x00y\x00\x00\x00 \x00\x00\x00f\x00\x00\x00r\x00\x00\x00i\x00\x00\x00e\x00\x00\x00n\x00\x00\x00d\x00\x00\x00a\x00\x00\x00r\x00\x00\x00e\x00\x00\x00 \x00\x00\x00y\x00\x00\x00o\x00\x00\x00u\x00\x00\x00 \x00\x00\x00f\x00\x00\x00i\x00\x00\x00n\x00\x00\x00e\x00\x00\x00?\x00\x00\x00"

print(remove_escaped_characters(test1))

#Result:  b'hi, my friendare you fine?'



test2 = b"h\\x00\\x00\\x00i\\x00\\x00\\x00,\\x00\\x00\\x00 \\x00\\x00\\x00m\\x00\\x00\\x00y\\x00\\x00\\x00 \\x00\\x00\\x00f\\x00\\x00\\x00r\\x00\\x00\\x00i\\x00\\x00\\x00e\\x00\\x00\\x00n\\x00\\x00\\x00d\\x00\\x00\\x00a\\x00\\x00\\x00r\\x00\\x00\\x00e\\x00\\x00\\x00 \\x00\\x00\\x00y\\x00\\x00\\x00o\\x00\\x00\\x00u\\x00\\x00\\x00 \\x00\\x00\\x00f\\x00\\x00\\x00i\\x00\\x00\\x00n\\x00\\x00\\x00e\\x00\\x00\\x00?\\x00\\x00\\x00" #double escaped

print(remove_escaped_characters(test2))

# Result:   b'hi, my friendare you fine?'





test3 = "h\x00\x00\x00i\x00\x00\x00,\x00\x00\x00 \x00\x00\x00m\x00\x00\x00y\x00\x00\x00 \x00\x00\x00f\x00\x00\x00r\x00\x00\x00i\x00\x00\x00e\x00\x00\x00n\x00\x00\x00d\x00\x00\x00a\x00\x00\x00r\x00\x00\x00e\x00\x00\x00 \x00\x00\x00y\x00\x00\x00o\x00\x00\x00u\x00\x00\x00 \x00\x00\x00f\x00\x00\x00i\x00\x00\x00n\x00\x00\x00e\x00\x00\x00?\x00\x00\x00" #as string

print(remove_escaped_characters(test3))

#Result: hi, my friendare you fine?



test4 = "h\\x00\\x00\\x00i\\x00\\x00\\x00,\\x00\\x00\\x00 \\x00\\x00\\x00m\\x00\\x00\\x00y\\x00\\x00\\x00 \\x00\\x00\\x00f\\x00\\x00\\x00r\\x00\\x00\\x00i\\x00\\x00\\x00e\\x00\\x00\\x00n\\x00\\x00\\x00d\\x00\\x00\\x00a\\x00\\x00\\x00r\\x00\\x00\\x00e\\x00\\x00\\x00 \\x00\\x00\\x00y\\x00\\x00\\x00o\\x00\\x00\\x00u\\x00\\x00\\x00 \\x00\\x00\\x00f\\x00\\x00\\x00i\\x00\\x00\\x00n\\x00\\x00\\x00e\\x00\\x00\\x00?\\x00\\x00\\x00"  #as string - double escaped

print(remove_escaped_characters(test4))

#Result: hi, my friendare you fine?

```


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/get_the_hell_out_of_here",
    "name": "get-the-hell-out-of-here",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "string,binary,escaped characters,non-printing characters,control characters",
    "author": "Johannes Fischer",
    "author_email": "<aulasparticularesdealemaosp@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/c7/40/2acce2407a03fe5c091f4709f557dd9d1511b5bcd850ceb2aceb2867d6a5/get_the_hell_out_of_here-0.12.tar.gz",
    "platform": null,
    "description": "\n##### A function to remove control characters / non-printing characters from strings and binaries\n\n\n\n\n\n\n\n```python\n\n$pip install get-the-hell-out-of-here\n\nfrom get_the_hell_out_of_here import remove_escaped_characters\n\nimport numpy as np\n\ntest1 = np.array([\"hi, my friend\", \"are you fine?\"]).tobytes() #lets create some test data\n\n\n\n#numpy as bytes\n\nb\"h\\x00\\x00\\x00i\\x00\\x00\\x00,\\x00\\x00\\x00 \\x00\\x00\\x00m\\x00\\x00\\x00y\\x00\\x00\\x00 \\x00\\x00\\x00f\\x00\\x00\\x00r\\x00\\x00\\x00i\\x00\\x00\\x00e\\x00\\x00\\x00n\\x00\\x00\\x00d\\x00\\x00\\x00a\\x00\\x00\\x00r\\x00\\x00\\x00e\\x00\\x00\\x00 \\x00\\x00\\x00y\\x00\\x00\\x00o\\x00\\x00\\x00u\\x00\\x00\\x00 \\x00\\x00\\x00f\\x00\\x00\\x00i\\x00\\x00\\x00n\\x00\\x00\\x00e\\x00\\x00\\x00?\\x00\\x00\\x00\"\n\nprint(remove_escaped_characters(test1))\n\n#Result:  b'hi, my friendare you fine?'\n\n\n\ntest2 = b\"h\\\\x00\\\\x00\\\\x00i\\\\x00\\\\x00\\\\x00,\\\\x00\\\\x00\\\\x00 \\\\x00\\\\x00\\\\x00m\\\\x00\\\\x00\\\\x00y\\\\x00\\\\x00\\\\x00 \\\\x00\\\\x00\\\\x00f\\\\x00\\\\x00\\\\x00r\\\\x00\\\\x00\\\\x00i\\\\x00\\\\x00\\\\x00e\\\\x00\\\\x00\\\\x00n\\\\x00\\\\x00\\\\x00d\\\\x00\\\\x00\\\\x00a\\\\x00\\\\x00\\\\x00r\\\\x00\\\\x00\\\\x00e\\\\x00\\\\x00\\\\x00 \\\\x00\\\\x00\\\\x00y\\\\x00\\\\x00\\\\x00o\\\\x00\\\\x00\\\\x00u\\\\x00\\\\x00\\\\x00 \\\\x00\\\\x00\\\\x00f\\\\x00\\\\x00\\\\x00i\\\\x00\\\\x00\\\\x00n\\\\x00\\\\x00\\\\x00e\\\\x00\\\\x00\\\\x00?\\\\x00\\\\x00\\\\x00\" #double escaped\n\nprint(remove_escaped_characters(test2))\n\n# Result:   b'hi, my friendare you fine?'\n\n\n\n\n\ntest3 = \"h\\x00\\x00\\x00i\\x00\\x00\\x00,\\x00\\x00\\x00 \\x00\\x00\\x00m\\x00\\x00\\x00y\\x00\\x00\\x00 \\x00\\x00\\x00f\\x00\\x00\\x00r\\x00\\x00\\x00i\\x00\\x00\\x00e\\x00\\x00\\x00n\\x00\\x00\\x00d\\x00\\x00\\x00a\\x00\\x00\\x00r\\x00\\x00\\x00e\\x00\\x00\\x00 \\x00\\x00\\x00y\\x00\\x00\\x00o\\x00\\x00\\x00u\\x00\\x00\\x00 \\x00\\x00\\x00f\\x00\\x00\\x00i\\x00\\x00\\x00n\\x00\\x00\\x00e\\x00\\x00\\x00?\\x00\\x00\\x00\" #as string\n\nprint(remove_escaped_characters(test3))\n\n#Result: hi, my friendare you fine?\n\n\n\ntest4 = \"h\\\\x00\\\\x00\\\\x00i\\\\x00\\\\x00\\\\x00,\\\\x00\\\\x00\\\\x00 \\\\x00\\\\x00\\\\x00m\\\\x00\\\\x00\\\\x00y\\\\x00\\\\x00\\\\x00 \\\\x00\\\\x00\\\\x00f\\\\x00\\\\x00\\\\x00r\\\\x00\\\\x00\\\\x00i\\\\x00\\\\x00\\\\x00e\\\\x00\\\\x00\\\\x00n\\\\x00\\\\x00\\\\x00d\\\\x00\\\\x00\\\\x00a\\\\x00\\\\x00\\\\x00r\\\\x00\\\\x00\\\\x00e\\\\x00\\\\x00\\\\x00 \\\\x00\\\\x00\\\\x00y\\\\x00\\\\x00\\\\x00o\\\\x00\\\\x00\\\\x00u\\\\x00\\\\x00\\\\x00 \\\\x00\\\\x00\\\\x00f\\\\x00\\\\x00\\\\x00i\\\\x00\\\\x00\\\\x00n\\\\x00\\\\x00\\\\x00e\\\\x00\\\\x00\\\\x00?\\\\x00\\\\x00\\\\x00\"  #as string - double escaped\n\nprint(remove_escaped_characters(test4))\n\n#Result: hi, my friendare you fine?\n\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Removes control characters / non-printing characters from strings and binaries",
    "version": "0.12",
    "split_keywords": [
        "string",
        "binary",
        "escaped characters",
        "non-printing characters",
        "control characters"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "96c5fc64c8c7db0e9f6b01790da1c0b69a0b64b733c3b093d07408800bc45219",
                "md5": "8bc73b662eb4df0a1d49b774af1bede2",
                "sha256": "d21309c2d52cce7ae301b31341bc2341b65bf556e4ba4f42122f5122c9f0056e"
            },
            "downloads": -1,
            "filename": "get_the_hell_out_of_here-0.12-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8bc73b662eb4df0a1d49b774af1bede2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5467,
            "upload_time": "2022-12-06T22:58:41",
            "upload_time_iso_8601": "2022-12-06T22:58:41.329509Z",
            "url": "https://files.pythonhosted.org/packages/96/c5/fc64c8c7db0e9f6b01790da1c0b69a0b64b733c3b093d07408800bc45219/get_the_hell_out_of_here-0.12-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c7402acce2407a03fe5c091f4709f557dd9d1511b5bcd850ceb2aceb2867d6a5",
                "md5": "d5408d0bfd46873ff83d21ddbefa0937",
                "sha256": "326c386e0833a4c4c82d2e30fb45ad3c74857a7621f54d6b3d2e3fe2483b5439"
            },
            "downloads": -1,
            "filename": "get_the_hell_out_of_here-0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "d5408d0bfd46873ff83d21ddbefa0937",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5172,
            "upload_time": "2022-12-06T22:58:43",
            "upload_time_iso_8601": "2022-12-06T22:58:43.160182Z",
            "url": "https://files.pythonhosted.org/packages/c7/40/2acce2407a03fe5c091f4709f557dd9d1511b5bcd850ceb2aceb2867d6a5/get_the_hell_out_of_here-0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-12-06 22:58:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hansalemaos",
    "github_project": "get_the_hell_out_of_here",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "get-the-hell-out-of-here"
}
        
Elapsed time: 0.03503s