8000 Better description for package · fspv/python-leetcode@f908116 · GitHub
[go: up one dir, main page]

Skip to content

Commit f908116

Browse files
committed
Better description for package
1 parent 631f995 commit f908116

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+194
-161
lines changed

README.md

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,41 @@
11
# swagger-client
2-
This is a simple API
2+
Leetcode API implementation.
3+
4+
5+
This implements methods that are available publicly for leetcode.
6+
There is already an implementation of them in form of CLI [1], but
7+
it has a list of disadvantages.
8+
9+
10+
1. It is written in JS
11+
12+
2. Even for JS in order to reuse it you have to invoke it via CLI
13+
14+
3. It is not supported very well, so authentication doesn't work anymore
15+
16+
17+
So I have decided to create my own implementation and here is it.
18+
19+
20+
Using the swagger file you'll be able to generate the code for any language
21+
you like and start using leetcode API directly from your code.
22+
23+
24+
Just keep in mind that swagger doesn't really support cookie auth,
25+
which is needed in order to use LC API. If you use python you can
26+
just use the generated code from this repo. Otherwise you'll have to
27+
implement something like `fix_cookies.patch` for your target language.
28+
29+
30+
You can find examples of usage in `example.py`
31+
32+
33+
[1] https://github.com/skygragon/leetcode-cli
34+
335

436
This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
537

6-
- API version: 1.0.0-oas3
38+
- API version: 1.0.1-1
739
- Package version: 1.0.0
840
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen
941

@@ -17,9 +49,9 @@ Python 2.7 and 3.4+
1749
If the python package is hosted on Github, you can install directly from Github
1850

1951
```sh
20-
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
52+
pip install git+https://github.com/prius/python-leetcode.git
2153
```
22-
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
54+
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/prius/python-leetcode.git`)
2355

2456
Then import the package:
2557
```python

setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
@@ -26,14 +26,14 @@
2626
setup(
2727
name=NAME,
2828
version=VERSION,
29-
description="Simple Inventory API",
29+
description="Leetcode API",
3030
author_email="pv.safronov@gmail.com",
3131
url="",
32-
keywords=["Swagger", "Simple Inventory API"],
32+
keywords=["Swagger", "Leetcode API"],
3333
install_requires=REQUIRES,
3434
packages=find_packages(),
3535
include_package_data=True,
3636
long_description="""\
37-
This is a simple API # noqa: E501
37+
Leetcode API implementation. # noqa: E501
3838
"""
3939
)

swagger.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
openapi: 3.0.0
22
info:
3-
description: This is a simple API
4-
version: 1.0.0-oas3
5-
title: Simple Inventory API
3+
description: Leetcode API implementation.
4+
version: 1.0.1-1
5+
title: Leetcode API
66
contact:
7+
name: Pavel Safronov
78
email: pv.safronov@gmail.com
89
license:
910
name: Apache 2.0

swagger_client/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
# flake8: noqa
44

55
"""
6-
Simple Inventory API
6+
Leetcode API
77
8-
This is a simple API # noqa: E501
8+
Leetcode API implementation. # noqa: E501
99
10-
OpenAPI spec version: 1.0.0-oas3
10+
OpenAPI spec version: 1.0.1-1
1111
Contact: pv.safronov@gmail.com
1212
Generated by: https://github.com/swagger-api/swagger-codegen.git
1313
"""

swagger_client/api/default_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/api_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# coding: utf-8
22
"""
3-
Simple Inventory API
3+
Leetcode API
44
5-
This is a simple API # noqa: E501
5+
Leetcode API implementation. # noqa: E501
66
7-
OpenAPI spec version: 1.0.0-oas3
7+
OpenAPI spec version: 1.0.1-1
88
Contact: pv.safronov@gmail.com
99
Generated by: https://github.com/swagger-api/swagger-codegen.git
1010
"""

swagger_client/configuration.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""
@@ -267,6 +267,6 @@ def to_debug_report(self):
267267
return "Python SDK Debug Report:\n"\
268268
"OS: {env}\n"\
269269
"Python Version: {pyversion}\n"\
270-
"Version of the API: 1.0.0-oas3\n"\
270+
"Version of the API: 1.0.1-1\n"\
271271
"SDK Package Version: 1.0.0".\
272272
format(env=sys.platform, pyversion=sys.version)

swagger_client/models/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
# flake8: noqa
44
"""
5-
Simple Inventory API
5+
Leetcode API
66
7-
This is a simple API # noqa: E501
7+
Leetcode API implementation. # noqa: E501
88
9-
OpenAPI spec version: 1.0.0-oas3
9+
OpenAPI spec version: 1.0.1-1
1010
Contact: pv.safronov@gmail.com
1111
Generated by: https://github.com/swagger-api/swagger-codegen.git
1212
"""

swagger_client/models/base_submission_result.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/difficulty.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/graphql_query.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/graphql_query_variables.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/graphql_question.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/graphql_question_detail.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/graphql_response.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/id.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/inline_response200.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/interpretation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/one_of_graphql_response_data.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/one_ofid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/one_ofinline_response200.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

swagger_client/models/problems.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# coding: utf-8
22

33
"""
4-
Simple Inventory API
4+
Leetcode API
55
6-
This is a simple API # noqa: E501
6+
Leetcode API implementation. # noqa: E501
77
8-
OpenAPI spec version: 1.0.0-oas3
8+
OpenAPI spec version: 1.0.1-1
99
Contact: pv.safronov@gmail.com
1010
Generated by: https://github.com/swagger-api/swagger-codegen.git
1111
"""

0 commit comments

Comments
 (0)
0