mailscrambler


Namemailscrambler JSON
Version 0.1.2 PyPI version JSON
download
home_pagehttps://www.github.com/deme3/emailscrambler
SummaryE-mail scrambling library
upload_time2023-06-14 06:39:03
maintainer
docs_urlNone
authorDemetrio Battaglia
requires_python>=3.7
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # mailscrambler

A simple Python library to scramble and obfuscate email addresses in HTML pages, also comes with JavaScript deobfuscator.

## Installation

```bash
pip install mailscrambler
```

## Usage

```python
from mailscrambler import scramble, obfuscate, javascriptify, deobfuscator

# Scramble an email address
scrambled = scramble('test@email.com')
print(scrambled) # grfg@rznvy.pbz

# Obfuscate an email address
obfuscated = obfuscate('test@email.com')
print(obfuscated)
"""
test@email.com
"""

# HTML Embeddable
link = javascriptify('test@email.com')
"""
<script type="text/javascript">document.write('<a href="mailto:&#x74;&#x65;&#x73;&#x74;&#x40;&#x65;&#x6d;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#x6d;">&#x74;&#x65;&#x73;&#x74;&#x40;&#x65;&#x6d;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#x6d;</a>');</script>
"""

# Combine scramble and obfuscate
link = javascriptify('test@email.com', do_scramble=True)
"""
<script type="text/javascript">document.write('<a href="mailto:&#x67;&#x72;&#x66;&#x67;&#x40;&#x72;&#x7a;&#x6e;&#x76;&#x79;&#x2e;&#x70;&#x62;&#x7a;" data-scrambled>&#x67;&#x72;&#x66;&#x67;&#x40;&#x72;&#x7a;&#x6e;&#x76;&#x79;&#x2e;&#x70;&#x62;&#x7a;</a>');</script>
"""

# "Click <here> to report your issue":
support_email = javascriptify('support@test.com', body='Name: \nProduct you encountered the issue with: \nYour issue:\n', custom_caption='here', do_scramble=True)
"""
Click {support_email} to report your issue
<script type="text/javascript">document.write('<a href="mailto:&#x66;&#x68;&#x63;&#x63;&#x62;&#x65;&#x67;&#x40;&#x67;&#x72;&#x66;&#x67;&#x2e;&#x70;&#x62;&#x7a;" data-scrambled data-body="&#x41;&#x6e;&#x7a;&#x72;&#x3a;&#x20;&#x25;&#x35;&#x51;&#x25;&#x35;&#x4e;&#x43;&#x65;&#x62;&#x71;&#x68;&#x70;&#x67;&#x20;&#x6c;&#x62;&#x68;&#x20;&#x72;&#x61;&#x70;&#x62;&#x68;&#x61;&#x67;&#x72;&#x65;&#x72;&#x71;&#x20;&#x67;&#x75;&#x72;&#x20;&#x76;&#x66;&#x66;&#x68;&#x72;&#x20;&#x6a;&#x76;&#x67;&#x75;&#x3a;&#x20;&#x25;&#x35;&#x51;&#x25;&#x35;&#x4e;&#x4c;&#x62;&#x68;&#x65;&#x20;&#x76;&#x66;&#x66;&#x68;&#x72;&#x3a;&#x25;&#x35;&#x51;&#x25;&#x35;&#x4e;" data-custom-caption="&#x75;&#x72;&#x65;&#x72;">&#x66;&#x68;&#x63;&#x63;&#x62;&#x65;&#x67;&#x40;&#x67;&#x72;&#x66;&#x67;&#x2e;&#x70;&#x62;&#x7a;</a>');</script>
```

To embed a deobfuscator in your HTML page, you can call the `deobfuscator` function:

```python
from mailscrambler import deobfuscator

# [...]

# Embed the deobfuscator
page_body += javascriptify('test@email.com', do_scramble=True)
page_body += deobfuscator()

# [...]
```

Note that unless scrambling is used, deobfuscator is not necessary.

## License

MIT License

```
MIT License

Copyright (c) 2023 Demetrio Battaglia

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://www.github.com/deme3/emailscrambler",
    "name": "mailscrambler",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Demetrio Battaglia",
    "author_email": "Demetrio Battaglia <deme3.iot@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/81/d5/c0a4b1824035fdf8ed30da46cc46c9d3d8e40d17f31bd6b5410c5b7d7c8f/mailscrambler-0.1.2.tar.gz",
    "platform": null,
    "description": "# mailscrambler\n\nA simple Python library to scramble and obfuscate email addresses in HTML pages, also comes with JavaScript deobfuscator.\n\n## Installation\n\n```bash\npip install mailscrambler\n```\n\n## Usage\n\n```python\nfrom mailscrambler import scramble, obfuscate, javascriptify, deobfuscator\n\n# Scramble an email address\nscrambled = scramble('test@email.com')\nprint(scrambled) # grfg@rznvy.pbz\n\n# Obfuscate an email address\nobfuscated = obfuscate('test@email.com')\nprint(obfuscated)\n\"\"\"\n&#x74;&#x65;&#x73;&#x74;&#x40;&#x65;&#x6d;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#x6d;\n\"\"\"\n\n# HTML Embeddable\nlink = javascriptify('test@email.com')\n\"\"\"\n<script type=\"text/javascript\">document.write('<a href=\"mailto:&#x74;&#x65;&#x73;&#x74;&#x40;&#x65;&#x6d;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#x6d;\">&#x74;&#x65;&#x73;&#x74;&#x40;&#x65;&#x6d;&#x61;&#x69;&#x6c;&#x2e;&#x63;&#x6f;&#x6d;</a>');</script>\n\"\"\"\n\n# Combine scramble and obfuscate\nlink = javascriptify('test@email.com', do_scramble=True)\n\"\"\"\n<script type=\"text/javascript\">document.write('<a href=\"mailto:&#x67;&#x72;&#x66;&#x67;&#x40;&#x72;&#x7a;&#x6e;&#x76;&#x79;&#x2e;&#x70;&#x62;&#x7a;\" data-scrambled>&#x67;&#x72;&#x66;&#x67;&#x40;&#x72;&#x7a;&#x6e;&#x76;&#x79;&#x2e;&#x70;&#x62;&#x7a;</a>');</script>\n\"\"\"\n\n# \"Click <here> to report your issue\":\nsupport_email = javascriptify('support@test.com', body='Name: \\nProduct you encountered the issue with: \\nYour issue:\\n', custom_caption='here', do_scramble=True)\n\"\"\"\nClick {support_email} to report your issue\n<script type=\"text/javascript\">document.write('<a href=\"mailto:&#x66;&#x68;&#x63;&#x63;&#x62;&#x65;&#x67;&#x40;&#x67;&#x72;&#x66;&#x67;&#x2e;&#x70;&#x62;&#x7a;\" data-scrambled data-body=\"&#x41;&#x6e;&#x7a;&#x72;&#x3a;&#x20;&#x25;&#x35;&#x51;&#x25;&#x35;&#x4e;&#x43;&#x65;&#x62;&#x71;&#x68;&#x70;&#x67;&#x20;&#x6c;&#x62;&#x68;&#x20;&#x72;&#x61;&#x70;&#x62;&#x68;&#x61;&#x67;&#x72;&#x65;&#x72;&#x71;&#x20;&#x67;&#x75;&#x72;&#x20;&#x76;&#x66;&#x66;&#x68;&#x72;&#x20;&#x6a;&#x76;&#x67;&#x75;&#x3a;&#x20;&#x25;&#x35;&#x51;&#x25;&#x35;&#x4e;&#x4c;&#x62;&#x68;&#x65;&#x20;&#x76;&#x66;&#x66;&#x68;&#x72;&#x3a;&#x25;&#x35;&#x51;&#x25;&#x35;&#x4e;\" data-custom-caption=\"&#x75;&#x72;&#x65;&#x72;\">&#x66;&#x68;&#x63;&#x63;&#x62;&#x65;&#x67;&#x40;&#x67;&#x72;&#x66;&#x67;&#x2e;&#x70;&#x62;&#x7a;</a>');</script>\n```\n\nTo embed a deobfuscator in your HTML page, you can call the `deobfuscator` function:\n\n```python\nfrom mailscrambler import deobfuscator\n\n# [...]\n\n# Embed the deobfuscator\npage_body += javascriptify('test@email.com', do_scramble=True)\npage_body += deobfuscator()\n\n# [...]\n```\n\nNote that unless scrambling is used, deobfuscator is not necessary.\n\n## License\n\nMIT License\n\n```\nMIT License\n\nCopyright (c) 2023 Demetrio Battaglia\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "E-mail scrambling library",
    "version": "0.1.2",
    "project_urls": {
        "Bug Tracker": "https://github.com/deme3/emailscrambler/issues",
        "Homepage": "https://github.com/deme3/emailscrambler"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b64b9298ce1ec27c2384877bcebc3a3636d9061db88eb0f8a76743eaae308701",
                "md5": "1d2ef98859cbdfe7be8f51536aff994a",
                "sha256": "4185b878774a86a890dfc0b4c9e61983df2e1e753a08ea279e870de9f0f21ec3"
            },
            "downloads": -1,
            "filename": "mailscrambler-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1d2ef98859cbdfe7be8f51536aff994a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 5302,
            "upload_time": "2023-06-14T06:39:00",
            "upload_time_iso_8601": "2023-06-14T06:39:00.695513Z",
            "url": "https://files.pythonhosted.org/packages/b6/4b/9298ce1ec27c2384877bcebc3a3636d9061db88eb0f8a76743eaae308701/mailscrambler-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "81d5c0a4b1824035fdf8ed30da46cc46c9d3d8e40d17f31bd6b5410c5b7d7c8f",
                "md5": "334193a65459c1350d0b1cd8824ff493",
                "sha256": "98f875de7ccb87f4fcac1c9f9ab9c75e51614be8344bfa10a2a610af94299ccb"
            },
            "downloads": -1,
            "filename": "mailscrambler-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "334193a65459c1350d0b1cd8824ff493",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 4362,
            "upload_time": "2023-06-14T06:39:03",
            "upload_time_iso_8601": "2023-06-14T06:39:03.657293Z",
            "url": "https://files.pythonhosted.org/packages/81/d5/c0a4b1824035fdf8ed30da46cc46c9d3d8e40d17f31bd6b5410c5b7d7c8f/mailscrambler-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-14 06:39:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "deme3",
    "github_project": "emailscrambler",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mailscrambler"
}
        
Elapsed time: 0.07939s