lexz


Namelexz JSON
Version 0.1.2 PyPI version JSON
download
home_page
SummaryTime traveler for obfuscation or another purpose
upload_time2023-08-19 18:46:51
maintainer
docs_urlNone
authorkrypton-byte
requires_python>=3.11,<4.0
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # lexz
Remapping Variable Using Abstract Syntax Tree [(AST)](https://docs.python.org/3/library/ast.html) 
# Tutorial
### Generate GraphViz File
```bash
python -m lexz -f test.py -g graph.dot
```
### Generate SVG Image
```bash
python -m lexz test.py -g graph.dot
dot -Tsvg output.svg graph.dot

#in single line
 python -m lexz -f test.py -g /dev/stdout|dot -Tsvg -o output.svg
```
# Demo
### Input

```python
class HelloWorld:
    def __init__(self) -> None:
        try:
            self.a = 3
        except Exception:
            self.b = 3

        class HelloWorld2((child:=HelloWorld)):
            def __init__(selx) -> None:
                selx.a = 3
                for i in range(10):
                    self.for_ = i
            @dfunc((decorator:=10))
            async def xyz(self, a):
                async for i in range(10):
                    self.tesx = i
                async with open("test3.py", "r") as f:
                    print(f.read())
                lambda ho: 123

@(lambda:(call:=dfunc((arg:=2))))()
def FunDec():
    data ={'a': (a:=(b:=(c:=3)))}
    pass

def dfunc(arg):
    def func(f):
        def execute(*args, **kwargs):
            return f(*args, **kwargs)
        return execute
    return func

```

### Result Graphviz( Dot Graph )
![image](assets/output.svg)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "lexz",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "krypton-byte",
    "author_email": "rosid6434@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/12/bb/125e359109420e5589fb1ad6cf6ed4915d21e7315fac865f70d8b4162583/lexz-0.1.2.tar.gz",
    "platform": null,
    "description": "# lexz\nRemapping Variable Using Abstract Syntax Tree [(AST)](https://docs.python.org/3/library/ast.html) \n# Tutorial\n### Generate GraphViz File\n```bash\npython -m lexz -f test.py -g graph.dot\n```\n### Generate SVG Image\n```bash\npython -m lexz test.py -g graph.dot\ndot -Tsvg output.svg graph.dot\n\n#in single line\n python -m lexz -f test.py -g /dev/stdout|dot -Tsvg -o output.svg\n```\n# Demo\n### Input\n\n```python\nclass HelloWorld:\n    def __init__(self) -> None:\n        try:\n            self.a = 3\n        except Exception:\n            self.b = 3\n\n        class HelloWorld2((child:=HelloWorld)):\n            def __init__(selx) -> None:\n                selx.a = 3\n                for i in range(10):\n                    self.for_ = i\n            @dfunc((decorator:=10))\n            async def xyz(self, a):\n                async for i in range(10):\n                    self.tesx = i\n                async with open(\"test3.py\", \"r\") as f:\n                    print(f.read())\n                lambda ho: 123\n\n@(lambda:(call:=dfunc((arg:=2))))()\ndef FunDec():\n    data ={'a': (a:=(b:=(c:=3)))}\n    pass\n\ndef dfunc(arg):\n    def func(f):\n        def execute(*args, **kwargs):\n            return f(*args, **kwargs)\n        return execute\n    return func\n\n```\n\n### Result Graphviz( Dot Graph )\n![image](assets/output.svg)\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Time traveler for obfuscation or another purpose",
    "version": "0.1.2",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "80f3dfe28c2f1fa9b8c7e07dbe6d6d45797449879f6679533a8a06d73d67cbdb",
                "md5": "0ae418d783fae2eb8986df433d1c32d2",
                "sha256": "0ee414a767fcaa0e124361ccbba54d8367c9ed2f1ec96d077de86e5bdfce426e"
            },
            "downloads": -1,
            "filename": "lexz-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0ae418d783fae2eb8986df433d1c32d2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 17794,
            "upload_time": "2023-08-19T18:46:49",
            "upload_time_iso_8601": "2023-08-19T18:46:49.812413Z",
            "url": "https://files.pythonhosted.org/packages/80/f3/dfe28c2f1fa9b8c7e07dbe6d6d45797449879f6679533a8a06d73d67cbdb/lexz-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "12bb125e359109420e5589fb1ad6cf6ed4915d21e7315fac865f70d8b4162583",
                "md5": "67ed6c1519df6af6fbbf918e38e36294",
                "sha256": "724d09291b11dc72ce063f5a033f216634f43d1cebfd5df675d3f8aee2d81f3a"
            },
            "downloads": -1,
            "filename": "lexz-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "67ed6c1519df6af6fbbf918e38e36294",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 16182,
            "upload_time": "2023-08-19T18:46:51",
            "upload_time_iso_8601": "2023-08-19T18:46:51.414977Z",
            "url": "https://files.pythonhosted.org/packages/12/bb/125e359109420e5589fb1ad6cf6ed4915d21e7315fac865f70d8b4162583/lexz-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-19 18:46:51",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "lexz"
}
        
Elapsed time: 0.15108s