dongnelibrary 0.3.11 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ # Memory Index
2
+
3
+ ## Reference
4
+ - [도서관 정보나루 API](reference_data4library_api.md) - data4library.kr API 조사 결과, 도서관 이름으로 위도/경도 조회 가능
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: 도서관 정보나루 API
3
+ description: data4library.kr API 조사 결과 - 도서관 이름으로 위도/경도 조회 가능한 공공 API
4
+ type: reference
5
+ ---
6
+
7
+ ## 도서관 정보나루 API (data4library.kr)
8
+
9
+ 국립중앙도서관 운영, 1,588개 도서관 / 1.98억 장서 / 4천만 회원 / 24억 대출 기록 보유.
10
+
11
+ Base URL: `http://data4library.kr/api/`
12
+
13
+ ### 핵심 엔드포인트: `/api/libSrch`
14
+
15
+ 도서관 이름으로 검색하면 **위도/경도를 바로 반환**. 별도 지오코딩 불필요.
16
+
17
+ ```
18
+ GET http://data4library.kr/api/libSrch?authKey=YOUR_KEY&libName=판교&format=json
19
+ ```
20
+
21
+ #### 요청 파라미터
22
+
23
+ | 파라미터 | 필수 | 설명 |
24
+ |----------|------|------|
25
+ | `authKey` | O | API 인증키 |
26
+ | `libName` | - | 도서관 이름 (부분 검색 가능) |
27
+ | `region` | - | 지역 코드 (예: "11" = 서울) |
28
+ | `dtl_region` | - | 세부 지역 코드 |
29
+ | `format` | - | `json` 또는 XML(기본값) |
30
+ | `pageNo` | - | 페이지 번호 (기본 1) |
31
+ | `pageSize` | - | 페이지 크기 (기본 10) |
32
+
33
+ #### 응답 필드
34
+
35
+ | 필드 | 설명 |
36
+ |------|------|
37
+ | `libCode` | 도서관 코드 |
38
+ | `libName` | 도서관 이름 |
39
+ | `address` | 주소 |
40
+ | `latitude` | 위도 |
41
+ | `longitude` | 경도 |
42
+ | `homepage` | 홈페이지 URL |
43
+ | `tel` | 전화번호 |
44
+ | `closed` | 휴관일 |
45
+ | `operatingTime` | 운영시간 |
46
+ | `BookCount` | 장서 수 |
47
+
48
+ #### JSON 응답 구조
49
+
50
+ ```json
51
+ {
52
+ "response": {
53
+ "request": {...},
54
+ "resultNum": N,
55
+ "numFound": N,
56
+ "libs": [
57
+ {
58
+ "lib": {
59
+ "libCode": "...",
60
+ "libName": "...",
61
+ "latitude": "...",
62
+ "longitude": "...",
63
+ ...
64
+ }
65
+ }
66
+ ]
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### API 키 발급 절차
72
+
73
+ 1. https://data4library.kr/joinPage 에서 회원가입
74
+ 2. 로그인 → 마이페이지 → 인증키 메뉴
75
+ 3. 이용 목적 선택 후 신청
76
+ 4. 다음 영업일 오전 승인
77
+ 5. 문의: libdata@korea.kr / 02-595-6131
78
+
79
+ ### 호출 제한
80
+
81
+ | 구분 | 일 호출 한도 |
82
+ |------|-------------|
83
+ | 기본 | 500건/일 |
84
+ | 서버 IP 등록 시 | 30,000건/일 |
85
+
86
+ 2023년 11월 20일부터 무제한 접근 중단, 최대 30,000건/일.
87
+
88
+ ### 기타 유용한 엔드포인트 (18개 중 주요 항목)
89
+
90
+ | 엔드포인트 | 설명 |
91
+ |------------|------|
92
+ | `/api/libSrch` | 도서관 검색 (위치, 연락처 등) |
93
+ | `/api/extends/libSrch` | 도서관 정보 + 대출 트렌드 통합 |
94
+ | `/api/bookExist` | 특정 도서관 도서 소장 여부 |
95
+ | `/api/libSrchByBook` | ISBN으로 소장 도서관 검색 |
96
+ | `/api/srchBooks` | 키워드 도서 검색 |
97
+ | `/api/srchDtlList` | 도서 상세 (서지, 표지, 대출통계) |
98
+ | `/api/loanItemSrch` | 인기 대출 도서 (성별, 연령, 지역별) |
99
+ | `/api/hotTrend` | 급상승 대출 도서 (7일 기준) |
100
+ | `/api/usageAnalysisList` | 도서 이용 분석 |
101
+
102
+ ### 이 프로젝트와의 관계
103
+
104
+ - 현재 코드베이스에 190+개 도서관이 `LibraryInfo { code, name }` 으로만 저장됨
105
+ - `/api/libSrch`로 한 번 일괄 조회하여 좌표를 캐싱하면 지도 기능 구현 가능
106
+ - 500건/일이면 전체 도서관 좌표를 하루 만에 수집 가능
@@ -3,7 +3,16 @@
3
3
  "allow": [
4
4
  "WebFetch(domain:lib.ice.go.kr)",
5
5
  "mcp__playwright__browser_fill_form",
6
- "mcp__playwright__browser_click"
6
+ "mcp__playwright__browser_click",
7
+ "WebFetch(domain:lib.wonju.go.kr)",
8
+ "mcp__chrome-devtools__new_page",
9
+ "mcp__chrome-devtools__take_screenshot",
10
+ "mcp__chrome-devtools__fill",
11
+ "mcp__chrome-devtools__take_snapshot",
12
+ "mcp__chrome-devtools__click",
13
+ "mcp__chrome-devtools__wait_for",
14
+ "mcp__chrome-devtools__evaluate_script",
15
+ "mcp__chrome-devtools__close_page"
7
16
  ]
8
17
  }
9
18
  }
package/API.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # DongneLibrary API Reference
2
2
 
3
- A JavaScript/TypeScript library for checking book availability across 180+ Korean public library branches.
3
+ A JavaScript/TypeScript library for checking book availability across 190+ Korean public library branches.
4
4
 
5
5
  ## Installation
6
6
 
@@ -192,7 +192,7 @@ Returns an array of all supported library branch names.
192
192
 
193
193
  #### Returns
194
194
 
195
- `string[]` - Array of library names (180+ branches)
195
+ `string[]` - Array of library names (190+ branches)
196
196
 
197
197
  #### Example
198
198
 
@@ -244,6 +244,54 @@ console.log(modules);
244
244
 
245
245
  ---
246
246
 
247
+ ### getLibraryNamesInModule(moduleName)
248
+
249
+ Returns an array of library branch names belonging to a specific module.
250
+
251
+ #### Parameters
252
+
253
+ | Parameter | Type | Required | Description |
254
+ | ------------ | -------- | -------- | ------------------------ |
255
+ | `moduleName` | `string` | Yes | Module name to look up |
256
+
257
+ #### Returns
258
+
259
+ `string[]` - Array of library branch names in the module
260
+
261
+ #### Example
262
+
263
+ ```javascript
264
+ const libs = dongnelibrary.getLibraryNamesInModule("성남시도서관");
265
+ console.log(libs);
266
+ // ['논골도서관', '중원어린이도서관', '성남중앙도서관', '분당도서관', ...]
267
+ ```
268
+
269
+ ---
270
+
271
+ ### resolveLibraryCount(libraryName)
272
+
273
+ Returns the number of libraries that will be searched for the given name(s).
274
+
275
+ #### Parameters
276
+
277
+ | Parameter | Type | Required | Description |
278
+ | ------------- | -------------------- | -------- | --------------------------------------------------- |
279
+ | `libraryName` | `string \| string[]` | Yes | Library name(s). Use `''` for all libraries |
280
+
281
+ #### Returns
282
+
283
+ `number` - Number of libraries that will be searched
284
+
285
+ #### Example
286
+
287
+ ```javascript
288
+ dongnelibrary.resolveLibraryCount(""); // 193 (all libraries)
289
+ dongnelibrary.resolveLibraryCount("성남시도서관"); // 18 (all branches in module)
290
+ dongnelibrary.resolveLibraryCount("판교도서관"); // 1
291
+ ```
292
+
293
+ ---
294
+
247
295
  ### isModuleName(name)
248
296
 
249
297
  Checks if a given name is a library system module name.
@@ -337,26 +385,37 @@ type SearchCompleteCallback = (
337
385
  | `yongin` | 용인시도서관 | Yongin City |
338
386
  | `jeju` | 제주시도서관 | Jeju City |
339
387
 
340
- Use `getAllLibraryNames()` to see all 180+ individual branch names.
388
+ Use `getAllLibraryNames()` to see all 190+ individual branch names.
341
389
 
342
390
  ---
343
391
 
344
392
  ## CLI Usage
345
393
 
346
394
  ```bash
347
- # Interactive mode
395
+ # Interactive mode (default - no arguments needed)
396
+ npx dongnelibrary
397
+
398
+ # Interactive mode (explicit)
348
399
  npx dongnelibrary -i
349
400
 
350
- # Interactive mode (choose by library system)
351
- npx dongnelibrary -m
401
+ # List all libraries grouped by module
402
+ npx dongnelibrary -a
352
403
 
353
404
  # Search specific library
354
405
  npx dongnelibrary -t "해리포터" -l "판교도서관"
355
406
 
356
- # Search all libraries
357
- npx dongnelibrary -t "해리포터" -a
407
+ # Quick search with combined query
408
+ npx dongnelibrary -q "판교 해리포터"
409
+
410
+ # Search multiple libraries
411
+ npx dongnelibrary -q "판교,정자 해리포터"
358
412
  ```
359
413
 
414
+ The interactive mode prompts for book title first, then lets you choose a search scope:
415
+ - Search all libraries
416
+ - Search by library system (10 modules)
417
+ - Search by library name (autocomplete)
418
+
360
419
  See `dongnelibrary --help` for all options.
361
420
 
362
421
  ---
package/README.md CHANGED
@@ -18,8 +18,8 @@
18
18
  npm ci
19
19
  npm run build
20
20
 
21
+ node ./dist/cli.js
21
22
  node ./dist/cli.js -i
22
- node ./dist/cli.js -m
23
23
  node ./dist/cli.js -a
24
24
  node ./dist/cli.js -t 별 -l 남양
25
25
  node ./dist/cli.js -t 별 -l 흥천,판교
@@ -31,8 +31,8 @@
31
31
  ## Install with npm and Run
32
32
 
33
33
  npm install dongnelibrary@latest -g
34
+ dongnelibrary
34
35
  dongnelibrary -i
35
- dongnelibrary -m
36
36
  dongnelibrary -a
37
37
  dongnelibrary -t 별 -l 남양
38
38
  dongnelibrary -t 별 -l 흥천,판교
@@ -44,8 +44,8 @@
44
44
 
45
45
  ## Run with npx
46
46
 
47
+ npx dongnelibrary
47
48
  npx dongnelibrary -i
48
- npx dongnelibrary -m
49
49
  npx dongnelibrary -a
50
50
  npx dongnelibrary -t 별 -l 남양
51
51
  npx dongnelibrary -t 별 -l 흥천,판교
@@ -61,8 +61,8 @@
61
61
 
62
62
  ### run examples
63
63
 
64
+ docker run -it --rm ghcr.io/afrontend/dongnelibrary
64
65
  docker run -it --rm ghcr.io/afrontend/dongnelibrary -i
65
- docker run -it --rm ghcr.io/afrontend/dongnelibrary -m
66
66
  docker run --rm ghcr.io/afrontend/dongnelibrary -a
67
67
  docker run --rm ghcr.io/afrontend/dongnelibrary -t 별 -l 남양
68
68
  docker run --rm ghcr.io/afrontend/dongnelibrary -t 별 -l 흥천,판교
@@ -77,8 +77,8 @@
77
77
 
78
78
  ### run examples
79
79
 
80
+ docker run -it dongnelibrary
80
81
  docker run -it dongnelibrary -i
81
- docker run -it dongnelibrary -m
82
82
  docker run dongnelibrary -a
83
83
  docker run dongnelibrary -t 별 -l "남양"
84
84
  docker run dongnelibrary -t 별 -l "흥천,판교"
@@ -152,6 +152,7 @@ console.log(results.length + " 개의 도서관을 검색했습니다.");
152
152
  - [용인시도서관][yongin-url] (수지도서관,구갈희망누리도서관,구성도서관,기흥도서관,남사도서관,동백도서관,동천도서관,모현도서관,보라도서관,상현도서관,서농도서관,성복도서관,용인중앙도서관,양지해밀도서관,영덕도서관,이동꿈틀도서관,죽전도서관,청덕도서관,포곡도서관,흥덕도서관,기흥동행정복지센터스마트도서관,기흥역스마트도서관,동천동행정복지센터스마트도서관,마북동행정복지센터스마트도서관,보정동행정복지센터스마트도서관,상갈동행정복지센터스마트도서관,상하동행정복지센터스마트도서관,성복역스마트도서관,시청스마트도서관,신봉동행정복지센터스마트도서관,역북동행정복지센터스마트도서관,용인중앙시장역스마트도서관,원삼면스마트도서관,유방어린이공원스마트도서관,죽전역스마트도서관,고림다온작은도서관,남사맑은누리작은도서관,백암면작은도서관,상현1동작은도서관,상현2동작은도서관,이동천리작은도서관)
153
153
  - [여주시립도서관][yjlib-url] (여주도서관,세종도서관,점동도서관,여주기적의도서관,흥천도서관,금사도서관,대신도서관,산북작은도서관,북내작은도서관,여주역스마트도서관,이마트스마트도서관)
154
154
  - [제주시도서관][jeju-url] (한라도서관,우당도서관,탐라도서관,제주시기적의도서관,애월도서관,조천읍도서관,한경도서관,삼매봉도서관,중앙도서관,동부도서관,서부도서관,서귀포기적의도서관,성산일출도서관,안덕산방도서관,표선도서관,꿈바당어린이도서관)
155
+ - [원주시립통합도서관][wonju-url] (시립중앙도서관,중천철학도서관,미리내도서관,태장도서관,샘마루도서관,그림책도서관,생각자람어린이도서관,귀래면작은도서관,원주한도시한책읽기도서관,개운동작은도서관,치악산새마을문고작은도서관,무실동작은도서관,문막읍작은도서관,봉산동작은도서관,도란도란청소년도서관,부론면작은도서관)
155
156
 
156
157
  ## 마무리
157
158
 
@@ -172,6 +173,7 @@ console.log(results.length + " 개의 도서관을 검색했습니다.");
172
173
  npm run yjlib # 여주시 도서관
173
174
  npm run yongin # 용인시 도서관
174
175
  npm run jeju # 제주시 도서관
176
+ npm run wonju # 원주시 도서관
175
177
 
176
178
  [dongnelibraryspa]: https://github.com/afrontend/dongnelibraryspa "AngularJS, Foundation을 사용한 Web UI"
177
179
  [npm-image]: https://img.shields.io/npm/v/dongnelibrary.svg
@@ -188,3 +190,4 @@ console.log(results.length + " 개의 도서관을 검색했습니다.");
188
190
  [yjlib-url]: https://www.yjlib.go.kr
189
191
  [ice-url]: https://lib.ice.go.kr/
190
192
  [jeju-url]: https://www.jeju.go.kr/
193
+ [wonju-url]: https://lib.wonju.go.kr/