Skip to main content

A Python library to interact with the Luogu online judge system

Project description

luogu-api-python

A Python implementation of the Luogu API

Project Description

luogu-api-python is a Python library that provides an interface to interact with the Luogu online judge system. It allows users to programmatically manage problems, and user operations on Luogu. This library aims to simplify the process of automating tasks on Luogu by providing easy-to-use methods and classes.

Upstream docs: https://github.com/sjx233/luogu-api-docs

Installation

To install the package, use pip:

$ pip3 install luogu-api-python

To install the package from source, follow these steps:

  1. Clone the repository:

    $ git clone https://github.com/NekoOS-Group/luogu-api-python.git
    $ cd luogu-api-python
    
  2. Install the dependencies:

    $ pip3 install -r requirements.txt
    
  3. Install the package:

    $ python3 setup.py install
    

Usage

Here is an example of how to use the package:

import pyLuogu

# Initialize the API with cookies
cookies = pyLuogu.LuoguCookies.from_file("cookies.json")
luogu = pyLuogu.luoguAPI(cookies=cookies)

# Get a list of problems
problems = luogu.get_problem_list()
for problem in problems:
    print(problem.title)

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Todo List

Methods of class LuoguAPI

  • Problem
    • get_problem_list
    • get_created_problem_list
    • get_team_problem_list
    • get_problem
    • get_problem_settings
    • update_problem_settings
    • update_testcases_settings
    • create_problem
    • delete_problem
    • transfer_problem
    • download_testcases
    • upload_testcases
  • UserOperation
    • login
    • logout
    • me

Others

  • asyncLuoguAPI
  • staticLuoguAPI

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

luogu_api_python-0.0.1a0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

luogu_api_python-0.0.1a0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file luogu_api_python-0.0.1a0.tar.gz.

File metadata

  • Download URL: luogu_api_python-0.0.1a0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for luogu_api_python-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 11a3f30b478aacd52e954f1ec22b7f47679892e6cde1a123c293be61be806eb0
MD5 857506d429f502ef958382ac158a9e9d
BLAKE2b-256 8186caf341dbcaa088016a58c9e6e3df73f8ec59d6ff3dae2cd0f427cf8d598b

See more details on using hashes here.

File details

Details for the file luogu_api_python-0.0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for luogu_api_python-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee5bac487e16f0410344f97411ad400b57b61261759b9167a392e1a01985f756
MD5 f4feea64722e071204090b6f0f69fded
BLAKE2b-256 159c945c48dbe5fe73169cb79da26d33ec76fa96dedac66084800bb4ec6c3f87

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page