boj-cli
백준 온라인 저지 커맨드라인 인터페이스
설치
$ pip install boj-cli
로컬 설정
filetype.default_language에 들어갈 수 있는 값들은 지원 언어를 참고해주세요.
~/.boj-cli/config.json
command:
random:
tier: g1..g5
tags:
- dp
- math
run:
verbose: false
timeout: 15
submit:
verbose: false
timeout: 15
open: onlyaccepted
filetype:
py:
default_language: 'python3'
run: 'python3 $file'
cpp:
default_language: 'c++17'
compile: |
g++ -std=c++17 -O2 -Wall -Wno-sign-compare $file -o a.out
run: './a.out'
사용법
$ boj --help
usage: boj [-h] [-v] {login,submit,open,run,init,random} ...
positional arguments:
{login,submit,open,run,init,random}
login logs in to BOJ
submit submits your solution and trace the realtime statement
open opens a problem of given id in browser
run runs generated testcases
init creates testcases in current directory
random queries and opens a random problem in browser
options:
-h, --help show this help message and exit
-v, --version show version
로그인
백준 온라인 저지에서는 로그인 시 reCAPTCHA를 사용하고있기 때문에 로그인 과정은 조금 번거로울 수 있습니다.
$ boj login
위 명령어를 실행하면 selenium 브라우저가 실행됩니다. 로그인 정보를 입력하고 reCAPTCHA를 수행하면 로그인 세션 정보는 암호화되어 저장됩니다.
로그인 시 "로그인 상태 유지" 체크 박스를 반드시 선택해주세요.
테스트케이스 불러오기
백준 온라인저지에 올라와있는 문제에서 테스트케이스를 추려내어 현재 경로에 testcase.yaml 파일을 생성합니다.
생성된 testcase.yaml의 포멧에 맞게 커스텀 테스트케이스 또한 추가할 수 있습니다.
$ boj init {PROBLEM_ID}
ex) boj init 1234
테스트케이스 실행하기
init 명령어로 생성한 테스트케이스를 활용해 testcase.yaml 파일에 있는 모든 테스트케이스를 비동기적으로 실행하고
정답을 비교합니다.
$ boj run {FILE_PATH}
Options
--verbose bool: 자세한 아웃풋을 출력합니다. (예: 컴파일 에러)
--timeout int(sec): 각 테스트케이스의 타임아웃을 설정합니다 (Default: 5초)
코드 제출하기
로컬 소스 파일을 백준 온라인 저지에 제출하고 채점 현황을 실시간으로 출력합니다.
$ boj submit {FILE_PATH}
ex) boj submit ./1234.cpp
Options
--lang str: 제출할 언어를 선택합니다. 옵션이 주어지지 않은경우 local config 값으로 실행됩니다.
--open [ open | close | onlyaccepted ]: 코드 공개 여부를 설정합니다.
브라우저에서 문제 링크 열기
문제 링크를 기본 브라우저에서 엽니다.
$ boj open {PROBLEM_ID}
ex) boj open 1234
랜덤 문제 브라우저에서 열기
랜덤 문제 링크를 기본 브라우저에서 엽니다.
$ boj random --tier g1..g5 --tags dp math
여러개의 tags 옵션은 OR 조건으로 동작합니다. '내가 풀지 않은 문제' 만 쿼리됩니다.
Options
--tier: 문제 티어 쿼리
--tags: 문제 태그 쿼리
지원 언어
c++17python3pypy3c11textgolfscriptjava8c++98rubyc99c++11java11kotlin(jvm)c++14swiftjava8(openjdk)c++20c#node.jsgodrust2018go(gccgo)c++17(clang)java15d(ldc)phprust2015pascalluaperlf#visual-basicobjective-cobjective-c++c99(clang)c++98(clang)c++11(clang)c++14(clang)c11(clang)c++20(clang)c90c2xc90(clang)c2x(clang)typescriptassembly(32bit)assembly(64bit)bashfortranschemeadaawko-camlbrainf**kwhitespacetclrhinocobolpikesedintercalbcalgol68befungefree-basichaxelolcode아희system-verilogrust2021scala
Metadata
Release files for boj-cli 0.1.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| boj-cli-0.1.10.tar.gz | 24.8 kB | Without provenance | Details for boj-cli-0.1.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| boj_cli-0.1.10-py3-none-any.whl | Python 3 | none | any | Details for boj_cli-0.1.10-py3-none-any.whl |
Total release size: 50.9 kB
Release files / boj-cli-0.1.10.tar.gz
| Download URL | boj-cli-0.1.10.tar.gz |
|---|---|
| Size | 24.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53b2803473745c8ec5e342e3b1cdf8482a8416af1592c4794893bac7991362d5
|
|
BLAKE2b-256 checksum How to use checksums |
cb40c9bbdec27c2893da40fce864243ebe905331541c4be3614b9b0c261d3407
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / boj_cli-0.1.10-py3-none-any.whl
| Download URL | boj_cli-0.1.10-py3-none-any.whl |
|---|---|
| Size | 26.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
205b92a2938c0ff69c5e3f968807c643fb2482e6fce7b571d84581e9a459dbc5
|
|
BLAKE2b-256 checksum How to use checksums |
e53dfd95b68104875943a2ed9cdd8c5048dee37a926982bbbdfe56fa94ab993a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Security for boj-cli 0.1.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.