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.4.tar.gz (6.2 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.4-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lgsv-0.1.4.tar.gz
  • Upload date:
  • Size: 6.2 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.4.tar.gz
Algorithm Hash digest
SHA256 a165cba5c0bf7050b78f2443b4bd9f8aefe2bbfbb927d439aa45511f3e78d856
MD5 70c44e1dbeaa89eb0c902e156c952616
BLAKE2b-256 243353f4d21689e71b5f1f87769c9b05c2b21c59bc899361ccd906e9a0102fe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for lgsv-0.1.4.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.4-py3-none-any.whl.

File metadata

  • Download URL: lgsv-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 31cb3b16bee6bd4e15a8af7a8ef9944cdb8e7dad9065fd86569540b39075e542
MD5 836b5b5b14672b1a11a0259a22ca2f23
BLAKE2b-256 87b442ca7c8b112c4f72bf9486f549fd7a56274a450b722591217263a649762b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lgsv-0.1.4-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