{"id":33610765,"url":"https://github.com/carrascomj/shapels","last_synced_at":"2026-04-05T21:17:13.004Z","repository":{"id":327659850,"uuid":"1106252778","full_name":"carrascomj/shapels","owner":"carrascomj","description":"shape inference for torch in your editor","archived":false,"fork":false,"pushed_at":"2026-01-07T16:28:38.000Z","size":774,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2026-01-13T11:41:43.724Z","etag":null,"topics":["dx","lsp","static-analysis","torch"],"latest_commit_sha":null,"homepage":"https://carrascomj.github.io/shapelsbook/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carrascomj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-28T22:22:34.000Z","updated_at":"2026-01-07T16:28:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/carrascomj/shapels","commit_stats":null,"previous_names":["carrascomj/shapels"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/carrascomj/shapels","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrascomj%2Fshapels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrascomj%2Fshapels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrascomj%2Fshapels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrascomj%2Fshapels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carrascomj","download_url":"https://codeload.github.com/carrascomj/shapels/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carrascomj%2Fshapels/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28585325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: 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":["dx","lsp","static-analysis","torch"],"created_at":"2025-11-30T21:03:09.747Z","updated_at":"2026-04-05T21:17:12.998Z","avatar_url":"https://github.com/carrascomj.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shapels\n\n**shapels** provides _shape inference_ for torch tensors inside your editor.\n\n![showcase of shapels inside helix](./assets/readme_showcase.png)\n\n_But what does that mean?_ In the example above, **shapels** tracks the tensor dimensions\nand is able to report the wrong matrix multiplication that would have caused a runtime error.\n\nNot only that: when hovering over a tensor, it reports the shape of that tensor\nthrough static analysis, even if no annotation was provided. It's effectively\nreplacing\n\n```python\nprint(f\"x -\u003e {x.shape}\")\n```\n\nbut before running any code, in your editor of choice.\n\n## Installation\n\nIf you are not using VSCode or Zed, go to [the latest release\npage](https://github.com/carrascomj/shapels/releases/latest), download the\nbinary for your platform, unzip it and put it in your path.\n\n**shapels**'s VScode extension comes with the binaries prebundled so this\nstep is not needed.\n\n### Installing from source\n\nThe first step is to [install Rust](https://www.rust-lang.org/tools/install):\n\n```bash\n# Unix-like OS\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nAfter cloning this repository, it can be installed with [cargo](https://doc.rust-lang.org/stable/cargo/guide/cargo-home.html):\n\n```bash\ngit clone https://github.com/carrascomj/shapels.git\ncd shapels\ncargo install --path .\n```\n\n## Editor support\n\n* [VSCode](https://code.visualstudio.com/download)\n\nJust install it from the extensions marketplace, it comes with the `shapels` binary\nprebundled for your platform.\n\nBut why don't you try Zed?\n\n* [Zed](https://zed.dev)\n\nInstall it from the extensions tab. The extension will try to use the **shapels**\nbinary present in the `$PATH` (configurable) and, if not found, download it.\n\nBut why don't you try PyCharm?\n\n* [PyCharm](https://jetbrains.com/pycharm)\n\n1. Install the [LSP4Ij plugin](https://github.com/redhat-developer/lsp4ij): `Settings` \u003e `Plugins` \u003e Search \"LSP4Ij\".\n2. Once installed, go to `Settings` \u003e `Languages \u0026 Frameworks` \u003e `Language Servers` and click on `+` for adding a new language server.\n3. Call it **shapels**, the `Command` should be just **shapels** (if it's already in your `$PATH`.) Additionally, go to `Mappings` \u003e `+` and add \"Python\" as the language.\n4. Go to [the latest release page](https://github.com/carrascomj/shapels/releases/latest), download the binary for your platform, unpack it and put it on your `$PATH`.\n\nBut why don't you try neovim?\n\n* [neovim](https://neovim.io/)\n\nAdd it to your config (you must have **shapels** in you path):\n\n```lua\nvim.lsp.config('shapels', {cmd={'shapels'}, root_markers={'pyproject.toml', 'setup.py', 'setup.cfg'}, filetypes={'python'}})\nvim.lsp.enable('shapels')\n```\n\nBut why don't you try helix?\n\n* [helix](https://helix-editor.com/)\n\nAdd it to your `languages.toml` (you must have **shapels** in you path):\n\n```toml\n[language-server]\nshapels = {command = \"shapels\"}\n\n[[language]]\nname = \"python\"\nscope = \"source.python\"\ninjection-regex = \"py(thon)?\"\nfile-types = [\"py\", \"pyi\", \"py3\", \"pyw\", \"ptl\", \"rpy\", \"cpy\", \"ipy\", \"pyt\", { glob = \".python_history\" }, { glob = \".pythonstartup\" }, { glob = \".pythonrc\" }, { glob = \"*SConstruct\" }, { glob = \"*SConscript\" }, { glob = \"*sconstruct\" }]\nshebangs = [\"python\", \"uv\"]\nroots = [\"pyproject.toml\", \"setup.py\", \"poetry.lock\", \"pyrightconfig.json\"]\ncomment-token = \"#\"\n# WARN: probably you have other LS already here, just add shapels to the list\nlanguage-servers = [\"shapels\"]\nindent = { tab-width = 4, unit = \"    \" }  \n```\n\nBut why don't you try Emacs?\n\n* [Emacs](https://www.gnu.org/software/emacs/)\n\nIt's a language server: it takes input from stdin and sends output to stdout; you probably\nknow how to handle that.\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarrascomj%2Fshapels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarrascomj%2Fshapels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarrascomj%2Fshapels/lists"}