Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fedebotu/k-trains

An app for automatically reserving trains in Korea - both Korail and SRT - even when sold out
https://github.com/fedebotu/k-trains

bot korail korea ktx python reservation scripts srt streamlit trains

Last synced: 8 days ago
JSON representation

An app for automatically reserving trains in Korea - both Korail and SRT - even when sold out

Awesome Lists containing this project

README

        

# K-Trains ๐Ÿ‡ฐ๐Ÿ‡ท-๐Ÿš„

[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_red.svg)](https://k-trains.streamlit.app)[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)[![python_sup](https://img.shields.io/badge/python-3.7+-blue.svg?)](https://www.python.org/downloads/release/python-370/)


K-Trains





> English version [here](README.md)

_SRT๊ฐ€ ์˜ˆ์•ฝ์ด ๊ฐ€๋“ ์ฐจ์„œ ์ˆ˜์„œ์—ญ์œผ๋กœ ํ‹ฐ์ผ“์ด ์—†์œผ์‹ ๊ฐ€์š”? ์•„๋‹ˆ๋ฉด ์ด๋ฏธ ๋งค์ง„๋œ ์ €๋ ดํ•œ ๋ฌด๊ถํ™” ํ‹ฐ์ผ“ ๋•Œ๋ฌธ์— ๊ณ ๋ฏผํ•˜๊ณ  ๊ณ„์‹ ๊ฐ€์š”? K-Trains๊ฐ€ ๋„์™€๋“œ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค!_

K-Trains๋Š” [Korail](https://www.letskorail.com/)๊ณผ [SRT](https://etk.srail.kr/)์˜ API์— ์—ฐ๊ฒฐํ•˜์—ฌ ํ•œ๊ตญ์˜ ๊ธฐ์ฐจ ์ •๋ณด๋ฅผ ์–ป๊ณ  ์˜ˆ์•ฝํ•˜๋Š” Streamlit ์•ฑ์ž…๋‹ˆ๋‹ค.

## ์‚ฌ์šฉ ๋ฐฉ๋ฒ•

### ์›น UI
Streamlit์—์„œ ์•ฑ์„ ์‹คํ–‰ํ•˜๋ ค๋ฉด [์—ฌ๊ธฐ](https://k-trains.streamlit.app/)๋ฅผ ํด๋ฆญํ•˜์„ธ์š”. UI๋Š” ์ž๊ธฐ ์„ค๋ช…์ ์ด๋ฏ€๋กœ ๋กœ๊ทธ์ธํ•˜๊ณ  ์•Œ๋ฆผ์„ ๋ฐ›๊ฑฐ๋‚˜ ์ง์ ‘ ์˜ˆ์•ฝํ•˜๊ณ  ์‹ถ์€ ๊ธฐ์ฐจ๋ฅผ ์„ ํƒํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๊ฐ€๋Šฅํ•˜์ง€ ์•Š๋‹ค๋ฉด ์•ฑ์ด ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•  ๋•Œ ์•Œ๋ ค์ฃผ๊ณ  ๋‹น์‹ ์„ ์œ„ํ•ด ์˜ˆ์•ฝํ•ฉ๋‹ˆ๋‹ค!

_ํ‹ฐ์ผ“์— ๋Œ€ํ•œ ๋น„์šฉ์€ Korail ๋˜๋Š” SRT ์›น์‚ฌ์ดํŠธ/์•ฑ์—์„œ ์‹œ๊ฐ„ ๋‚ด์— ์ง€๋ถˆํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค._

๊ทธ๋Ÿผ์—๋„ ๋ถˆ๊ตฌํ•˜๊ณ  ์ˆ˜๋™์œผ๋กœ ์ƒˆ๋กœ ๊ณ ์นจํ•˜๊ณ  ๋ˆ„๊ตฐ๊ฐ€๊ฐ€ ํ‹ฐ์ผ“์„ ๋จผ์ € ์˜ˆ์•ฝํ•˜์ง€ ์•Š์„ ๊ฒƒ์ด๋ผ๊ณ  ๊ธฐ๋Œ€ํ•˜๋Š” ๊ฒƒ๋ณด๋‹ค๋Š” ๋‚˜์„ ๊ฒƒ์ž…๋‹ˆ๋‹ค ;)

### ์ˆ˜๋™ ๋ฐฐํฌ

์ด ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์€ Python์—์„œ ์›น GUI๋ฅผ ํ—ˆ์šฉํ•˜๋Š” [Streamlit](https://streamlit.io/)๋ฅผ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•ฉ๋‹ˆ๋‹ค. ๋กœ์ปฌ์—์„œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์‹คํ–‰ํ•˜๋ ค๋ฉด ๋‹ค์Œ ๋ช…๋ น์„ ์‹คํ–‰ํ•˜์„ธ์š”:

```bash
streamlit run app.py
```

์›น ๋ธŒ๋ผ์šฐ์ €๊ฐ€ ์ž๋™์œผ๋กœ ์—ด๋ ค ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜๊ณผ ์ƒํ˜ธ ์ž‘์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ๋ธŒ๋ผ์šฐ์ €๋ฅผ ์ˆ˜๋™์œผ๋กœ ์—ด๊ณ  http://localhost:8501๋กœ ์ด๋™ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

๋˜ํ•œ ์ง์ ‘ ํ‹ฐ์ผ“์„ ์˜ˆ์•ฝํ•˜๊ธฐ ์œ„ํ•ด ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค:

```bash
python reserve.py [OPTIONS]
```

### ๋น„๋ฐ€ ๋ฐ ์ด๋ฉ”์ผ API ์—ฐ๊ฒฐ
์•ฑ์€ ์ด๋ฉ”์ผ ๊ณ„์ • API(ํŠนํžˆ Google)์— ์—ฐ๊ฒฐ๋ฉ๋‹ˆ๋‹ค. ์•ฑ์„ ์Šค์Šค๋กœ ๋ฐฐํฌํ•˜๋ ค๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋ฉ”์‹œ์ง€๊ฐ€ ํ‘œ์‹œ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:

```bash
FileNotFoundError: No secrets files found. Valid paths for a secrets.toml file are: C:\Users\nyancat.streamlit\secrets.toml
```
์ž์ฒด secrets.toml ํŒŒ์ผ์„ ๊ด€๋ฆฌํ•˜๊ธฐ ์œ„ํ•ด ์ด ๊ฐ€์ด๋“œ๋ฅผ ๋”ฐ๋ฅผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Gmail์„ ์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ email_notify ํ•จ์ˆ˜๋ฅผ ์ˆ˜์ •ํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ํŠนํžˆ ์ด ์ค„์—์„œ์ž…๋‹ˆ๋‹ค.

## ๊ณ ์ง€
๊ฐœ๋ฐœ์ž๋Š” ์ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์˜ค์šฉ์— ๋Œ€ํ•ด ์ฑ…์ž„์ง€์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์ด ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์€ ๊ต์œก ๋ชฉ์ ์œผ๋กœ๋งŒ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ž๊ธฐ ์ฑ…์ž„ํ•˜์— ์‚ฌ์šฉํ•˜์„ธ์š”!

## ์Šคํฌ๋ฆฐ์ƒท



k-train-email



## ๊ฐ์‚ฌ์˜ ๋ง
์ด ํ”„๋กœ์ ํŠธ๋Š” ๋‹ค์Œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋•๋ถ„์— ๊ฐ€๋Šฅํ–ˆ์Šต๋‹ˆ๋‹ค:

Korail: https://github.com/carpedm20/korail2

SRT: https://github.com/ryanking13/SRT

### ํ”ผ๋“œ๋ฐฑ
ํ”ผ๋“œ๋ฐฑ์ด ์žˆ๋‹ค๋ฉด ๋ฌธ์ œ๋ฅผ ์ œ๊ธฐํ•˜๊ฑฐ๋‚˜ pull request๋ฅผ ์—ด์–ด์ฃผ์„ธ์š”!