Skip to main content

爬取洛谷题目并用 markdown 格式保存

Project description

lgsv

LuoGu problem/training SaVer.

爬取洛谷题目。 尚未完工。

目前实现的功能:

  • 爬取题单
  • 将题目的 markdown 保存下来,存到当前目录的 out.md 中

使用方式:将仓库克隆下来,用 python 运行 src/lgsv/cli.py

命令行选项:

usage: lgsv [-h] [-p PROBLEM] [-t TRAINING] [--pandoc-args PANDOC_ARGS] [--order ORDER] [-c COOKIE] [-o OUTPUT]

爬取洛谷题目并且进行格式转化

options:
  -h, --help            show this help message and exit
  -p PROBLEM, --problem PROBLEM
                        题目列表
  -t TRAINING, --training TRAINING
                        题单列表
  --pandoc-args PANDOC_ARGS
                        传给pandoc的参数(未实现)
  --order ORDER         指定题目部分的顺序,用逗号分隔。
                            b/background 对应题目背景
                            s/samples 对应样例
                            if/inputFormat 对应输入格式
                            of/outputFormat 对应输出格式
                            h/hint 对应说明/提示
                            d/description 对应题目描述
                            tr/translation 对应题目翻译。

  -c COOKIE, --cookie COOKIE
                        洛谷cookie
  -o OUTPUT, --output OUTPUT
                        输出 markdown 的位置

例子: 例如,要将保存编号为 100,101 的题单和 P11233 按顺序保存题目背景,描述,输入格式,输出格式,将结果保存到 a.md ,使用 lgsv -t 100 -t 101 -p P11233 --order=b,d,if,of -o a.md

待办:

  1. 编写pytest
  2. 处理各类异常
  3. 添加更多功能
  4. 完善文档
  5. 其它格式

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

lgsv-0.1.3.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

lgsv-0.1.3-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file lgsv-0.1.3.tar.gz.

File metadata

  • Download URL: lgsv-0.1.3.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lgsv-0.1.3.tar.gz
Algorithm Hash digest
SHA256 79c091b4d7814ec69ea8d18c87dceec01f22382c5e6d26013fc098d0dc027a65
MD5 75957e4a70b97f77a26c9bc0b19dd4d1
BLAKE2b-256 b3570d60dd22b480818b173a70d8933fb4a5b21f2111d0e1f534e564b2b2740a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lgsv-0.1.3.tar.gz:

Publisher: upload.yaml on Sving1024/lgsv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lgsv-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: lgsv-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lgsv-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9c161e5f26598d4007b26d943cd8c909b7f320b855bca7a9e673a7675d773527
MD5 430b33997012d58ebe189a8a3d57f508
BLAKE2b-256 0f34b0fd537168df5c0f492883f03545cdaced6b2fa748378e0d8d8f862b505a

See more details on using hashes here.

Provenance

The following attestation bundles were made for lgsv-0.1.3-py3-none-any.whl:

Publisher: upload.yaml on Sving1024/lgsv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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