Skip to main content

Baekjoon Online Judge CLI tools

Project description

BOJ CLI Tools (bojtools)

한국어 · English

주요 기능

  • 문제 선택/정보 조회 (pick, info)
  • Solved.ac 기반 랜덤/클래스 문제 추천 (random, class)
  • 템플릿 기반 코드 파일 생성 (generate)
  • 로컬 테스트 실행 (test)
  • 브라우저 기반 로그인/제출 (login, submit)
  • 통과한 문제의 풀이 확인 (solution)

설치

pip

pip3 install bojtools

uv

uv pip install bojtools

boj init

  • 설정파일을 초기화합니다.
boj init

생성 파일:

  • ~/.boj/config.toml

boj login

  • baekjoon, solved.ac에 자동으로 로그인합니다.
  • 브라우저가 필요합니다. (chromium, google-chrome, ...)
  • login 정보를 입력하면 브라우저가 실행 되며 자동 login 됩니다.
  • login cookie는 state_path에 저장됩니다.
    • Default: ~/.boj/state.json
boj login
...
Username: userid
Password: 

디렉토리 구조

  • config.tomlcode_dir~/code 인 경우 다음과 같이 구성됩니다. (default: ~/boj/code)
  • 각각의 문제 번호에 test case와 code file이 저장됩니다.
  • 1000.cpp, 1000.dfs.cpp 등도 가능하지만 하나의 파일만 있어야 합니다.
code
├── 1000
│   ├── 1000.cpp
│   ├── ans1.txt
│   └── in1.txt
├── 1006
│   ├── 1006.cpp
│   ├── ans1.txt
│   └── in1.txt

boj pick

  • 문제를 선택합니다.
  • 번호를 지정하지 않으면 현재 디렉토리의 정보를 표시합니다.
  • -f: 문제 상태 강제 갱신 (AC/WA)

예시:

boj p
boj p <번호>
boj pick <번호>
boj p -f <번호>

boj random

  • Solved.ac의 특정 난이도(Gold, Silver, ...) 문제를 랜덤으로 선택합니다.
  • -s: 최소 풀이 인원
  • -l: 문제 목록 출력
  • 난이도 (b, s, g, p, d, r, b1, g1, ...)
    • b: Bronze
    • s: Silver
    • g: Gold
    • p: Platinum
    • d: Diamond
    • r: Ruby

예시:

# Bronze 문제 출력
boj r b1 b5
boj random --silver

# Gold1 에서 Gold5 까지 문제 중 랜덤 선택
boj r -s 1000 g1 g5

# Silver2 에서 Gold3 까지 1000명 이상 푼 문제만 선택
boj r -s 1000 s2 g3

boj generate

  • 기본적인 template code를 생성합니다.
  • config.toml의 기본 template에서 복사됩니다. (Default: ~/.boj/template.cpp)

예시:

cd <번호>
boj g
boj generate <번호>

boj test

  • 코드를 compile해서 test case의 intput, output으로 test 합니다.
  • gcc 등의 compiler 설치가 필요합니다.

예시:

boj t
boj test <번호>
boj test <번호> -i <파일>

boj submit

  • 작성한 코드를 자동으로 제출합니다.
  • 문제 제출은 Cloudflare Turnstile 때문에 브라우저가 필수 입니다.
  • 브라우저에서 Cloudflare의 체크박스가 뜨면 클릭하시면 submit 됩니다.

예시:

boj s
boj submit <번호>
boj submit <번호> -i <파일>

boj solution

  • 통과한 문제의 다른 코드를 확인합니다.
  • 본인이 통과(AC)한 문제만 가능합니다.

예시:

boj q
boj solution <번호>

boj class <level>

  • solved.ac의 Class에서 랜덤하게 문제를 선택합니다.
  • -e: essential 문제
  • -l: 문제 목록 출력

예시:

# Solved.ac Class6 에서 미해결 문제 선택
boj c 6
boj class <Level>

boj info

  • 문제의 제목, url등 기본 정보를 출력합니다.
  • -l: 난이도 출력

예시:

boj i
boj info <번호>

# 난이도 출력 (Silver, Gold, Platinum, ...)
boj i -l <번호>

환경설정 경로

Linux

  • ~/.boj/config.toml

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

bojtools-0.7.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

bojtools-0.7.1-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

Details for the file bojtools-0.7.1.tar.gz.

File metadata

  • Download URL: bojtools-0.7.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bojtools-0.7.1.tar.gz
Algorithm Hash digest
SHA256 b7ae07b6b03737e9b3df98cbacbf296a487088331562e8a73141b407f90bce9c
MD5 6d5228e98b46bb00ae1c055303fa62d1
BLAKE2b-256 01e02cef0c9f004cb3d86968b17577caa67d934e71dda74e10096890463b8768

See more details on using hashes here.

File details

Details for the file bojtools-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: bojtools-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 22.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":null,"id":"forky","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for bojtools-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f3af2529fde4de01084ce411f53023159c5dbd7c0e36d466061587b5d0a9c8a4
MD5 7660d467e75a266465caea8bb28791a9
BLAKE2b-256 f06225cb987d854652687dcb1706bd7bb8c8d74d209e154127457b0ee4c2dd92

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