{"id":13681407,"url":"https://github.com/QuantConnect/quantconnect-stubs-generator","last_synced_at":"2025-04-30T03:31:23.995Z","repository":{"id":40533088,"uuid":"272169320","full_name":"QuantConnect/quantconnect-stubs-generator","owner":"QuantConnect","description":"Automatically generate Python type stubs for QuantConnect's Lean","archived":false,"fork":false,"pushed_at":"2025-04-29T14:03:18.000Z","size":408,"stargazers_count":13,"open_issues_count":10,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-29T15:23:13.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/QuantConnect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-06-14T09:19:17.000Z","updated_at":"2025-04-29T14:03:23.000Z","dependencies_parsed_at":"2024-03-28T17:52:28.899Z","dependency_job_id":"7c48b5c2-4b4d-459d-ad2b-3fd442084535","html_url":"https://github.com/QuantConnect/quantconnect-stubs-generator","commit_stats":{"total_commits":201,"total_committers":3,"mean_commits":67.0,"dds":0.06965174129353235,"last_synced_commit":"66f79c0d46a3f7133fa22f05d13e732818b00030"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantConnect%2Fquantconnect-stubs-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantConnect%2Fquantconnect-stubs-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantConnect%2Fquantconnect-stubs-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantConnect%2Fquantconnect-stubs-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuantConnect","download_url":"https://codeload.github.com/QuantConnect/quantconnect-stubs-generator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251527853,"owners_count":21603703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-08-02T13:01:30.367Z","updated_at":"2025-04-30T03:31:23.693Z","avatar_url":"https://github.com/QuantConnect.png","language":"C#","readme":"# QuantConnect Stubs Generator\n\n[![Build Status](https://github.com/QuantConnect/quantconnect-stubs-generator/workflows/Build/badge.svg)](https://github.com/QuantConnect/quantconnect-stubs-generator/actions?query=workflow%3ABuild)\n[![PyPI Version](https://img.shields.io/pypi/v/quantconnect-stubs)](https://pypi.org/project/quantconnect-stubs/)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/quantconnect-stubs)](https://pypi.org/project/quantconnect-stubs/)\n\nQuantConnect Stubs Generator is a program which generates Python stubs based on the C# files in [QuantConnect/Lean](https://github.com/QuantConnect/Lean) and [dotnet/runtime](https://github.com/dotnet/runtime). These stubs can be used by editors to provide type-aware features like autocomplete and auto-imports in QuantConnect strategies written in Python.\n\n## Installation\n\nThe latest version of the stubs can be installed by running `pip install --upgrade quantconnect-stubs`. Every time Lean is updated, a new version of the package is released containing the latest stubs (the same command can be used to update).\n\nThe stubs are tested to work well with PyCharm and VS Code in combination with the [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance) extension. They should also work with any other editor capable of indexing Python type stubs.\n\nIf type-aware features like autocomplete are not working after installing the package, make sure your editor supports indexing Python type stubs and is set up to index packages in the environment you installed the package into. Sometimes it may also help to restart your editor to make sure newly installed/updated packages are correctly indexed.\n\nAfter installing the stubs, you can copy the following line to the top of every Python file to have the same imports as the ones that are added by default in the cloud:\n```py\nfrom AlgorithmImports import *\n```\n\nThis line imports [all common QuantConnect members](https://github.com/QuantConnect/Lean/blob/master/Common/AlgorithmImports.py) and provides autocomplete for them.\n\n## Development\n\nTo run the generator locally, clone the repository, `cd` into the QuantConnectStubsGenerator project and run `dotnet run \u003cLean directory\u003e \u003cruntime directory\u003e \u003coutput directory\u003e`. Make sure `\u003cLean directory\u003e` points to a directory containing the [QuantConnect/Lean](https://github.com/QuantConnect/Lean) repository and `\u003cruntime directory\u003e` points to a directory containing the [dotnet/runtime](https://github.com/dotnet/runtime) repository.\n\nTo run the unit tests, run `dotnet test` in the root of the project. To run the integration tests read the [`integration/README.md`](./integration/README.md) file.\n\n\n### Using Dev Container\n\n- Open VSCode, click \"Reopen in Container Prompt\"; Or use command pallete \"Reopen in Container\"\n- After build and initial creation script completes, run VSCode launch option \"Run Stubs Generator\"\n\nThere is also a launch option for integration tests which works right out of the box in this dev container. Try option \"Python Integration Tests\"\n\n\n","funding_links":[],"categories":["C# #"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQuantConnect%2Fquantconnect-stubs-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FQuantConnect%2Fquantconnect-stubs-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FQuantConnect%2Fquantconnect-stubs-generator/lists"}