Metadata-Version: 2.1
Name: leetquery
Version: 0.2.5
Summary: Query and analyze data from leetcode
Home-page: https://github.com/ShuYuHuang/leetquery
Author: Shu-Yu Huang
Author-email: b123767195@gmail.com
License: MIT
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7.0
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest ; extra == 'test'
Requires-Dist: mock ; extra == 'test'
Requires-Dist: pre-commit ; extra == 'test'
Requires-Dist: black ==22.3.0 ; extra == 'test'
Requires-Dist: flake8 ==4.0.1 ; extra == 'test'
Requires-Dist: flake8-docstrings ==1.6.0 ; extra == 'test'


# LeetQuery

[![PyPI version](https://badge.fury.io/py/leetquery.svg)](https://badge.fury.io/py/leetquery) ![Test](https://github.com/ShuYuHuang/leetquery/actions/workflows/python-app.yml/badge.svg)  [![Downloads](https://static.pepy.tech/badge/leetquery)](https://pepy.tech/project/leetquery)

A library for retriving Human Resource information from Leetcode.

## Install
``` shell
    pip install leetquery
```
## Usage
### Retrieving User Submissions
Just enter user name and limit of query!
``` python
from leetquery.user import get_submissions

submissions = get_submissions(username="syhaung", limit=12)
```
return value:
```
["question1", "question2", ...]
```

### For Problems
#### Retrieving Problem Discription
Just enter probelm nameSlug and get the problem discription in HTML~~
``` python
from leetquery.problem import get_discription

submissions = get_discription(problemname="two-sum")
```
return value:
``` html
<p>Given an array of integers <code>nums</code>&nbsp;and an integer <code>target</code>, return <em>indices of the two numbers such that they add up to <code>target</code></em>.</p>
...
```
#### Retrieving Problem Statistics
Get the statistics for the problem in a JSON format, help you quantize difficulties
``` python
from leetquery.problem import get_stats
stat = get_stats("two-sum")
assert isinstance(stat, dict) and \
    list(stat.keys()) == ['totalAccepted', 'totalSubmission', 'totalAcceptedRaw', 'totalSubmissionRaw', 'acRate']
```
return value:
``` json
{
    'totalAccepted': '10.4M',
    'totalSubmission': '20.6M',
    ...
}
```
