Name | zalgolib JSON |
Version |
0.2.2
JSON |
| download |
home_page | |
Summary | A Python library for a _FULL_ Zalgo experience |
upload_time | 2023-12-07 16:16:43 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.7 |
license | MIT License Copyright (c) 2022 Yatri Trivedi Copyright (c) 2017 Greg Pritchard 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. |
keywords |
diacritics
horror
language encoding
obfuscation
text processing
zalgo
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ZalgoLib.py - A Full Zalgo Experience
### "Full"
While Zalgo text's popularity has waned, I'm still a fan. I also have a need for it. Other Zalgo libraries aren't recent, are a part of a larger set of tools, haven't been audited for security recently, or don't offer a lot of customization options.
The goal of this library is to give a decent set of defaults for en-Zalgo-fy [encoding to Zalgo] and de-Zalgo-fy [decoding from Zalgo] text to various degrees, as well as creating a custom class to dial in specific options.
I want to focus on functionality and periodically check in and update as needed.
### Documentation
##### dependencies
`random` (standard library) is the only dependency required. I've writting this library in python 3.7, but I expect it should work fairly well with a wider set of python versions. The key is my use of `random.choices()` - if this isn't importable, you'll need to adjust and tweak. I use it to select from the lists of diacritics _with replacement_.
##### zalgolib.py
* `enzalgofy` : takes two keyword arguments (`text` and `intensity`).
* `text` expects a `string` as input - you can feed it from whatever source you want.
* `intensity` expects an `int` from `0-100` (inclusive) and represents a rough percentage of the marks to include on each character. **The default is 50.** This scales up quite quickly, with values less than 20 being fairly light and values over 75 being very heavy. The differences lower or higher (respectively) from those points have some diminishing returns on legibility.
* In the future, I'd like to adjust this to provide some more variability from character to character within a block of text. I'd like to make this available as a parameter as well.
* `dezalgofy` : takes a zalgo `string`, converts it to ascii, and then back to utf-8. It ignores all errors. This isn't great overall, since if you're adding text that's accented already, it will return a stripped version of it. To be fair, that problem seems sufficiently complex to solve, and probably benefits from a language specifier and dictionaries, or some ML magic. As it is, it's fairly lean and does the job.
##### diacritics.py
This contains the various diacritics used in creating zalgo text. Currently, it contains:
* "DOWN_MARKS": marks that appear below a given character as `list`. There are currently 40 of these.
* "DOWN_LEN": length of `DOWN_MARKS` as `int`
* "UP_MARKS": marks that appear above a given character as `list`. There are currently 46 of these.
* "UP_LEN": length of `UP_MARKS` as `int`
* "MID_MARKS": marks that appear in the middle of, directly over, or overlapping the character slightly in front of or behind as `list`. There are currently 21 of these.
* "MID_LEN": length of `MID_MARKS` as `int`
This is a work-in-progress. There are many more overlapping marks to be found in the unicode space. I hope to revisit these soon and include some of the ones specified below:
* [Extended Combining Diacritical Marks](https://unicode-table.com/en/blocks/combining-diacritical-marks-extended/)
* [Combining Diacritical Marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks)
* Markers from other languages such as Arabic, Hebrew, Hindi, Bengali, Oriya, Malayalam, Tamil, etc.
These python lists can be added to in your script, but you'll have to recalculate the lengths (since length calculation from the module is done at import). Conversely, you can just append the characters to `diacritics.py` as you see fit, either by adding them to the list or adding them as new lists.
### To-Do
* add additional readily-available diacritics
* add variability to number of diacritics added per character
* based on text input
* make parameter available for adjusting
* perhaps add option for random variability?
* ~~add scaffolding to publish to PyPI~~
* ~~publish to PyPI~~
### License
I went with a permissive license (MIT) so feel free to use this any way you want. If you're proud of what you've made with my library, feel free to reach out and I'll try to add your project to a list below. Also, please check the credits section below, which also contributed to my choice to go with the MIT license.
### Credit
I am utilizing the list of diacritics that was carefully and conveniently laid out by [Gregory Neal](https://github.com/gregoryneal/) in his [Zalgo implementation](https://github.com/gregoryneal/zalgo/blob/master/code/zalgo_text/zalgo.py). Huge thanks to him for not only being a great programmer, but also using a very permissive MIT license that allows me to use a part of his work for my own. Just because I don't have to credit him doesn't mean I won't.
Raw data
{
"_id": null,
"home_page": "",
"name": "zalgolib",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "diacritics,horror,language encoding,obfuscation,text processing,zalgo",
"author": "",
"author_email": "Yatri Trivedi <jivanyatra@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/03/42/021cd18572d37950dac9d99585ab71dd4a838d733447d403b17ac13e6f25/zalgolib-0.2.2.tar.gz",
"platform": null,
"description": "# ZalgoLib.py - A Full Zalgo Experience\r\n\r\n### \"Full\"\r\n\r\nWhile Zalgo text's popularity has waned, I'm still a fan. I also have a need for it. Other Zalgo libraries aren't recent, are a part of a larger set of tools, haven't been audited for security recently, or don't offer a lot of customization options.\r\n\r\nThe goal of this library is to give a decent set of defaults for en-Zalgo-fy [encoding to Zalgo] and de-Zalgo-fy [decoding from Zalgo] text to various degrees, as well as creating a custom class to dial in specific options.\r\n\r\nI want to focus on functionality and periodically check in and update as needed. \r\n\r\n### Documentation\r\n\r\n##### dependencies\r\n\r\n`random` (standard library) is the only dependency required. I've writting this library in python 3.7, but I expect it should work fairly well with a wider set of python versions. The key is my use of `random.choices()` - if this isn't importable, you'll need to adjust and tweak. I use it to select from the lists of diacritics _with replacement_. \r\n\r\n##### zalgolib.py\r\n\r\n* `enzalgofy` : takes two keyword arguments (`text` and `intensity`).\r\n * `text` expects a `string` as input - you can feed it from whatever source you want.\r\n * `intensity` expects an `int` from `0-100` (inclusive) and represents a rough percentage of the marks to include on each character. **The default is 50.** This scales up quite quickly, with values less than 20 being fairly light and values over 75 being very heavy. The differences lower or higher (respectively) from those points have some diminishing returns on legibility.\r\n * In the future, I'd like to adjust this to provide some more variability from character to character within a block of text. I'd like to make this available as a parameter as well.\r\n\r\n* `dezalgofy` : takes a zalgo `string`, converts it to ascii, and then back to utf-8. It ignores all errors. This isn't great overall, since if you're adding text that's accented already, it will return a stripped version of it. To be fair, that problem seems sufficiently complex to solve, and probably benefits from a language specifier and dictionaries, or some ML magic. As it is, it's fairly lean and does the job.\r\n\r\n##### diacritics.py\r\n\r\nThis contains the various diacritics used in creating zalgo text. Currently, it contains:\r\n\r\n* \"DOWN_MARKS\": marks that appear below a given character as `list`. There are currently 40 of these.\r\n* \"DOWN_LEN\": length of `DOWN_MARKS` as `int`\r\n* \"UP_MARKS\": marks that appear above a given character as `list`. There are currently 46 of these.\r\n* \"UP_LEN\": length of `UP_MARKS` as `int`\r\n* \"MID_MARKS\": marks that appear in the middle of, directly over, or overlapping the character slightly in front of or behind as `list`. There are currently 21 of these.\r\n* \"MID_LEN\": length of `MID_MARKS` as `int`\r\n\r\nThis is a work-in-progress. There are many more overlapping marks to be found in the unicode space. I hope to revisit these soon and include some of the ones specified below:\r\n\r\n* [Extended Combining Diacritical Marks](https://unicode-table.com/en/blocks/combining-diacritical-marks-extended/)\r\n* [Combining Diacritical Marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks)\r\n* Markers from other languages such as Arabic, Hebrew, Hindi, Bengali, Oriya, Malayalam, Tamil, etc.\r\n\r\nThese python lists can be added to in your script, but you'll have to recalculate the lengths (since length calculation from the module is done at import). Conversely, you can just append the characters to `diacritics.py` as you see fit, either by adding them to the list or adding them as new lists.\r\n\r\n### To-Do\r\n\r\n* add additional readily-available diacritics\r\n* add variability to number of diacritics added per character\r\n * based on text input\r\n * make parameter available for adjusting\r\n * perhaps add option for random variability?\r\n* ~~add scaffolding to publish to PyPI~~\r\n* ~~publish to PyPI~~\r\n\r\n### License\r\n\r\nI went with a permissive license (MIT) so feel free to use this any way you want. If you're proud of what you've made with my library, feel free to reach out and I'll try to add your project to a list below. Also, please check the credits section below, which also contributed to my choice to go with the MIT license.\r\n\r\n### Credit\r\n\r\nI am utilizing the list of diacritics that was carefully and conveniently laid out by [Gregory Neal](https://github.com/gregoryneal/) in his [Zalgo implementation](https://github.com/gregoryneal/zalgo/blob/master/code/zalgo_text/zalgo.py). Huge thanks to him for not only being a great programmer, but also using a very permissive MIT license that allows me to use a part of his work for my own. Just because I don't have to credit him doesn't mean I won't.\r\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2022 Yatri Trivedi Copyright (c) 2017 Greg Pritchard 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.",
"summary": "A Python library for a _FULL_ Zalgo experience",
"version": "0.2.2",
"project_urls": {
"Homepage": "https://github.com/jivanyatra/zalgolib/",
"Issues": "https://github.com/jivanyatra/zalgolib/issues"
},
"split_keywords": [
"diacritics",
"horror",
"language encoding",
"obfuscation",
"text processing",
"zalgo"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0ab7b2c350a80a69af35e42cab730268280244f87f2f07e3267b88c4f45037de",
"md5": "79895b5a9766e15c845f6b960f358cea",
"sha256": "2aeadaf652cd9f8167418269c923d769881762e123c4a9477b22f3ac95f55ffc"
},
"downloads": -1,
"filename": "zalgolib-0.2.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "79895b5a9766e15c845f6b960f358cea",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 6572,
"upload_time": "2023-12-07T16:16:42",
"upload_time_iso_8601": "2023-12-07T16:16:42.231588Z",
"url": "https://files.pythonhosted.org/packages/0a/b7/b2c350a80a69af35e42cab730268280244f87f2f07e3267b88c4f45037de/zalgolib-0.2.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0342021cd18572d37950dac9d99585ab71dd4a838d733447d403b17ac13e6f25",
"md5": "c6b0613b875b91b4df4b57473a1b1e57",
"sha256": "9deda04f9381a0a90d64fef40e3519484f27d8736f7606ff3d22dd0eb17e7ecd"
},
"downloads": -1,
"filename": "zalgolib-0.2.2.tar.gz",
"has_sig": false,
"md5_digest": "c6b0613b875b91b4df4b57473a1b1e57",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 6972,
"upload_time": "2023-12-07T16:16:43",
"upload_time_iso_8601": "2023-12-07T16:16:43.981839Z",
"url": "https://files.pythonhosted.org/packages/03/42/021cd18572d37950dac9d99585ab71dd4a838d733447d403b17ac13e6f25/zalgolib-0.2.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-07 16:16:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jivanyatra",
"github_project": "zalgolib",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "zalgolib"
}