{"id":18876886,"url":"https://github.com/autosoft-dev/treehuggerdocs","last_synced_at":"2026-01-28T10:02:19.045Z","repository":{"id":76152534,"uuid":"281071078","full_name":"autosoft-dev/treehuggerdocs","owner":"autosoft-dev","description":"The documentation website source for tree-hugger","archived":false,"fork":false,"pushed_at":"2020-07-21T09:07:19.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-23T20:08:52.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/autosoft-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-20T09:19:35.000Z","updated_at":"2020-07-21T09:07:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"f914416c-78f4-490c-a76c-978b6258ae6c","html_url":"https://github.com/autosoft-dev/treehuggerdocs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/autosoft-dev/treehuggerdocs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autosoft-dev%2Ftreehuggerdocs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autosoft-dev%2Ftreehuggerdocs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autosoft-dev%2Ftreehuggerdocs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autosoft-dev%2Ftreehuggerdocs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autosoft-dev","download_url":"https://codeload.github.com/autosoft-dev/treehuggerdocs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autosoft-dev%2Ftreehuggerdocs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28844011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T06:15:55.647Z","updated_at":"2026-01-28T10:02:19.040Z","avatar_url":"https://github.com/autosoft-dev.png","language":"HTML","readme":"---\ntitle: Treehugger Docs\n\n---\n\n## Welcome to GitHub Pages\n\nYou can use the [editor on GitHub](https://github.com/autosoft-dev/treehuggerdocs/edit/master/README.md) to maintain and preview the content for your website in Markdown files.\n\nWhenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.\n\n\n## Browse the documentation\n\n\n### Installation and setup\n\n### From pip:\n\nJust do\n```\npip install tree-hugger\n```\n\n### From Source:\n\n```\ngit clone https://github.com/autosoft-dev/tree-hugger.git\n\ncd tree-hugger\n\npip install -e .\n```\n\n_The installation process is tested in macOS Mojave, we have a [separate docker binding](https://github.com/autosoft-dev/tree-sitter-docker) for compiling the libraries for Linux and soon this library will be integrated in that as well_\n\n_You may need to install libgit2. In case you are in mac just use `brew install libgit2`_\n\n## Building the .so files\n\n_Please note that building the libraries has been tested under a macOS Mojave with Apple LLVM version 10.0.1 (clang-1001.0.46.4)_\n\n_Please check out our Linux specific instructions [here](https://github.com/autosoft-dev/tree-sitter-docker)_\n\nOnce this library is installed it gives you a command line utility to download and compile tree-sitter .so files with ease. As an example - \n\n```\ncreate_libs python\n```\n\nHere is the full usage guide of the command\n\n```\nusage: create_libs [-h] [-c] [-l LIB_NAME] langs [langs ...]\n\npositional arguments:\n  langs                 Give the name of languages for tree-sitter (php,\n                        python, go ...)\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c, --copy-to-workspace\n                        Shall we copy the created libs to the present dir?\n                        (default: False)\n  -l LIB_NAME, --lib-name LIB_NAME\n                        The name of the generated .so file\n```\n\n\n### Supported languages\n\n\n### Tutorials\n\n## A Quick Example\n\nFirst run the above command to generate the libraries. \n\nIn our settings we just use the `-c` flag to copy the generated `tree-sitter` library's `.so` file to our workspace.\nAnd once copied, we place it under a directory called `tslibs` (It is in the .gitignore). But of course, if you are using linux then this command probably won't work and you will need to use our [tree-sitter-docker](https://github.com/autosoft-dev/tree-sitter-docker) image and manually copy the final .so file.\n\nAnother thing that we need before we can analyze any code file is an yaml with queries. We have suuplied one example query file\nunder [**queries**](https://raw.githubusercontent.com/autosoft-dev/tree-hugger/master/queries/example_queries.yml) directory. \n\n*Please note that, you can set up two environment variables `QUERY_FILE_PATH` and `TS_LIB_PATH` for the query file path and \ntree-sitter lib path and then the libary will use them automatically. Otherwise, as an alternative, you can pass it when creating any `*Parser` object*\n\nAssuming that you have the necessary environment variable setup. The following line of code will create a `PythonParser` object\n\n```python\nfrom tree_hugger.core import PythonParser\n\npp = PythonParser()\n```\n\nAnd then you can pass in any Python file that you want to analyze, like so :\n\n```python\npp.parse_file(\"tests/assets/file_with_different_functions.py\")\nOut[3]: True\n```\n\n`parse_file` returns `True` if success\n\nAnd then you are free to use the methods exposed by that particular Parser object. As an example - \n\n```python\npp.get_all_function_names()\nOut[4]:\n['first_child',\n 'second_child',\n 'say_whee',\n 'wrapper',\n 'my_decorator',\n 'parent']\n```\n\nOR\n\n```python\npp.get_all_function_documentations()\nOut[5]:\n{'parent': '\"\"\"This is the parent function\\n    \\n    There are other lines in the doc string\\n    This is the third line\\n\\n    And this is the fourth\\n    \"\"\"',\n 'first_child': \"'''\\n        This is first child\\n        '''\",\n 'second_child': '\"\"\"\\n        This is second child\\n        \"\"\"',\n 'my_decorator': '\"\"\"\\n    Outer decorator function\\n    \"\"\"',\n 'say_whee': '\"\"\"\\n    Hellooooooooo\\n\\n    This is a function with decorators\\n    \"\"\"'}\n```\n\n### API reference\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautosoft-dev%2Ftreehuggerdocs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautosoft-dev%2Ftreehuggerdocs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautosoft-dev%2Ftreehuggerdocs/lists"}