{"id":19704926,"url":"https://github.com/fspv/python-leetcode","last_synced_at":"2025-07-21T08:01:59.409Z","repository":{"id":39339359,"uuid":"388199446","full_name":"fspv/python-leetcode","owner":"fspv","description":"python client for leetcode api","archived":false,"fork":false,"pushed_at":"2025-03-22T19:12:59.000Z","size":220,"stargazers_count":79,"open_issues_count":5,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T01:44:14.905Z","etag":null,"topics":["leetcode","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fspv.png","metadata":{"files":{"readme":"README.generated.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}},"created_at":"2021-07-21T17:42:53.000Z","updated_at":"2025-06-16T20:03:55.000Z","dependencies_parsed_at":"2025-03-22T20:29:51.521Z","dependency_job_id":null,"html_url":"https://github.com/fspv/python-leetcode","commit_stats":null,"previous_names":["prius/python-leetcode"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/fspv/python-leetcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fspv%2Fpython-leetcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fspv%2Fpython-leetcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fspv%2Fpython-leetcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fspv%2Fpython-leetcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fspv","download_url":"https://codeload.github.com/fspv/python-leetcode/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fspv%2Fpython-leetcode/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266263057,"owners_count":23901353,"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":["leetcode","python"],"created_at":"2024-11-11T21:25:17.707Z","updated_at":"2025-07-21T08:01:59.384Z","avatar_url":"https://github.com/fspv.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# leetcode\nLeetcode API implementation.\n\nThis Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:\n\n- API version: 1.0.1-1\n- Package version: 1.0.0\n- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen\n\n## Requirements.\n\nPython 2.7 and 3.4+\n\n## Installation \u0026 Usage\n### pip install\n\nIf the python package is hosted on Github, you can install directly from Github\n\n```sh\npip install git+https://github.com/prius/python-leetcode.git\n```\n(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/prius/python-leetcode.git`)\n\nThen import the package:\n```python\nimport leetcode \n```\n\n### Setuptools\n\nInstall via [Setuptools](http://pypi.python.org/pypi/setuptools).\n\n```sh\npython setup.py install --user\n```\n(or `sudo python setup.py install` to install the package for all users)\n\nThen import the package:\n```python\nimport leetcode\n```\n\n## Getting Started\n\nPlease follow the [installation procedure](#installation--usage) and then run the following:\n\n```python\nfrom __future__ import print_function\nimport time\nimport leetcode\nfrom leetcode.rest import ApiException\nfrom pprint import pprint\n\n# Configure API key authorization: cookieCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['csrftoken'] = 'Bearer'\n# Configure API key authorization: cookieSession\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'\n# Configure API key authorization: headerCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['x-csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'\n# Configure API key authorization: referer\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['Referer'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['Referer'] = 'Bearer'\n\n# create an instance of the API class\napi_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))\ntopic = 'topic_example' # str | \n\ntry:\n    api_response = api_instance.api_problems_topic_get(topic)\n    pprint(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling DefaultApi-\u003eapi_problems_topic_get: %s\\n\" % e)\n\n# Configure API key authorization: cookieCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['csrftoken'] = 'Bearer'\n# Configure API key authorization: cookieSession\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'\n# Configure API key authorization: headerCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['x-csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'\n# Configure API key authorization: referer\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['Referer'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['Referer'] = 'Bearer'\n\n# create an instance of the API class\napi_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))\nbody = leetcode.GraphqlQuery() # GraphqlQuery | GraphQL query (optional)\n\ntry:\n    api_response = api_instance.graphql_post(body=body)\n    pprint(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling DefaultApi-\u003egraphql_post: %s\\n\" % e)\n\n# Configure API key authorization: cookieCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['csrftoken'] = 'Bearer'\n# Configure API key authorization: cookieSession\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'\n# Configure API key authorization: headerCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['x-csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'\n# Configure API key authorization: referer\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['Referer'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['Referer'] = 'Bearer'\n\n# create an instance of the API class\napi_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))\nproblem = 'problem_example' # str | \nbody = leetcode.TestSubmission() # TestSubmission | Solution to test (optional)\n\ntry:\n    api_response = api_instance.problems_problem_interpret_solution_post(problem, body=body)\n    pprint(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling DefaultApi-\u003eproblems_problem_interpret_solution_post: %s\\n\" % e)\n\n# Configure API key authorization: cookieCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['csrftoken'] = 'Bearer'\n# Configure API key authorization: cookieSession\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'\n# Configure API key authorization: headerCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['x-csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'\n# Configure API key authorization: referer\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['Referer'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['Referer'] = 'Bearer'\n\n# create an instance of the API class\napi_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))\nproblem = 'problem_example' # str | \nbody = leetcode.Submission() # Submission | Solution to test (optional)\n\ntry:\n    api_response = api_instance.problems_problem_submit_post(problem, body=body)\n    pprint(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling DefaultApi-\u003eproblems_problem_submit_post: %s\\n\" % e)\n\n# Configure API key authorization: cookieCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['csrftoken'] = 'Bearer'\n# Configure API key authorization: cookieSession\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['LEETCODE_SESSION'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['LEETCODE_SESSION'] = 'Bearer'\n# Configure API key authorization: headerCSRF\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['x-csrftoken'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['x-csrftoken'] = 'Bearer'\n# Configure API key authorization: referer\nconfiguration = leetcode.Configuration()\nconfiguration.api_key['Referer'] = 'YOUR_API_KEY'\n# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed\n# configuration.api_key_prefix['Referer'] = 'Bearer'\n\n# create an instance of the API class\napi_instance = leetcode.DefaultApi(leetcode.ApiClient(configuration))\nid = leetcode.Id() # Id | Either submission id (int) or interpretation id (string)\n\ntry:\n    api_response = api_instance.submissions_detail_id_check_get(id)\n    pprint(api_response)\nexcept ApiException as e:\n    print(\"Exception when calling DefaultApi-\u003esubmissions_detail_id_check_get: %s\\n\" % e)\n```\n\n## Documentation for API Endpoints\n\nAll URIs are relative to *https://leetcode.com*\n\nClass | Method | HTTP request | Description\n------------ | ------------- | ------------- | -------------\n*DefaultApi* | [**api_problems_topic_get**](docs/DefaultApi.md#api_problems_topic_get) | **GET** /api/problems/{topic}/ | \n*DefaultApi* | [**graphql_post**](docs/DefaultApi.md#graphql_post) | **POST** /graphql | \n*DefaultApi* | [**problems_problem_interpret_solution_post**](docs/DefaultApi.md#problems_problem_interpret_solution_post) | **POST** /problems/{problem}/interpret_solution/ | \n*DefaultApi* | [**problems_problem_submit_post**](docs/DefaultApi.md#problems_problem_submit_post) | **POST** /problems/{problem}/submit/ | \n*DefaultApi* | [**submissions_detail_id_check_get**](docs/DefaultApi.md#submissions_detail_id_check_get) | **GET** /submissions/detail/{id}/check/ | \n\n## Documentation For Models\n\n - [AnyOfGraphqlQueryVariables](docs/AnyOfGraphqlQueryVariables.md)\n - [AnyOfGraphqlQuestionDetailSolution](docs/AnyOfGraphqlQuestionDetailSolution.md)\n - [BaseSubmissionResult](docs/BaseSubmissionResult.md)\n - [Difficulty](docs/Difficulty.md)\n - [GraphqlData](docs/GraphqlData.md)\n - [GraphqlProblemsetQuestionList](docs/GraphqlProblemsetQuestionList.md)\n - [GraphqlQuery](docs/GraphqlQuery.md)\n - [GraphqlQueryGetQuestionDetailVariables](docs/GraphqlQueryGetQuestionDetailVariables.md)\n - [GraphqlQueryProblemsetQuestionListVariables](docs/GraphqlQueryProblemsetQuestionListVariables.md)\n - [GraphqlQueryProblemsetQuestionListVariablesFilterInput](docs/GraphqlQueryProblemsetQuestionListVariablesFilterInput.md)\n - [GraphqlQueryVariables](docs/GraphqlQueryVariables.md)\n - [GraphqlQuestionCodeSnippet](docs/GraphqlQuestionCodeSnippet.md)\n - [GraphqlQuestionContributor](docs/GraphqlQuestionContributor.md)\n - [GraphqlQuestionDetail](docs/GraphqlQuestionDetail.md)\n - [GraphqlQuestionSolution](docs/GraphqlQuestionSolution.md)\n - [GraphqlQuestionTopicTag](docs/GraphqlQuestionTopicTag.md)\n - [GraphqlResponse](docs/GraphqlResponse.md)\n - [GraphqlUser](docs/GraphqlUser.md)\n - [Id](docs/Id.md)\n - [InlineResponse200](docs/InlineResponse200.md)\n - [Interpretation](docs/Interpretation.md)\n - [OneOfid](docs/OneOfid.md)\n - [OneOfinlineResponse200](docs/OneOfinlineResponse200.md)\n - [Problems](docs/Problems.md)\n - [Stat](docs/Stat.md)\n - [StatStatusPair](docs/StatStatusPair.md)\n - [Submission](docs/Submission.md)\n - [SubmissionId](docs/SubmissionId.md)\n - [SubmissionResult](docs/SubmissionResult.md)\n - [TestSubmission](docs/TestSubmission.md)\n - [TestSubmissionResult](docs/TestSubmissionResult.md)\n\n## Documentation For Authorization\n\n\n## cookieCSRF\n\n- **Type**: API key\n- **API key parameter name**: csrftoken\n- **Location**: URL query string\n\n## cookieSession\n\n- **Type**: API key\n- **API key parameter name**: LEETCODE_SESSION\n- **Location**: URL query string\n\n## headerCSRF\n\n- **Type**: API key\n- **API key parameter name**: x-csrftoken\n- **Location**: HTTP header\n\n## referer\n\n- **Type**: API key\n- **API key parameter name**: Referer\n- **Location**: HTTP header\n\n\n## Author\n\npv.safronov@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffspv%2Fpython-leetcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffspv%2Fpython-leetcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffspv%2Fpython-leetcode/lists"}