1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
|
%global _empty_manifest_terminate_build 0
Name: python-osrsbox
Version: 2.2.3
Release: 1
Summary: A complete and up-to-date database of Old School Runescape (OSRS) items, monsters and prayers accessible using a Python API.
License: GPL-3.0-only
URL: https://github.com/osrsbox/osrsbox-db
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/d6/dc/8592785279ecd921c7c690910c9393cfecd8a6d9fe4a7889a71d9f65366b/osrsbox-2.2.3.tar.gz
BuildArch: noarch
Requires: python3-dataclasses
%description
# osrsbox-db
 
[](https://badge.fury.io/py/osrsbox) 
[](https://discord.gg/HFynKyr)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9J44ADGJQ5BC6&source=url)
## A complete and up-to-date database of Old School Runescape (OSRS) items, monsters and prayers
This project hosts a complete and up-to-date database items, monsters and prayers in OSRS. **Complete** means it holds every single item, monster and prayer in OSRS. **Up-to-date** means this database is updated after every weekly game update to ensure accurate information.
The item database has extensive properties for each item: a total of 27 properties for every item, an additional 16 properties for equipable items, and an additional 3 properties for equipable weapons. These properties include the item ID and name, whether an item is tradeable, stackable, or equipable or if the item is members only. For any equipable item, there are additional properties about combat stats; for example, what slash attack bonus, magic defence bonus or prayer bonus that an item provides. For weapons, additional properties are added which include attack speed, combat stance and weapon type information.
The monster database also has extensive properties: a total of 44 unique properties for each monster, as well as an array of item drops for each monster that has 6 additional properties per item drop. The base properties include the monster ID, name, member status, slayer properties, attack type, max hit, attack types and all monster combat stats. Each monster also has an associated array of drops which document the item ID, name, rarity, quantity, and any requirements to get the drop.
The prayer database documents each prayer that available in-game and has detailed properties: a total of 8 properties for every prayer. The base properties include the prayer name, members status, description, requirements, and bonuses that it provides.
## Table of Contents
- [Project Summary](#project-summary)
- [The `osrsbox` Python PyPi Package](#the-osrsbox-python-pypi-package)
- [The osrsbox RESTful API](#the-osrsbox-restful-api)
- [The osrsbox Static JSON API](#the-osrsbox-static-json-api)
- [The `osrsbox-db` GitHub Repository](#the-osrsbox-db-github-repository)
- [The Item Database](#the-item-database)
- [The Monster Database](#the-monster-database)
- [The Prayer Database](#the-prayer-database)
- [Project Contribution](#project-contribution)
- [Additional Project Information](#additional-project-information)
## Project Summary
The osrsbox-db project provides data for three different categories:
1. **Items**
1. **Monsters**
1. **Prayers**
The osrsbox-db project and data is accessible using four methods:
1. [**The Python PyPi package**](https://pypi.org/project/osrsbox/)
1. [**The RESTful API**](https://github.com/osrsbox/osrsbox-api/)
1. [**The Static JSON API**](https://github.com/osrsbox/osrsbox-db/tree/master/docs)
1. [**The GitHub development repository**](https://github.com/osrsbox/osrsbox-db/)
With four different methods to access data... most people will have the following question: _Which one should I use?_ The following list is a short-sharp summary of the options:
1. [**The Python PyPi package**](https://pypi.org/project/osrsbox/): Use this if you are programming anything in Python - as it is the simplest option. Install using `pip`, and you are ready to do anything from experimenting and prototyping, to building a modern web app using something like Flask.
1. [**The RESTful API**](https://github.com/osrsbox/osrsbox-api/): Use this if you are not programming in Python, and want an Internet-accessible API with rich-quering including filtering, sorting and projection functionality.
1. [**The Static JSON API**](https://github.com/osrsbox/osrsbox-db/tree/master/docs): Use this if you want Internet-accessible raw data (JSON files and PNG images) and don't need queries to filter data. This is a good option if you want to _dump_ the entire database contents, and saves the RESTful API from un-needed traffic.
1. [**The GitHub development repository**](https://github.com/osrsbox/osrsbox-db/): The development repository provides the code and data to build the database. I would not recommend using the development repository unless you are (really) interested in the project or you want to contribute to the project.
## The `osrsbox` Python PyPi Package
If you want to access the item and monster database programmatically using Python, the simplest option is to use the [`osrsbox` package available from PyPi](https://pypi.org/project/osrsbox/). You can load the item and/or monster database and process item objects, monster objects, and their properties.
### Package Quick Start
- Make sure you have >= Python 3.6
- Install package using: `pip install osrsbox`
- Item database quick start:
- Import items API using: `from osrsbox import items_api`
- Load all items using: `items = items_api.load()`
- Loop items using: `for item in items: print(item.name)`
- Monster database quick start:
- Import monsters API using: `from osrsbox import monsters_api`
- Load all monsters using: `monsters = monsters_api.load()`
- Loop monsters using: `for monster in monsters: print(monster.name)`
- Prayer database quick start:
- Import prayers API using: `from osrsbox import prayers_api`
- Load all prayers using: `prayers = prayers_api.load()`
- Loop prayers using: `for prayer in prayers: print(prayer.name)`
### Package Requirements
For the `osrsbox` PyPi package you must meet the following requirements:
- Python 3.6 or above
- Pip package manager
- Dataclasses package (if Python is below 3.7)
If you are using Python 3.6, the `dataclasses` package will automatically be installed. If you are using Python 3.7 or above, the `dataclasses` package is part of the standard library and will not be installed automatically.
### Package Installation
The easiest way to install the osrsbox package is through the [Python Package Index](http://pypi.python.org/) using the `pip` command. You need to have `pip` installed - and make sure it is updated (especially on Windows). Then you can install the `osrsbox` package using the following `pip` command:
```
pip install osrsbox
```
### Package Upgrading
The package is consistently updated - usually after each weekly in-game update. This is because the in-game update usually introduces additional items into the game or changes existing items. Therefore, you should regularly check and update the `osrsbox` package. To achieve this, run `pip` with the `upgrade` flag, as demonstrated in the following command:
```
pip install --upgrade osrsbox
```
### Package Usage
The key use of the `osrsbox` package is to load and automate the processing of OSRS items and their associated metadata. You can load the package using `import osrsbox`, however, you probably want to load the `items_api` module or `monsters_api` module. A simple example of using the package to `load` all the items, then loop and print out the item ID and name of every item in OSRS is provided below:
```
phoil@gilenor ~ $ python3.6
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from osrsbox import items_api
>>> items = items_api.load()
>>> for item in items:
... print(item.id, item.name)
```
Instead of using the Python interpreter, you can also write a simple script and import the `osrsbox` Python package. An example script is provided below, this time for the `monsters_api`:
```
#!/usr/bin/python3
from osrsbox import monsters_api
monsters = monsters_api.load()
for monster in monsters:
print(monster.id, monster.name)
```
If you would like to review additional examples of using the `osrsbox` Python API, have a look at the [`items_api_examples` folder](https://github.com/osrsbox/osrsbox-db/tree/master/osrsbox/items_api_examples) and [`monsters_api_examples` folder](https://github.com/osrsbox/osrsbox-db/tree/master/osrsbox/monsters_api_examples). There are a number of scripts available that provide examples of loading and processing data using the Python API.
## The osrsbox RESTful API
The [official osrsbox-api GitHub repository](https://github.com/osrsbox/osrsbox-api) hosts the source code used for the RESTful API. The official `osrsbox-api` project is available from:
- [https://api.osrsbox.com](https://api.osrsbox.com)
The link provided above has an API landing page with detailed information on the project including a project summary, API endpoints, and links to useful documentation. Also, have a look at the [official `osrsbox-api` project README](https://github.com/osrsbox/osrsbox-api/blob/master/README.md) for more information. The README has a tutorial on how to build the API docker environment locally for testing purposes which might be useful.
## The `osrsbox` Static JSON API
This project also includes an Internet-accessible, static JSON API for all items/monsters in the database. The JSON API was originally written for the [`osrsbox-tooltips` project](https://github.com/osrsbox/osrsbox-tooltips) but has since been used for a variety of other projects. The JSON API is useful when you do not want to write a program in Python (as using the PyPi package is probably easier), but would like to fetch the database information programmatically over the Internet, and receive the data back in nicely structured JSON syntax. A key example is a web application.
### Static JSON API Files
The JSON API is available in the [`docs` folder](https://github.com/osrsbox/osrsbox-db/tree/master/docs/) in the osrsbox-db project repository. This folder contains the publicly available database. Every file inside this specific folder can be fetched using HTTP GET requests. The base URL for this folder is `https://www.osrsbox.com/osrsbox-db/`. Simply append any name of any file from the `docs` folder to the base URL, and you can fetch this data. A summary of the folders/files provided in the JSON API are listed below with descriptions:
- `items-complete.json`: A single JSON file that combines all single JSON files from `items-json` folder. This file contains the entire osrsbox-db items database in one file. This is useful if you want to get the data for every single item.
- `items-icons`: Collection of PNG files (20K+) for every item inventory icon in OSRS. Each inventory icon is named using the unique item ID number.
- `items-json`: Collection of JSON files (20K+) of extensive item metadata for every item in OSRS. This folder contains the entire osrsbox-db item database where each item has an individual JSON file, named using the unique item ID number. This is useful when you want to fetch data for a single item where you already know the item ID number.
- `items-json-slot`: Collection of JSON files extracted from the database that are specific for each equipment slot (e.g., head, legs). This is useful when you want to only get item data for equipable items for one, or multiple, specific item slot.
- `items-summary.json`: A single JSON file that contains only the item names and item ID numbers. This file is useful when you want to download a small file (1.1MB) to quickly scan/process item data when you only need the item name and/or ID number.
- `models-summary.json`: A single JSON file that contains model ID numbers for items, objects, and NPCs. This file is useful to determine the model ID number for a specific item, object or NPC.
- `monsters-complete.json`: A single JSON file that combines all single JSON files from the `monsters-json` folder. This file contains the entire osrsbox-db monster database in one file. This is useful if you want to get the data for every single monster in one file.
- `monsters-json`: Collection of JSON files (2.5K+) of extensive monster metadata for every monster in OSRS. This folder contains the entire osrsbox-db monster database where each monster has an individual JSON file, named using the unique monster ID number. This is useful when you want to fetch data for a single monster where you already know the item ID number.
- `npcs-summary.json`: A single JSON file that contains only the NPC names and NPC ID numbers. This file is useful when you want to download a small file (0.35MB) to quickly scan/process NPC data when you only need the NPC name and/or ID number. Note that this file contains both attackable, and non-attackable (monster) NPCs.
- `objects-summary.json`: A single JSON file that contains only the object names and object ID numbers. This file is useful when you want to download a small file (0.86MB) to quickly scan/process in-game object data when you only need the object name and/or ID number.
- `prayer-icon`: Collection of PNG files for each prayer in OSRS.
- `prayer-json`: Collection of individual JSON files with properties and metadata about OSRS prayers.
### Accessing the Static JSON API
The JSON file for each OSRS item can be directly accessed using unique URLs provide through the [`osrsbox.com`](https://www.osrsbox.com/osrsbox-db/) base URL. As mentioned, you can fetch JSON files using a unique URL, but cannot modify any JSON content. Below is a list of URL examples for items and monsters in the osrsbox-db database:
- [`https://www.osrsbox.com/osrsbox-db/items-json/2.json`](https://www.osrsbox.com/osrsbox-db/items-json/2.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/74.json`](https://www.osrsbox.com/osrsbox-db/items-json/74.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/35.json`](https://www.osrsbox.com/osrsbox-db/items-json/35.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/415.json`](https://www.osrsbox.com/osrsbox-db/items-json/415.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/239.json`](https://www.osrsbox.com/osrsbox-db/items-json/239.json)
As displayed by the links above, each item or monster is stored in the `osrsbox-db` repository, under the [`items-json`](https://github.com/osrsbox/osrsbox-db/tree/master/docs/items-json) folder or [`monsters-json`](https://github.com/osrsbox/osrsbox-db/tree/master/docs/monsters-json) folder. In addition to the single JSON files for each item, many other JSON files can be fetched. Some more examples are provided below:
- [`https://www.osrsbox.com/osrsbox-db/items-complete.json`](https://www.osrsbox.com/osrsbox-db/items-complete.json)
- [`https://www.osrsbox.com/osrsbox-db/monsters-complete.json`](https://www.osrsbox.com/osrsbox-db/monsters-complete.json)
- [`https://www.osrsbox.com/osrsbox-db/items-summary.json`](https://www.osrsbox.com/osrsbox-db/items-summary.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json-slot/items-cape.json`](https://www.osrsbox.com/osrsbox-db/items-json-slot/items-cape.json)
- [`https://www.osrsbox.com/osrsbox-db/prayer-json/protect-from-magic.json`](https://www.osrsbox.com/osrsbox-db/prayer-json/protect-from-magic.json)
So how can you get and use these JSON files about OSRS items? It is pretty easy but depends on what you are trying to accomplish and what programming language you are using. Some examples are provided in the following subsections.
### Accessing the JSON API using Command Line Tools
Take a simple example of downloading a single JSON file. In a Linux system, we could use the `wget` command to download a single JSON file, as illustrated in the example code below:
```
wget https://www.osrsbox.com/osrsbox-db/items-json/12453.json
```
You could perform a similar technique using the `curl` tool:
```
curl https://www.osrsbox.com/osrsbox-db/items-json/12453.json
```
For Windows users, you could use PowerShell:
```
Invoke-WebRequest -Uri "https://www.osrsbox.com/osrsbox-db/items-json/12453.json" -OutFile "12453.json"
```
### Accessing the JSON API using Python
Maybe you are interested in downloading a single (or potentially multiple) JSON files about OSRS items and processing the information in a Python program. The short script below downloads the `12453.json` file using Python's `urllib` library, loads the data as a JSON object and prints the contents to the console. The code is a little messy, primarily due to supporting both Python 2 and 3 - as you can see from the `try` and `except` importing method implemented.
```
import json
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
url = ("https://www.osrsbox.com/osrsbox-db/items-json/12453.json")
response = urlopen(url)
data = response.read().decode("utf-8")
json_obj = json.loads(data)
print(json_obj)
```
### Accessing the JSON API using JavaScript
Finally, let's have a look at JavaScript (specifically jQuery) example to fetch a JSON file from the osrsbox-db and build an HTML element to display in a web page. The example below is a very simple method to download the JSON file using the jQuery `getJSON` function. Once we get the JSON file, we loop through the JSON entries and print each key and value (e.g., `name` and _Black wizard hat (g)_) on its own line in a `div` element.
```
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.getJSON("https://www.osrsbox.com/osrsbox-db/items-json/12453.json", function(result){
$.each(result, function(i, field){
$("div").append(i + " " + field + "<br>");
});
});
});
});
</script>
</head>
<body>
<button>Get JSON data</button>
<div></div>
</body>
</html>
```
## The `osrsbox-db` GitHub Repository
The [official osrsbox-db GitHub repository](https://github.com/osrsbox/osrsbox-db) hosts the source code for the entire osrsbox-db project. The Python PyPi package is located in the `osrsbox` folder of the official development repository, while the other folders in this repository are used to store essential data and Python modules to build the item database.
### Using the Development Repository
If using this repository (the development version), you will need to fulfill some specific requirements. This includes having the following tools available on your system:
- Python 3.6 or above
- Pip - the standard package manager for Python
- A selection of additional Python packages
As a short example, I configured my Ubuntu 18.04 system to run the development repository code using the following steps:
```
sudo apt update
sudo apt install python3-pip
```
These two commands will install the `pip3` command, allowing the installation of Python packages. Then you can use `pip3` to install additional packages. The development repository requires a variety of Python packages in addition to the mandatory `dataclasses` package. These package requirements are documented in the [`requirements.txt`](https://github.com/osrsbox/osrsbox-db/tree/master/requirements.txt) file. It is recommended to use the `venv` module to set up your environment, then install the specified requirements. As an example, the following workflow is provided for Linux-based environments (make sure `python3` is available first):
```
git clone --recursive https://github.com/osrsbox/osrsbox-db.git
cd osrsbox-db
python -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
```
When you have finished with working in the `osrsbox-db` repository, make sure to deactivate the current `venv` environment using:
```
deactivate
```
### Summary of Repository Structure
- `builders`: The builders are the code that performs automatic regeneration of the databases. These builders read in a variety of data and produce a JSON file for each item or monster.
- `items`: The item database builder that uses a collection of Python scripts to build the item database. The `builder.py` script is the primary entry point, and the `build_item.py` module does the processing of each item.
- `monsters`: The monster database builder that uses a collection of Python scripts to build the monster database. The `builder.py` script is the primary entry point, and the `build_monster.py` module does the processing of each monster. Additionally, the `drop_table.py` module contains a selection of hard-coded drop tables for the various OSRS Wiki drop table templates such as the rare, herb, seed, gem and catacombs drop tables.
- `data`: Collection of useful data files used in the osrsbox-db project.
- `cache`: OSRS client cache dump (not present in repository due to size, but populated using the `scripts/cache` scripts).
- `icons`: Item and prayer icons in base64.
- `items`: Data used for item database generation.
- `monsters`: Data used for monster database generation.
- `schemas`: JSON schemas for the item and monster database, as well as schemas for item, npc and object definitions from cache data.
- `wiki`: OSRS Wiki data dump including all item and monster page titles and page data.
- `docs`: The publicly accessible item database available through this repo or by using the static JSON API. This folder contains the actual item database that is publicly available, or browsable within this repository (see section above for more information).
- `osrsbox`: The Python PyPi package:
- `items_api`: The Python API for interacting with the items database. The API has modules to load all items in the database, iterate through items, and access the different item properties.
- `items_api_examples`: A collection of simple Python scripts that use the `items_api` to provide an example of what can be achieved and how to use the items database.
- `monsters_api`: The Python API for interacting with the monster database. The API has modules to load all monsters in the database, iterate through items, and access different monster properties.
- `monsters_api_examples`: A collection of simple Python scripts that use the `monsters_api` to provide an example of what can be achieved and how to use the monster's database.
- `scripts`: A collection of scripts (using Python and BASH) to help automate common tasks including dumping the OSRS cache, scraping the OSRS wiki, generating schemas, updating the databases, and inserting data into a MongoDB database.
- `cache`: A collection of scripts to extract useful data from the OSRS cache item, npc and object definition files.
- `icons`: Various scripts to help process, check or update item icons.
- `items`: A collection of scripts to help process data for the item builder.
- `monsters`: A collection of scripts to help process data for the monster builder.
- `update`: A collection of scripts for automating the data collection and database regeneration.
- `wiki`: A collection of scripts for automating data extraction from the OSRS Wiki using the MediaWiki API.
- `test`: A collection of PyTest tests.
### Item, Monster and Prayer Database Schemas
Technically, the `osrsbox-db` is not really a database - more specifically it should be called a data set. Anyway... the contents in the item/monster/prayer database need to adhere to a specified structure, as well as specified data types for each property. This is achieved (documented and tested) using the [Cerberus project](https://docs.python-cerberus.org/en/stable/). The Cerberus schema is useful to determine the properties that are available for each entity, and the types and requirements for each property, including:
- `type`: Specifies the data type (e.g., boolean, integer, string)
- `required`: If the property must be populated (true or false)
- `nullable`: If the property can be set to `null` or `None`
The Cerberus schemas are provided in a dedicated repository called [`osrsbox/schemas`](https://github.com/osrsbox/schemas), and implorted into this project as a submodule - this is because the schemas are used in other repositories and central management is required. The schemas are loaded into the `data/schemas` folder and includes:
1. [`schema-items.json`](https://github.com/osrsbox/schemas/blob/master/schema-items.json): This file defines the item schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
1. [`schema-monsters.json`](https://github.com/osrsbox/schemas/blob/master/schema-monsters.json): This file defines the monster schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
1. [`schema-prayers.json`](https://github.com/osrsbox/schemas/blob/master/schema-prayers.json): This file defines the prayer schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
All Cerberus schema files are authored using Cerberus version 1.3.2. This project uses the [`Cerberus` PyPi package](https://pypi.org/project/Cerberus/).
## The Item Database
Each item is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects. Additionally, the data is accessible directly by parsing the raw JSON files. There are three types of objects, or classifications of data, that can be used to represent part of an in-game OSRS item, each outlined in the following subsections.
### Item Properties
An `ItemProperties` object type includes basic item metadata such as `id`, `name`, `examine` text, store `cost`, `highalch` and `lowalch` values and `quest_item` association. Every item object in the item database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique OSRS item ID number. | True | False |
| name | string | The name of the item. | True | False |
| last_updated | string | The last time (UTC) the item was updated (in ISO8601 date format). | True | False |
| incomplete | boolean | If the item has incomplete wiki data. | True | False |
| members | boolean | If the item is a members-only. | True | False |
| tradeable | boolean | If the item is tradeable (between players and on the GE). | True | False |
| tradeable_on_ge | boolean | If the item is tradeable (only on GE). | True | False |
| stackable | boolean | If the item is stackable (in inventory). | True | False |
| stacked | integer | If the item is stacked, indicated by the stack count. | True | True |
| noted | boolean | If the item is noted. | True | False |
| noteable | boolean | If the item is noteable. | True | False |
| linked_id_item | integer | The linked ID of the actual item (if noted/placeholder). | True | True |
| linked_id_noted | integer | The linked ID of an item in noted form. | True | True |
| linked_id_placeholder | integer | The linked ID of an item in placeholder form. | True | True |
| placeholder | boolean | If the item is a placeholder. | True | False |
| equipable | boolean | If the item is equipable (based on right-click menu entry). | True | False |
| equipable_by_player | boolean | If the item is equipable in-game by a player. | True | False |
| equipable_weapon | boolean | If the item is an equipable weapon. | True | False |
| cost | integer | The store price of an item. | True | False |
| lowalch | integer | The low alchemy value of the item (cost * 0.4). | True | True |
| highalch | integer | The high alchemy value of the item (cost * 0.6). | True | True |
| weight | float | The weight (in kilograms) of the item. | True | True |
| buy_limit | integer | The Grand Exchange buy limit of the item. | True | True |
| quest_item | boolean | If the item is associated with a quest. | True | False |
| release_date | string | Date the item was released (in ISO8601 format). | True | True |
| duplicate | boolean | If the item is a duplicate. | True | False |
| examine | string | The examine text for the item. | True | True |
| icon | string | The item icon (in base64 encoding). | True | False |
| wiki_name | string | The OSRS Wiki name for the item. | True | True |
| wiki_url | string | The OSRS Wiki URL (possibly including anchor link). | True | True |
| equipment | dict | The equipment bonuses of equipable armour/weapons. | True | True |
| weapon | dict | The weapon bonuses including attack speed, type and stance. | True | True |
### Item Equipment
Many items in OSRS are equipable, this includes armor, weapons, and other _wearable_ items. Any equipable item has additional properties stored as an `ItemEquipment` object type - including attributes such as `attack_slash`, `defence_crush` and `melee_strength` values. The `ItemEquipment` object is nested within an `ItemProperties`. If you are parsing the raw JSON files, this data is nested under the `equipment` key. It is very important to note that not all items in OSRS are equipable. Only items with the `equipable_by_player` property set to `true` are equipable. The `equipable` property is similar, but this is the raw data extracted from the game cache - and can sometimes be incorrect (not equipable by a player). All of the properties available for equipable items are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| attack_stab | integer | The attack stab bonus of the item. | True | False |
| attack_slash | integer | The attack slash bonus of the item. | True | False |
| attack_crush | integer | The attack crush bonus of the item. | True | False |
| attack_magic | integer | The attack magic bonus of the item. | True | False |
| attack_ranged | integer | The attack ranged bonus of the item. | True | False |
| defence_stab | integer | The defence stab bonus of the item. | True | False |
| defence_slash | integer | The defence slash bonus of the item. | True | False |
| defence_crush | integer | The defence crush bonus of the item. | True | False |
| defence_magic | integer | The defence magic bonus of the item. | True | False |
| defence_ranged | integer | The defence ranged bonus of the item. | True | False |
| melee_strength | integer | The melee strength bonus of the item. | True | False |
| ranged_strength | integer | The ranged strength bonus of the item. | True | False |
| magic_damage | integer | The magic damage bonus of the item. | True | False |
| prayer | integer | The prayer bonus of the item. | True | False |
| slot | string | The equipment slot associated with the item (e.g., head). | True | False |
| requirements | dict | An object of requirements {skill: level}. | True | True |
### Item Weapon
A select number of items in OSRS are equipable weapons. Any equipable item that is a weapon has additional properties stored as an `ItemWeapon` type object including attributes such as `attack_speed` and `weapon_types` values. Additionally, each weapon has an array of combat stances associated with it to determine the `combat_style`, `attack_type`, `attack_style` and any `bonuses` or combat `experience` association. The `ItemWeapon` object is nested within an `ItemProperties` object when using the Python API. If you are parsing the raw JSON files, this data is nested under the `weapon` key. It is very important to note that not all items in OSRS are equipable weapons. Only items with the `equipable_weapon` property set to `true` are equipable. All of the properties available for equipable weapons are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| attack_speed | integer | The attack speed of a weapon (in game ticks). | True | False |
| weapon_type | string | The weapon classification (e.g., axes) | True | False |
| stances | list | An array of weapon stance information. | True | False |
### Item: Python Object Example
A description of the properties that each item in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of an item as loaded in a Python object, specifically the _Abyssal whip_ item. Since this item is a type of equipment, there is an `EquipmentProperties` object nested with combat bonuses. Additionally, this item is also a weapon, so there is a `WeaponProperties` object with extra information. If the item was not equipable, the `EquipmentProperties` property would be `None` and the `equipable_by_player` would be `False`. If the item was not a weapon, the `WeaponProperties` key would be `None` and the `equipable_weapon` would be `False`.
```
ItemProperties(
id=4151,
name='Abyssal whip',
last_updated='2020-12-27',
incomplete=False,
members=True,
tradeable=True,
tradeable_on_ge=True,
stackable=False,
stacked=None,
noted=False,
noteable=True,
linked_id_item=None,
linked_id_noted=4152,
linked_id_placeholder=14032,
placeholder=False,
equipable=True,
equipable_by_player=True,
equipable_weapon=True,
cost=120001,
lowalch=48000,
highalch=72000,
weight=0.453,
buy_limit=70,
quest_item=False,
release_date='2005-01-26',
duplicate=False,
examine='A weapon from the abyss.',
icon='iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAABvUlEQVR4Xu2Xv26DMBDG4QEyZECKIkVCKIoyVR26dOrQpUOHDn3/V3F7nL7689kGAo6z9JNuiH1wP+6PIU3zr2Jq3bRVkQ/Y7feBvfcn93o8upfDwT11XQKwOGQMwfYx9O7rcnaf52GEezuFgNdfn4JQ7RjAQojZLAAMcPJbAOH73PcloBTIQiEAG8MB7Pt6MQ+wSW1QAs6Kh1A/NgtnHyKMcZMUCP3AIBw0XcqmgU9qb4W0JwTIwuRAYHETF4FSIMkORjn1xCnjayy8lN/vLVY7TglfvBRGTJpZrpXM+my1f6DhPRdJs8M3nAPibGDseY9hVgHxzbh3chC22dkPQ8EnufddpBgI69Lk3B8hnPrwOsPEw7FYqUzoOsqBUtps8XUASh0bYbxZxUCcJZzCNnjOBGgDDBRD8d4tQAVgRAqEs2jusLOGEhaCgTQTgApLp/s5A0RBGMg3shx2YZb0fZUz9issD4VpsR4PkJ+uYbczJQr94rW7KT3yDJcegLtqeuRlAFa+0bdoeuTxPV2538Ixt1D86Vutr8IR16CSndzfoSpQLIDh09dmscL5lJICMUClw3JKD8tGXiVgfgACr1tEhnw7UAAAAABJRU5ErkJggg==',
wiki_name='Abyssal whip',
wiki_url='https://oldschool.runescape.wiki/w/Abyssal_whip',
equipment=ItemEquipment(
attack_stab=0,
attack_slash=82,
attack_crush=0,
attack_magic=0,
attack_ranged=0,
defence_stab=0,
defence_slash=0,
defence_crush=0,
defence_magic=0,
defence_ranged=0,
melee_strength=82,
ranged_strength=0,
magic_damage=0,
prayer=0,
slot='weapon',
requirements={'attack': 70}
),
weapon=ItemWeapon(
attack_speed=4,
weapon_type='whip',
stances=[
{
'combat_style': 'flick',
'attack_type': 'slash',
'attack_style': 'accurate',
'experience': 'attack',
'boosts': None
},
{
'combat_style': 'lash',
'attack_type': 'slash',
'attack_style': 'controlled',
'experience': 'shared',
'boosts': None},
{
'combat_style': 'deflect',
'attack_type': 'slash',
'attack_style': 'defensive',
'experience': 'defence',
'boosts': None
}
]
)
)
```
### Item: JSON Example
A description of the properties that each item in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of an item, specifically the _Abyssal whip_ item. Since this item is a type of equipment, there is an `equipment` key with combat bonuses. Additionally, this item is also a weapon, so there is a `weapon` key with extra information. If the item was not equipable, the `equipment` key would be `null` and the `equipable_by_player` would be `false`. If the item was not a weapon, the `weapon` key would be `null` and the `equipable_weapon` would be `false`.
```
{
"id": 4151,
"name": "Abyssal whip",
"last_updated": "2020-12-27",
"incomplete": false,
"members": true,
"tradeable": true,
"tradeable_on_ge": true,
"stackable": false,
"stacked": null,
"noted": false,
"noteable": true,
"linked_id_item": null,
"linked_id_noted": 4152,
"linked_id_placeholder": 14032,
"placeholder": false,
"equipable": true,
"equipable_by_player": true,
"equipable_weapon": true,
"cost": 120001,
"lowalch": 48000,
"highalch": 72000,
"weight": 0.453,
"buy_limit": 70,
"quest_item": false,
"release_date": "2005-01-26",
"duplicate": false,
"examine": "A weapon from the abyss.",
"icon": "iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAABvUlEQVR4Xu2Xv26DMBDG4QEyZECKIkVCKIoyVR26dOrQpUOHDn3/V3F7nL7689kGAo6z9JNuiH1wP+6PIU3zr2Jq3bRVkQ/Y7feBvfcn93o8upfDwT11XQKwOGQMwfYx9O7rcnaf52GEezuFgNdfn4JQ7RjAQojZLAAMcPJbAOH73PcloBTIQiEAG8MB7Pt6MQ+wSW1QAs6Kh1A/NgtnHyKMcZMUCP3AIBw0XcqmgU9qb4W0JwTIwuRAYHETF4FSIMkORjn1xCnjayy8lN/vLVY7TglfvBRGTJpZrpXM+my1f6DhPRdJs8M3nAPibGDseY9hVgHxzbh3chC22dkPQ8EnufddpBgI69Lk3B8hnPrwOsPEw7FYqUzoOsqBUtps8XUASh0bYbxZxUCcJZzCNnjOBGgDDBRD8d4tQAVgRAqEs2jusLOGEhaCgTQTgApLp/s5A0RBGMg3shx2YZb0fZUz9issD4VpsR4PkJ+uYbczJQr94rW7KT3yDJcegLtqeuRlAFa+0bdoeuTxPV2538Ixt1D86Vutr8IR16CSndzfoSpQLIDh09dmscL5lJICMUClw3JKD8tGXiVgfgACr1tEhnw7UAAAAABJRU5ErkJggg==",
"wiki_name": "Abyssal whip",
"wiki_url": "https://oldschool.runescape.wiki/w/Abyssal_whip",
"equipment": {
"attack_stab": 0,
"attack_slash": 82,
"attack_crush": 0,
"attack_magic": 0,
"attack_ranged": 0,
"defence_stab": 0,
"defence_slash": 0,
"defence_crush": 0,
"defence_magic": 0,
"defence_ranged": 0,
"melee_strength": 82,
"ranged_strength": 0,
"magic_damage": 0,
"prayer": 0,
"slot": "weapon",
"requirements": {
"attack": 70
}
},
"weapon": {
"attack_speed": 4,
"weapon_type": "whip",
"stances": [
{
"combat_style": "flick",
"attack_type": "slash",
"attack_style": "accurate",
"experience": "attack",
"boosts": null
},
{
"combat_style": "lash",
"attack_type": "slash",
"attack_style": "controlled",
"experience": "shared",
"boosts": null
},
{
"combat_style": "deflect",
"attack_type": "slash",
"attack_style": "defensive",
"experience": "defence",
"boosts": null
}
]
}
}
```
## The Monster Database
Each monster is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects. Additionally, the data is accessible directly by parsing the raw JSON files. There are two types of objects, or classifications of data, that can be used to represent part of an in-game OSRS monster, each outlined in the following subsections.
### Monster Properties
A `MonsterProperties` object type includes basic monster metadata such as `id`, `name`, `examine` text, `combat_level`, `attack_speed` and `hitpoints` values and slayer association such as `slayer_masters` who give this monster as a task. Every monster object in the monster database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique OSRS monster ID number. | True | False |
| name | string | The name of the monster. | True | False |
| last_updated | string | The last time (UTC) the monster was updated (in ISO8601 date format). | True | True |
| incomplete | boolean | If the monster has incomplete wiki data. | True | False |
| members | boolean | If the monster is members only, or not. | True | False |
| release_date | string | The release date of the monster (in ISO8601 date format). | True | True |
| combat_level | integer | The combat level of the monster. | True | False |
| size | integer | The size, in tiles, of the monster. | True | False |
| hitpoints | integer | The number of hitpoints a monster has. | True | True |
| max_hit | integer | The maximum hit of the monster. | True | True |
| attack_type | list | The attack style (e.g., melee, magic, range) of the monster. | True | False |
| attack_speed | integer | The attack speed (in game ticks) of the monster. | True | True |
| aggressive | boolean | If the monster is aggressive, or not. | True | False |
| poisonous | boolean | If the monster poisons, or not | True | False |
| venomous | boolean | If the monster poisons using venom, or not | True | False |
| immune_poison | boolean | If the monster is immune to poison, or not | True | False |
| immune_venom | boolean | If the monster is immune to venom, or not | True | False |
| attributes | list | An array of monster attributes. | True | False |
| category | list | An array of monster category. | True | False |
| slayer_monster | boolean | If the monster is a potential slayer task. | True | False |
| slayer_level | integer | The slayer level required to kill the monster. | True | True |
| slayer_xp | float | The slayer XP rewarded for a monster kill. | True | True |
| slayer_masters | list | The slayer masters who can assign the monster. | True | False |
| duplicate | boolean | If the monster is a duplicate. | True | False |
| examine | string | The examine text of the monster. | True | False |
| wiki_name | string | The OSRS Wiki name for the monster. | True | False |
| wiki_url | string | The OSRS Wiki URL (possibly including anchor link). | True | False |
| attack_level | integer | The attack level of the monster. | True | False |
| strength_level | integer | The strength level of the monster. | True | False |
| defence_level | integer | The defence level of the monster. | True | False |
| magic_level | integer | The magic level of the monster. | True | False |
| ranged_level | integer | The ranged level of the monster. | True | False |
| attack_bonus | integer | The attack bonus of the monster. | True | False |
| strength_bonus | integer | The strength bonus of the monster. | True | False |
| attack_magic | integer | The magic attack of the monster. | True | False |
| magic_bonus | integer | The magic bonus of the monster. | True | False |
| attack_ranged | integer | The ranged attack of the monster. | True | False |
| ranged_bonus | integer | The ranged bonus of the monster. | True | False |
| defence_stab | integer | The defence stab bonus of the monster. | True | False |
| defence_slash | integer | The defence slash bonus of the monster. | True | False |
| defence_crush | integer | The defence crush bonus of the monster. | True | False |
| defence_magic | integer | The defence magic bonus of the monster. | True | False |
| defence_ranged | integer | The defence ranged bonus of the monster. | True | False |
| drops | list | An array of monster drop objects. | True | False |
### Monster Drops
Most monsters in OSRS drop items when they have been defeated (killed). All monster drops are stored in the `drops` property in an array containing properties about the item drop. When using the PyPi `osrsbox` package, these drops are represented by a list of `MonsterDrops` object type. When parsing the raw JSON files, the drops are stored in an array, that are nested under the `drops` key. The data included with the monster drops are the item `id`, item `name`, the drop `rarity`, whether the drop is `noted` and any `drop_requirements`. All of the properties available for item drops are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | The ID number of the item drop. | True | False |
| name | string | The name of the item drop. | True | False |
| members | boolean | If the drop is a members-only item. | True | False |
| quantity | string | The quantity of the item drop (integer, comma-separated or range). | True | True |
| noted | boolean | If the item drop is noted, or not. | True | False |
| rarity | float | The rarity of the item drop (as a float out of 1.0). | True | False |
| rolls | integer | Number of rolls from the drop. | True | False |
### Monster: Python Object Example
A description of the properties that each monster in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a monster, specifically the _Abyssal demon_ monster. Please note that the number of item `drops` key data has been reduced to make the data more readable.
```
MonsterProperties(
id=415,
name='Abyssal demon',
last_updated='2020-12-25',
incomplete=False,
members=True,
release_date='2005-01-26',
combat_level=124,
size=1,
hitpoints=150,
max_hit=8,
attack_type=['stab'],
attack_speed=4,
aggressive=False,
poisonous=False,
venomous=False,
immune_poison=False,
immune_venom=False,
attributes=['demon'],
category=['abyssal demon'],
slayer_monster=True,
slayer_level=85,
slayer_xp=150.0,
slayer_masters=[
'vannaka',
'chaeldar',
'konar',
'nieve',
'duradel'
],
duplicate=False,
examine='A denizen of the Abyss!',
wiki_name='Abyssal demon (Standard)',
wiki_url='https://oldschool.runescape.wiki/w/Abyssal_demon#Standard',
attack_level=97,
strength_level=67,
defence_level=135,
magic_level=1,
ranged_level=1,
attack_bonus=0,
strength_bonus=0,
attack_magic=0,
magic_bonus=0,
attack_ranged=0,
ranged_bonus=0,
defence_stab=20,
defence_slash=20,
defence_crush=20,
defence_magic=0,
defence_ranged=20,
drops=
[
MonsterDrop(
id=592,
name='Ashes',
members=False,
quantity='1',
noted=False,
rarity=1.0,
rolls=1
),
...
MonsterDrop(
id=4151,
name='Abyssal whip',
members=True,
quantity='1',
noted=False,
rarity=0.001953125,
rolls=1
)
]
)
```
### Monster: JSON Example
A description of the properties that each monster in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a monster, specifically the _Abyssal demon_ monster. Please note that the number of item `drops` key data has been reduced to make the data more readable.
```
{
"id": 415,
"name": "Abyssal demon",
"last_updated": "2020-12-25",
"incomplete": false,
"members": true,
"release_date": "2005-01-26",
"combat_level": 124,
"size": 1,
"hitpoints": 150,
"max_hit": 8,
"attack_type": [
"stab"
],
"attack_speed": 4,
"aggressive": false,
"poisonous": false,
"venomous": false,
"immune_poison": false,
"immune_venom": false,
"attributes": [
"demon"
],
"category": [
"abyssal demon"
],
"slayer_monster": true,
"slayer_level": 85,
"slayer_xp": 150.0,
"slayer_masters": [
"vannaka",
"chaeldar",
"konar",
"nieve",
"duradel"
],
"duplicate": false,
"examine": "A denizen of the Abyss!",
"wiki_name": "Abyssal demon (Standard)",
"wiki_url": "https://oldschool.runescape.wiki/w/Abyssal_demon#Standard",
"attack_level": 97,
"strength_level": 67,
"defence_level": 135,
"magic_level": 1,
"ranged_level": 1,
"attack_bonus": 0,
"strength_bonus": 0,
"attack_magic": 0,
"magic_bonus": 0,
"attack_ranged": 0,
"ranged_bonus": 0,
"defence_stab": 20,
"defence_slash": 20,
"defence_crush": 20,
"defence_magic": 0,
"defence_ranged": 20,
"drops": [
{
"id": 1623,
"name": "Uncut sapphire",
"members": true,
"quantity": "1",
"noted": false,
"rarity": 0.009765625,
"rolls": 1
},
...
{
"id": 4151,
"name": "Abyssal whip",
"members": true,
"quantity": "1",
"noted": false,
"rarity": 0.001953125,
"rolls": 1
}
]
}
```
## The Prayer Database
Each prayer is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects Additionally, the data is accessible directly by parsing the raw JSON files. All prayer data is stored in a single object to represent the properties of an in-game OSRS prayer, which is outlined in the following subsection.
### Prayer Properties
A `PrayerProperties` object type includes basic prayer metadata such as `id`, `name`, `description` text, `drain_per_minute`, `requirements` and `bonuses` values. Every prayer object in the prayer database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique prayer ID number. | True | False |
| name | string | The name of the prayer. | True | False |
| members | boolean | If the prayer is members-only. | True | False |
| description | string | The prayer description (as show in-game). | True | False |
| drain_per_minute | float | The prayer point drain rate per minute. | True | False |
| wiki_url | string | The OSRS Wiki URL. | True | False |
| requirements | dict | The stat requirements to use the prayer. | True | False |
| bonuses | dict | The bonuses a prayer provides. | True | False |
| icon | string | The prayer icon. | True | False |
### Prayer: Python Object Example
A description of the properties that each prayer in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a prayer, specifically the _Rigour_ prayer, as loaded in the `osrsbox` PyPi Python package.
```
PrayerProperties(
id=28,
name='Rigour',
members=True,
description='Increases your Ranged attack by 20% and damage by 23%, and your defence by 25%.',
drain_per_minute=40.0,
wiki_url='https://oldschool.runescape.wiki/w/Rigour',
requirements={'prayer': 74, 'defence': 70},
bonuses={'ranged': 20, 'ranged_strength': 25, 'defence': 23},
icon='iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAABMklEQVR42rWW3Q0CIRCEjwJ8tgBrMPHZFmzAIny0gOvA+izAGjCYcMwNswucSrLJHT/7McvyM02bSojTfwo7Tv8h3h/PqKFfTSTEYqUuwTRQ9R8Erp0XdV79ANBWw7Y/7Mw2W7mhqDSGxTkC0vf5eqqg2I99CKAOVXZ0mY+Lw/SdgFjHk7DD3xE+hLZsINR2+BQMlXG7Gu8Cc2jyt4KketWWw22HWYTUWqcMsYzVcmIBMFQZqBSxmvl1+xj2Z7XdQByQHbKSDET1qNCB1uuHs1ZhY2NgQ2W9fpbCEaAT0jpLeZAKaQvmJI3OUs5QhHoZqoDuWcr7jDe4lURqL3bcIOsTxwJbxmvdcV0FeQPgPmydpZ3KJvcg904bVNi+GwegCPYgG2D1g6nXfvCu4cdRy9rlDXGzl98mKbMMAAAAAElFTkSuQmCC'
)
```
### Prayer: JSON Example
A description of the properties that each prayer in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a prayer, specifically the _Rigour_ prayer, as a JSON object.
```
"id": 28,
"name": "Rigour",
"members": true,
"description": "Increases your Ranged attack by 20% and damage by 23%, and your defence by 25%.",
"drain_per_minute": 40.0,
"wiki_url": "https://oldschool.runescape.wiki/w/Rigour",
"requirements": {
"prayer": 74,
"defence": 70
},
"bonuses": {
"ranged": 20,
"ranged_strength": 25,
"defence": 23
},
"icon": "iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAABMklEQVR42rWW3Q0CIRCEjwJ8tgBrMPHZFmzAIny0gOvA+izAGjCYcMwNswucSrLJHT/7McvyM02bSojTfwo7Tv8h3h/PqKFfTSTEYqUuwTRQ9R8Erp0XdV79ANBWw7Y/7Mw2W7mhqDSGxTkC0vf5eqqg2I99CKAOVXZ0mY+Lw/SdgFjHk7DD3xE+hLZsINR2+BQMlXG7Gu8Cc2jyt4KketWWw22HWYTUWqcMsYzVcmIBMFQZqBSxmvl1+xj2Z7XdQByQHbKSDET1qNCB1uuHs1ZhY2NgQ2W9fpbCEaAT0jpLeZAKaQvmJI3OUs5QhHoZqoDuWcr7jDe4lURqL3bcIOsTxwJbxmvdcV0FeQPgPmydpZ3KJvcg904bVNi+GwegCPYgG2D1g6nXfvCu4cdRy9rlDXGzl98mKbMMAAAAAElFTkSuQmCC"
}
```
## Project Contribution
This project would thoroughly benefit from contributions from additional developers. Please feel free to submit a pull request if you have code that you wish to contribute - I would thoroughly appreciate the helping hand. For any code contributions, the best method is to [open a new GitHub pull request](https://github.com/osrsbox/osrsbox-db/pulls) in the project repository. Also, feel free to contact me (e.g., on the Discord server) if you wish to discuss contribution before making a pull request. If you are not a software developer and want to contribute, even something as small as _Staring_ this repository really makes my day and keeps me motivated!
### Crowd Sourcing Item Skill Requirements
A really manual part of the item database is the `item.equipment.requirements` data. So far, I have manually populated this data... for over 3,500 items! To keep this project alive, I have stopped adding in this data (as it takes a lot of time). Here is a summary of how the item skill requirements work:
- All item requirements are stored in the [`skill-requirements.json`](https://github.com/osrsbox/osrsbox-db/blob/master/data/items/items-skill-requirements.json) file
- They have a structure of:
```
"item_id": {
"skill_name": integer
},
```
- For example, the Abyssal whip item:
```
"4151": {
"attack": 70
},
```
- For the `skill_name`, the [`schema-items.json`](https://github.com/osrsbox/schemas/blob/67b062b8d8499f80f43a95ff3b72cc40a6a833c9/schema-items.json#L293) file has a list of the allowed values - to help get the correct skill name. For example, `runecraft` and not `runecrafting`!
With some community help (by crowd sourcing) we could keep this data point fresh. If you find an error or want to add in a requirement, and want to contribute, here are the best ways to help:
- GitHub PR: Clone the project repo, make changes to `skill-requirements.json`, submit PR
- GitHub Issue: Submit an issue with the fix. It would really help me if you put the request in the correct JSON format as described above!
FYI - there is currently no quest-associated requirements. This would be a great addition to the project, but seems to be a very complex thing to add.
## Additional Project Information
This section contains additional information about the osrsbox-db project. For detailed information about the project see the [`osrsbox.com`](https://www.osrsbox.com/) website for the official project page, and the _Database_ tag to find blog posts about the project:
- https://www.osrsbox.com/projects/osrsbox-db/
- https://www.osrsbox.com/blog/tags/Database/
### Project Feedback
I would thoroughly appreciate any feedback regarding the osrsbox-db project, especially problems with the inaccuracies of the data provided. So if you notice any problem with the accuracy of item property data, could you please let me know. The same goes for any discovered bugs, or if you have a specific feature request. The best method is to [open a new Github issue](https://github.com/osrsbox/osrsbox-db/issues) in the project repository.
### Project License
The osrsbox-db project is released under the GNU General Public License version 3 as published by the Free Software Foundation. You can read the [LICENSE](LICENSE) file for the full license, check the [GNU GPL](https://www.gnu.org/licenses/gpl-3.0.en.html) page for additional information, or check the [tl;drLegal](https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)) documentation for the license explained in simple English. The GPL license is specified for all source code contained in this project. Other content is specified under GPL if not listed in the **Exceptions to GPL** below.
#### Exceptions to GPL
Old School RuneScape (OSRS) content and materials are trademarks and copyrights of JaGeX or its licensors. All rights reserved. OSRSBox and the osrsbox-db project is not associated or affiliated with JaGeX or its licensors.
Additional data to help build this project is sourced from the [OSRS Wiki](https://oldschool.runescape.wiki/). This primarily includes item and monster metadata that is not available in the OSRS cache. As specified by the [Weird Gloop Copyright](https://meta.weirdgloop.org/w/Meta:Copyrights) page, this content is licensed under CC BY-NC-SA 3.0 - [Attribution-NonCommercial-ShareAlike 3.0 Unported](https://creativecommons.org/licenses/by-nc-sa/3.0/) license.
### Project Attribution
The osrsbox-db project is a labor of love. I put a huge amount of time and effort into the project, and I want people to use it. That is the entire reason for its existence. I am not too fussed about attribution guidelines... but if you want to use the project please adhere to the licenses used. Please feel free to link to this repository or my [OSRSBox website](https://www.osrsbox.com/) if you use it in your project - mainly so others can find it, and hopefully use it too!
%package -n python3-osrsbox
Summary: A complete and up-to-date database of Old School Runescape (OSRS) items, monsters and prayers accessible using a Python API.
Provides: python-osrsbox
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-osrsbox
# osrsbox-db
 
[](https://badge.fury.io/py/osrsbox) 
[](https://discord.gg/HFynKyr)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9J44ADGJQ5BC6&source=url)
## A complete and up-to-date database of Old School Runescape (OSRS) items, monsters and prayers
This project hosts a complete and up-to-date database items, monsters and prayers in OSRS. **Complete** means it holds every single item, monster and prayer in OSRS. **Up-to-date** means this database is updated after every weekly game update to ensure accurate information.
The item database has extensive properties for each item: a total of 27 properties for every item, an additional 16 properties for equipable items, and an additional 3 properties for equipable weapons. These properties include the item ID and name, whether an item is tradeable, stackable, or equipable or if the item is members only. For any equipable item, there are additional properties about combat stats; for example, what slash attack bonus, magic defence bonus or prayer bonus that an item provides. For weapons, additional properties are added which include attack speed, combat stance and weapon type information.
The monster database also has extensive properties: a total of 44 unique properties for each monster, as well as an array of item drops for each monster that has 6 additional properties per item drop. The base properties include the monster ID, name, member status, slayer properties, attack type, max hit, attack types and all monster combat stats. Each monster also has an associated array of drops which document the item ID, name, rarity, quantity, and any requirements to get the drop.
The prayer database documents each prayer that available in-game and has detailed properties: a total of 8 properties for every prayer. The base properties include the prayer name, members status, description, requirements, and bonuses that it provides.
## Table of Contents
- [Project Summary](#project-summary)
- [The `osrsbox` Python PyPi Package](#the-osrsbox-python-pypi-package)
- [The osrsbox RESTful API](#the-osrsbox-restful-api)
- [The osrsbox Static JSON API](#the-osrsbox-static-json-api)
- [The `osrsbox-db` GitHub Repository](#the-osrsbox-db-github-repository)
- [The Item Database](#the-item-database)
- [The Monster Database](#the-monster-database)
- [The Prayer Database](#the-prayer-database)
- [Project Contribution](#project-contribution)
- [Additional Project Information](#additional-project-information)
## Project Summary
The osrsbox-db project provides data for three different categories:
1. **Items**
1. **Monsters**
1. **Prayers**
The osrsbox-db project and data is accessible using four methods:
1. [**The Python PyPi package**](https://pypi.org/project/osrsbox/)
1. [**The RESTful API**](https://github.com/osrsbox/osrsbox-api/)
1. [**The Static JSON API**](https://github.com/osrsbox/osrsbox-db/tree/master/docs)
1. [**The GitHub development repository**](https://github.com/osrsbox/osrsbox-db/)
With four different methods to access data... most people will have the following question: _Which one should I use?_ The following list is a short-sharp summary of the options:
1. [**The Python PyPi package**](https://pypi.org/project/osrsbox/): Use this if you are programming anything in Python - as it is the simplest option. Install using `pip`, and you are ready to do anything from experimenting and prototyping, to building a modern web app using something like Flask.
1. [**The RESTful API**](https://github.com/osrsbox/osrsbox-api/): Use this if you are not programming in Python, and want an Internet-accessible API with rich-quering including filtering, sorting and projection functionality.
1. [**The Static JSON API**](https://github.com/osrsbox/osrsbox-db/tree/master/docs): Use this if you want Internet-accessible raw data (JSON files and PNG images) and don't need queries to filter data. This is a good option if you want to _dump_ the entire database contents, and saves the RESTful API from un-needed traffic.
1. [**The GitHub development repository**](https://github.com/osrsbox/osrsbox-db/): The development repository provides the code and data to build the database. I would not recommend using the development repository unless you are (really) interested in the project or you want to contribute to the project.
## The `osrsbox` Python PyPi Package
If you want to access the item and monster database programmatically using Python, the simplest option is to use the [`osrsbox` package available from PyPi](https://pypi.org/project/osrsbox/). You can load the item and/or monster database and process item objects, monster objects, and their properties.
### Package Quick Start
- Make sure you have >= Python 3.6
- Install package using: `pip install osrsbox`
- Item database quick start:
- Import items API using: `from osrsbox import items_api`
- Load all items using: `items = items_api.load()`
- Loop items using: `for item in items: print(item.name)`
- Monster database quick start:
- Import monsters API using: `from osrsbox import monsters_api`
- Load all monsters using: `monsters = monsters_api.load()`
- Loop monsters using: `for monster in monsters: print(monster.name)`
- Prayer database quick start:
- Import prayers API using: `from osrsbox import prayers_api`
- Load all prayers using: `prayers = prayers_api.load()`
- Loop prayers using: `for prayer in prayers: print(prayer.name)`
### Package Requirements
For the `osrsbox` PyPi package you must meet the following requirements:
- Python 3.6 or above
- Pip package manager
- Dataclasses package (if Python is below 3.7)
If you are using Python 3.6, the `dataclasses` package will automatically be installed. If you are using Python 3.7 or above, the `dataclasses` package is part of the standard library and will not be installed automatically.
### Package Installation
The easiest way to install the osrsbox package is through the [Python Package Index](http://pypi.python.org/) using the `pip` command. You need to have `pip` installed - and make sure it is updated (especially on Windows). Then you can install the `osrsbox` package using the following `pip` command:
```
pip install osrsbox
```
### Package Upgrading
The package is consistently updated - usually after each weekly in-game update. This is because the in-game update usually introduces additional items into the game or changes existing items. Therefore, you should regularly check and update the `osrsbox` package. To achieve this, run `pip` with the `upgrade` flag, as demonstrated in the following command:
```
pip install --upgrade osrsbox
```
### Package Usage
The key use of the `osrsbox` package is to load and automate the processing of OSRS items and their associated metadata. You can load the package using `import osrsbox`, however, you probably want to load the `items_api` module or `monsters_api` module. A simple example of using the package to `load` all the items, then loop and print out the item ID and name of every item in OSRS is provided below:
```
phoil@gilenor ~ $ python3.6
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from osrsbox import items_api
>>> items = items_api.load()
>>> for item in items:
... print(item.id, item.name)
```
Instead of using the Python interpreter, you can also write a simple script and import the `osrsbox` Python package. An example script is provided below, this time for the `monsters_api`:
```
#!/usr/bin/python3
from osrsbox import monsters_api
monsters = monsters_api.load()
for monster in monsters:
print(monster.id, monster.name)
```
If you would like to review additional examples of using the `osrsbox` Python API, have a look at the [`items_api_examples` folder](https://github.com/osrsbox/osrsbox-db/tree/master/osrsbox/items_api_examples) and [`monsters_api_examples` folder](https://github.com/osrsbox/osrsbox-db/tree/master/osrsbox/monsters_api_examples). There are a number of scripts available that provide examples of loading and processing data using the Python API.
## The osrsbox RESTful API
The [official osrsbox-api GitHub repository](https://github.com/osrsbox/osrsbox-api) hosts the source code used for the RESTful API. The official `osrsbox-api` project is available from:
- [https://api.osrsbox.com](https://api.osrsbox.com)
The link provided above has an API landing page with detailed information on the project including a project summary, API endpoints, and links to useful documentation. Also, have a look at the [official `osrsbox-api` project README](https://github.com/osrsbox/osrsbox-api/blob/master/README.md) for more information. The README has a tutorial on how to build the API docker environment locally for testing purposes which might be useful.
## The `osrsbox` Static JSON API
This project also includes an Internet-accessible, static JSON API for all items/monsters in the database. The JSON API was originally written for the [`osrsbox-tooltips` project](https://github.com/osrsbox/osrsbox-tooltips) but has since been used for a variety of other projects. The JSON API is useful when you do not want to write a program in Python (as using the PyPi package is probably easier), but would like to fetch the database information programmatically over the Internet, and receive the data back in nicely structured JSON syntax. A key example is a web application.
### Static JSON API Files
The JSON API is available in the [`docs` folder](https://github.com/osrsbox/osrsbox-db/tree/master/docs/) in the osrsbox-db project repository. This folder contains the publicly available database. Every file inside this specific folder can be fetched using HTTP GET requests. The base URL for this folder is `https://www.osrsbox.com/osrsbox-db/`. Simply append any name of any file from the `docs` folder to the base URL, and you can fetch this data. A summary of the folders/files provided in the JSON API are listed below with descriptions:
- `items-complete.json`: A single JSON file that combines all single JSON files from `items-json` folder. This file contains the entire osrsbox-db items database in one file. This is useful if you want to get the data for every single item.
- `items-icons`: Collection of PNG files (20K+) for every item inventory icon in OSRS. Each inventory icon is named using the unique item ID number.
- `items-json`: Collection of JSON files (20K+) of extensive item metadata for every item in OSRS. This folder contains the entire osrsbox-db item database where each item has an individual JSON file, named using the unique item ID number. This is useful when you want to fetch data for a single item where you already know the item ID number.
- `items-json-slot`: Collection of JSON files extracted from the database that are specific for each equipment slot (e.g., head, legs). This is useful when you want to only get item data for equipable items for one, or multiple, specific item slot.
- `items-summary.json`: A single JSON file that contains only the item names and item ID numbers. This file is useful when you want to download a small file (1.1MB) to quickly scan/process item data when you only need the item name and/or ID number.
- `models-summary.json`: A single JSON file that contains model ID numbers for items, objects, and NPCs. This file is useful to determine the model ID number for a specific item, object or NPC.
- `monsters-complete.json`: A single JSON file that combines all single JSON files from the `monsters-json` folder. This file contains the entire osrsbox-db monster database in one file. This is useful if you want to get the data for every single monster in one file.
- `monsters-json`: Collection of JSON files (2.5K+) of extensive monster metadata for every monster in OSRS. This folder contains the entire osrsbox-db monster database where each monster has an individual JSON file, named using the unique monster ID number. This is useful when you want to fetch data for a single monster where you already know the item ID number.
- `npcs-summary.json`: A single JSON file that contains only the NPC names and NPC ID numbers. This file is useful when you want to download a small file (0.35MB) to quickly scan/process NPC data when you only need the NPC name and/or ID number. Note that this file contains both attackable, and non-attackable (monster) NPCs.
- `objects-summary.json`: A single JSON file that contains only the object names and object ID numbers. This file is useful when you want to download a small file (0.86MB) to quickly scan/process in-game object data when you only need the object name and/or ID number.
- `prayer-icon`: Collection of PNG files for each prayer in OSRS.
- `prayer-json`: Collection of individual JSON files with properties and metadata about OSRS prayers.
### Accessing the Static JSON API
The JSON file for each OSRS item can be directly accessed using unique URLs provide through the [`osrsbox.com`](https://www.osrsbox.com/osrsbox-db/) base URL. As mentioned, you can fetch JSON files using a unique URL, but cannot modify any JSON content. Below is a list of URL examples for items and monsters in the osrsbox-db database:
- [`https://www.osrsbox.com/osrsbox-db/items-json/2.json`](https://www.osrsbox.com/osrsbox-db/items-json/2.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/74.json`](https://www.osrsbox.com/osrsbox-db/items-json/74.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/35.json`](https://www.osrsbox.com/osrsbox-db/items-json/35.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/415.json`](https://www.osrsbox.com/osrsbox-db/items-json/415.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/239.json`](https://www.osrsbox.com/osrsbox-db/items-json/239.json)
As displayed by the links above, each item or monster is stored in the `osrsbox-db` repository, under the [`items-json`](https://github.com/osrsbox/osrsbox-db/tree/master/docs/items-json) folder or [`monsters-json`](https://github.com/osrsbox/osrsbox-db/tree/master/docs/monsters-json) folder. In addition to the single JSON files for each item, many other JSON files can be fetched. Some more examples are provided below:
- [`https://www.osrsbox.com/osrsbox-db/items-complete.json`](https://www.osrsbox.com/osrsbox-db/items-complete.json)
- [`https://www.osrsbox.com/osrsbox-db/monsters-complete.json`](https://www.osrsbox.com/osrsbox-db/monsters-complete.json)
- [`https://www.osrsbox.com/osrsbox-db/items-summary.json`](https://www.osrsbox.com/osrsbox-db/items-summary.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json-slot/items-cape.json`](https://www.osrsbox.com/osrsbox-db/items-json-slot/items-cape.json)
- [`https://www.osrsbox.com/osrsbox-db/prayer-json/protect-from-magic.json`](https://www.osrsbox.com/osrsbox-db/prayer-json/protect-from-magic.json)
So how can you get and use these JSON files about OSRS items? It is pretty easy but depends on what you are trying to accomplish and what programming language you are using. Some examples are provided in the following subsections.
### Accessing the JSON API using Command Line Tools
Take a simple example of downloading a single JSON file. In a Linux system, we could use the `wget` command to download a single JSON file, as illustrated in the example code below:
```
wget https://www.osrsbox.com/osrsbox-db/items-json/12453.json
```
You could perform a similar technique using the `curl` tool:
```
curl https://www.osrsbox.com/osrsbox-db/items-json/12453.json
```
For Windows users, you could use PowerShell:
```
Invoke-WebRequest -Uri "https://www.osrsbox.com/osrsbox-db/items-json/12453.json" -OutFile "12453.json"
```
### Accessing the JSON API using Python
Maybe you are interested in downloading a single (or potentially multiple) JSON files about OSRS items and processing the information in a Python program. The short script below downloads the `12453.json` file using Python's `urllib` library, loads the data as a JSON object and prints the contents to the console. The code is a little messy, primarily due to supporting both Python 2 and 3 - as you can see from the `try` and `except` importing method implemented.
```
import json
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
url = ("https://www.osrsbox.com/osrsbox-db/items-json/12453.json")
response = urlopen(url)
data = response.read().decode("utf-8")
json_obj = json.loads(data)
print(json_obj)
```
### Accessing the JSON API using JavaScript
Finally, let's have a look at JavaScript (specifically jQuery) example to fetch a JSON file from the osrsbox-db and build an HTML element to display in a web page. The example below is a very simple method to download the JSON file using the jQuery `getJSON` function. Once we get the JSON file, we loop through the JSON entries and print each key and value (e.g., `name` and _Black wizard hat (g)_) on its own line in a `div` element.
```
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.getJSON("https://www.osrsbox.com/osrsbox-db/items-json/12453.json", function(result){
$.each(result, function(i, field){
$("div").append(i + " " + field + "<br>");
});
});
});
});
</script>
</head>
<body>
<button>Get JSON data</button>
<div></div>
</body>
</html>
```
## The `osrsbox-db` GitHub Repository
The [official osrsbox-db GitHub repository](https://github.com/osrsbox/osrsbox-db) hosts the source code for the entire osrsbox-db project. The Python PyPi package is located in the `osrsbox` folder of the official development repository, while the other folders in this repository are used to store essential data and Python modules to build the item database.
### Using the Development Repository
If using this repository (the development version), you will need to fulfill some specific requirements. This includes having the following tools available on your system:
- Python 3.6 or above
- Pip - the standard package manager for Python
- A selection of additional Python packages
As a short example, I configured my Ubuntu 18.04 system to run the development repository code using the following steps:
```
sudo apt update
sudo apt install python3-pip
```
These two commands will install the `pip3` command, allowing the installation of Python packages. Then you can use `pip3` to install additional packages. The development repository requires a variety of Python packages in addition to the mandatory `dataclasses` package. These package requirements are documented in the [`requirements.txt`](https://github.com/osrsbox/osrsbox-db/tree/master/requirements.txt) file. It is recommended to use the `venv` module to set up your environment, then install the specified requirements. As an example, the following workflow is provided for Linux-based environments (make sure `python3` is available first):
```
git clone --recursive https://github.com/osrsbox/osrsbox-db.git
cd osrsbox-db
python -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
```
When you have finished with working in the `osrsbox-db` repository, make sure to deactivate the current `venv` environment using:
```
deactivate
```
### Summary of Repository Structure
- `builders`: The builders are the code that performs automatic regeneration of the databases. These builders read in a variety of data and produce a JSON file for each item or monster.
- `items`: The item database builder that uses a collection of Python scripts to build the item database. The `builder.py` script is the primary entry point, and the `build_item.py` module does the processing of each item.
- `monsters`: The monster database builder that uses a collection of Python scripts to build the monster database. The `builder.py` script is the primary entry point, and the `build_monster.py` module does the processing of each monster. Additionally, the `drop_table.py` module contains a selection of hard-coded drop tables for the various OSRS Wiki drop table templates such as the rare, herb, seed, gem and catacombs drop tables.
- `data`: Collection of useful data files used in the osrsbox-db project.
- `cache`: OSRS client cache dump (not present in repository due to size, but populated using the `scripts/cache` scripts).
- `icons`: Item and prayer icons in base64.
- `items`: Data used for item database generation.
- `monsters`: Data used for monster database generation.
- `schemas`: JSON schemas for the item and monster database, as well as schemas for item, npc and object definitions from cache data.
- `wiki`: OSRS Wiki data dump including all item and monster page titles and page data.
- `docs`: The publicly accessible item database available through this repo or by using the static JSON API. This folder contains the actual item database that is publicly available, or browsable within this repository (see section above for more information).
- `osrsbox`: The Python PyPi package:
- `items_api`: The Python API for interacting with the items database. The API has modules to load all items in the database, iterate through items, and access the different item properties.
- `items_api_examples`: A collection of simple Python scripts that use the `items_api` to provide an example of what can be achieved and how to use the items database.
- `monsters_api`: The Python API for interacting with the monster database. The API has modules to load all monsters in the database, iterate through items, and access different monster properties.
- `monsters_api_examples`: A collection of simple Python scripts that use the `monsters_api` to provide an example of what can be achieved and how to use the monster's database.
- `scripts`: A collection of scripts (using Python and BASH) to help automate common tasks including dumping the OSRS cache, scraping the OSRS wiki, generating schemas, updating the databases, and inserting data into a MongoDB database.
- `cache`: A collection of scripts to extract useful data from the OSRS cache item, npc and object definition files.
- `icons`: Various scripts to help process, check or update item icons.
- `items`: A collection of scripts to help process data for the item builder.
- `monsters`: A collection of scripts to help process data for the monster builder.
- `update`: A collection of scripts for automating the data collection and database regeneration.
- `wiki`: A collection of scripts for automating data extraction from the OSRS Wiki using the MediaWiki API.
- `test`: A collection of PyTest tests.
### Item, Monster and Prayer Database Schemas
Technically, the `osrsbox-db` is not really a database - more specifically it should be called a data set. Anyway... the contents in the item/monster/prayer database need to adhere to a specified structure, as well as specified data types for each property. This is achieved (documented and tested) using the [Cerberus project](https://docs.python-cerberus.org/en/stable/). The Cerberus schema is useful to determine the properties that are available for each entity, and the types and requirements for each property, including:
- `type`: Specifies the data type (e.g., boolean, integer, string)
- `required`: If the property must be populated (true or false)
- `nullable`: If the property can be set to `null` or `None`
The Cerberus schemas are provided in a dedicated repository called [`osrsbox/schemas`](https://github.com/osrsbox/schemas), and implorted into this project as a submodule - this is because the schemas are used in other repositories and central management is required. The schemas are loaded into the `data/schemas` folder and includes:
1. [`schema-items.json`](https://github.com/osrsbox/schemas/blob/master/schema-items.json): This file defines the item schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
1. [`schema-monsters.json`](https://github.com/osrsbox/schemas/blob/master/schema-monsters.json): This file defines the monster schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
1. [`schema-prayers.json`](https://github.com/osrsbox/schemas/blob/master/schema-prayers.json): This file defines the prayer schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
All Cerberus schema files are authored using Cerberus version 1.3.2. This project uses the [`Cerberus` PyPi package](https://pypi.org/project/Cerberus/).
## The Item Database
Each item is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects. Additionally, the data is accessible directly by parsing the raw JSON files. There are three types of objects, or classifications of data, that can be used to represent part of an in-game OSRS item, each outlined in the following subsections.
### Item Properties
An `ItemProperties` object type includes basic item metadata such as `id`, `name`, `examine` text, store `cost`, `highalch` and `lowalch` values and `quest_item` association. Every item object in the item database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique OSRS item ID number. | True | False |
| name | string | The name of the item. | True | False |
| last_updated | string | The last time (UTC) the item was updated (in ISO8601 date format). | True | False |
| incomplete | boolean | If the item has incomplete wiki data. | True | False |
| members | boolean | If the item is a members-only. | True | False |
| tradeable | boolean | If the item is tradeable (between players and on the GE). | True | False |
| tradeable_on_ge | boolean | If the item is tradeable (only on GE). | True | False |
| stackable | boolean | If the item is stackable (in inventory). | True | False |
| stacked | integer | If the item is stacked, indicated by the stack count. | True | True |
| noted | boolean | If the item is noted. | True | False |
| noteable | boolean | If the item is noteable. | True | False |
| linked_id_item | integer | The linked ID of the actual item (if noted/placeholder). | True | True |
| linked_id_noted | integer | The linked ID of an item in noted form. | True | True |
| linked_id_placeholder | integer | The linked ID of an item in placeholder form. | True | True |
| placeholder | boolean | If the item is a placeholder. | True | False |
| equipable | boolean | If the item is equipable (based on right-click menu entry). | True | False |
| equipable_by_player | boolean | If the item is equipable in-game by a player. | True | False |
| equipable_weapon | boolean | If the item is an equipable weapon. | True | False |
| cost | integer | The store price of an item. | True | False |
| lowalch | integer | The low alchemy value of the item (cost * 0.4). | True | True |
| highalch | integer | The high alchemy value of the item (cost * 0.6). | True | True |
| weight | float | The weight (in kilograms) of the item. | True | True |
| buy_limit | integer | The Grand Exchange buy limit of the item. | True | True |
| quest_item | boolean | If the item is associated with a quest. | True | False |
| release_date | string | Date the item was released (in ISO8601 format). | True | True |
| duplicate | boolean | If the item is a duplicate. | True | False |
| examine | string | The examine text for the item. | True | True |
| icon | string | The item icon (in base64 encoding). | True | False |
| wiki_name | string | The OSRS Wiki name for the item. | True | True |
| wiki_url | string | The OSRS Wiki URL (possibly including anchor link). | True | True |
| equipment | dict | The equipment bonuses of equipable armour/weapons. | True | True |
| weapon | dict | The weapon bonuses including attack speed, type and stance. | True | True |
### Item Equipment
Many items in OSRS are equipable, this includes armor, weapons, and other _wearable_ items. Any equipable item has additional properties stored as an `ItemEquipment` object type - including attributes such as `attack_slash`, `defence_crush` and `melee_strength` values. The `ItemEquipment` object is nested within an `ItemProperties`. If you are parsing the raw JSON files, this data is nested under the `equipment` key. It is very important to note that not all items in OSRS are equipable. Only items with the `equipable_by_player` property set to `true` are equipable. The `equipable` property is similar, but this is the raw data extracted from the game cache - and can sometimes be incorrect (not equipable by a player). All of the properties available for equipable items are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| attack_stab | integer | The attack stab bonus of the item. | True | False |
| attack_slash | integer | The attack slash bonus of the item. | True | False |
| attack_crush | integer | The attack crush bonus of the item. | True | False |
| attack_magic | integer | The attack magic bonus of the item. | True | False |
| attack_ranged | integer | The attack ranged bonus of the item. | True | False |
| defence_stab | integer | The defence stab bonus of the item. | True | False |
| defence_slash | integer | The defence slash bonus of the item. | True | False |
| defence_crush | integer | The defence crush bonus of the item. | True | False |
| defence_magic | integer | The defence magic bonus of the item. | True | False |
| defence_ranged | integer | The defence ranged bonus of the item. | True | False |
| melee_strength | integer | The melee strength bonus of the item. | True | False |
| ranged_strength | integer | The ranged strength bonus of the item. | True | False |
| magic_damage | integer | The magic damage bonus of the item. | True | False |
| prayer | integer | The prayer bonus of the item. | True | False |
| slot | string | The equipment slot associated with the item (e.g., head). | True | False |
| requirements | dict | An object of requirements {skill: level}. | True | True |
### Item Weapon
A select number of items in OSRS are equipable weapons. Any equipable item that is a weapon has additional properties stored as an `ItemWeapon` type object including attributes such as `attack_speed` and `weapon_types` values. Additionally, each weapon has an array of combat stances associated with it to determine the `combat_style`, `attack_type`, `attack_style` and any `bonuses` or combat `experience` association. The `ItemWeapon` object is nested within an `ItemProperties` object when using the Python API. If you are parsing the raw JSON files, this data is nested under the `weapon` key. It is very important to note that not all items in OSRS are equipable weapons. Only items with the `equipable_weapon` property set to `true` are equipable. All of the properties available for equipable weapons are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| attack_speed | integer | The attack speed of a weapon (in game ticks). | True | False |
| weapon_type | string | The weapon classification (e.g., axes) | True | False |
| stances | list | An array of weapon stance information. | True | False |
### Item: Python Object Example
A description of the properties that each item in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of an item as loaded in a Python object, specifically the _Abyssal whip_ item. Since this item is a type of equipment, there is an `EquipmentProperties` object nested with combat bonuses. Additionally, this item is also a weapon, so there is a `WeaponProperties` object with extra information. If the item was not equipable, the `EquipmentProperties` property would be `None` and the `equipable_by_player` would be `False`. If the item was not a weapon, the `WeaponProperties` key would be `None` and the `equipable_weapon` would be `False`.
```
ItemProperties(
id=4151,
name='Abyssal whip',
last_updated='2020-12-27',
incomplete=False,
members=True,
tradeable=True,
tradeable_on_ge=True,
stackable=False,
stacked=None,
noted=False,
noteable=True,
linked_id_item=None,
linked_id_noted=4152,
linked_id_placeholder=14032,
placeholder=False,
equipable=True,
equipable_by_player=True,
equipable_weapon=True,
cost=120001,
lowalch=48000,
highalch=72000,
weight=0.453,
buy_limit=70,
quest_item=False,
release_date='2005-01-26',
duplicate=False,
examine='A weapon from the abyss.',
icon='iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAABvUlEQVR4Xu2Xv26DMBDG4QEyZECKIkVCKIoyVR26dOrQpUOHDn3/V3F7nL7689kGAo6z9JNuiH1wP+6PIU3zr2Jq3bRVkQ/Y7feBvfcn93o8upfDwT11XQKwOGQMwfYx9O7rcnaf52GEezuFgNdfn4JQ7RjAQojZLAAMcPJbAOH73PcloBTIQiEAG8MB7Pt6MQ+wSW1QAs6Kh1A/NgtnHyKMcZMUCP3AIBw0XcqmgU9qb4W0JwTIwuRAYHETF4FSIMkORjn1xCnjayy8lN/vLVY7TglfvBRGTJpZrpXM+my1f6DhPRdJs8M3nAPibGDseY9hVgHxzbh3chC22dkPQ8EnufddpBgI69Lk3B8hnPrwOsPEw7FYqUzoOsqBUtps8XUASh0bYbxZxUCcJZzCNnjOBGgDDBRD8d4tQAVgRAqEs2jusLOGEhaCgTQTgApLp/s5A0RBGMg3shx2YZb0fZUz9issD4VpsR4PkJ+uYbczJQr94rW7KT3yDJcegLtqeuRlAFa+0bdoeuTxPV2538Ixt1D86Vutr8IR16CSndzfoSpQLIDh09dmscL5lJICMUClw3JKD8tGXiVgfgACr1tEhnw7UAAAAABJRU5ErkJggg==',
wiki_name='Abyssal whip',
wiki_url='https://oldschool.runescape.wiki/w/Abyssal_whip',
equipment=ItemEquipment(
attack_stab=0,
attack_slash=82,
attack_crush=0,
attack_magic=0,
attack_ranged=0,
defence_stab=0,
defence_slash=0,
defence_crush=0,
defence_magic=0,
defence_ranged=0,
melee_strength=82,
ranged_strength=0,
magic_damage=0,
prayer=0,
slot='weapon',
requirements={'attack': 70}
),
weapon=ItemWeapon(
attack_speed=4,
weapon_type='whip',
stances=[
{
'combat_style': 'flick',
'attack_type': 'slash',
'attack_style': 'accurate',
'experience': 'attack',
'boosts': None
},
{
'combat_style': 'lash',
'attack_type': 'slash',
'attack_style': 'controlled',
'experience': 'shared',
'boosts': None},
{
'combat_style': 'deflect',
'attack_type': 'slash',
'attack_style': 'defensive',
'experience': 'defence',
'boosts': None
}
]
)
)
```
### Item: JSON Example
A description of the properties that each item in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of an item, specifically the _Abyssal whip_ item. Since this item is a type of equipment, there is an `equipment` key with combat bonuses. Additionally, this item is also a weapon, so there is a `weapon` key with extra information. If the item was not equipable, the `equipment` key would be `null` and the `equipable_by_player` would be `false`. If the item was not a weapon, the `weapon` key would be `null` and the `equipable_weapon` would be `false`.
```
{
"id": 4151,
"name": "Abyssal whip",
"last_updated": "2020-12-27",
"incomplete": false,
"members": true,
"tradeable": true,
"tradeable_on_ge": true,
"stackable": false,
"stacked": null,
"noted": false,
"noteable": true,
"linked_id_item": null,
"linked_id_noted": 4152,
"linked_id_placeholder": 14032,
"placeholder": false,
"equipable": true,
"equipable_by_player": true,
"equipable_weapon": true,
"cost": 120001,
"lowalch": 48000,
"highalch": 72000,
"weight": 0.453,
"buy_limit": 70,
"quest_item": false,
"release_date": "2005-01-26",
"duplicate": false,
"examine": "A weapon from the abyss.",
"icon": "iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAABvUlEQVR4Xu2Xv26DMBDG4QEyZECKIkVCKIoyVR26dOrQpUOHDn3/V3F7nL7689kGAo6z9JNuiH1wP+6PIU3zr2Jq3bRVkQ/Y7feBvfcn93o8upfDwT11XQKwOGQMwfYx9O7rcnaf52GEezuFgNdfn4JQ7RjAQojZLAAMcPJbAOH73PcloBTIQiEAG8MB7Pt6MQ+wSW1QAs6Kh1A/NgtnHyKMcZMUCP3AIBw0XcqmgU9qb4W0JwTIwuRAYHETF4FSIMkORjn1xCnjayy8lN/vLVY7TglfvBRGTJpZrpXM+my1f6DhPRdJs8M3nAPibGDseY9hVgHxzbh3chC22dkPQ8EnufddpBgI69Lk3B8hnPrwOsPEw7FYqUzoOsqBUtps8XUASh0bYbxZxUCcJZzCNnjOBGgDDBRD8d4tQAVgRAqEs2jusLOGEhaCgTQTgApLp/s5A0RBGMg3shx2YZb0fZUz9issD4VpsR4PkJ+uYbczJQr94rW7KT3yDJcegLtqeuRlAFa+0bdoeuTxPV2538Ixt1D86Vutr8IR16CSndzfoSpQLIDh09dmscL5lJICMUClw3JKD8tGXiVgfgACr1tEhnw7UAAAAABJRU5ErkJggg==",
"wiki_name": "Abyssal whip",
"wiki_url": "https://oldschool.runescape.wiki/w/Abyssal_whip",
"equipment": {
"attack_stab": 0,
"attack_slash": 82,
"attack_crush": 0,
"attack_magic": 0,
"attack_ranged": 0,
"defence_stab": 0,
"defence_slash": 0,
"defence_crush": 0,
"defence_magic": 0,
"defence_ranged": 0,
"melee_strength": 82,
"ranged_strength": 0,
"magic_damage": 0,
"prayer": 0,
"slot": "weapon",
"requirements": {
"attack": 70
}
},
"weapon": {
"attack_speed": 4,
"weapon_type": "whip",
"stances": [
{
"combat_style": "flick",
"attack_type": "slash",
"attack_style": "accurate",
"experience": "attack",
"boosts": null
},
{
"combat_style": "lash",
"attack_type": "slash",
"attack_style": "controlled",
"experience": "shared",
"boosts": null
},
{
"combat_style": "deflect",
"attack_type": "slash",
"attack_style": "defensive",
"experience": "defence",
"boosts": null
}
]
}
}
```
## The Monster Database
Each monster is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects. Additionally, the data is accessible directly by parsing the raw JSON files. There are two types of objects, or classifications of data, that can be used to represent part of an in-game OSRS monster, each outlined in the following subsections.
### Monster Properties
A `MonsterProperties` object type includes basic monster metadata such as `id`, `name`, `examine` text, `combat_level`, `attack_speed` and `hitpoints` values and slayer association such as `slayer_masters` who give this monster as a task. Every monster object in the monster database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique OSRS monster ID number. | True | False |
| name | string | The name of the monster. | True | False |
| last_updated | string | The last time (UTC) the monster was updated (in ISO8601 date format). | True | True |
| incomplete | boolean | If the monster has incomplete wiki data. | True | False |
| members | boolean | If the monster is members only, or not. | True | False |
| release_date | string | The release date of the monster (in ISO8601 date format). | True | True |
| combat_level | integer | The combat level of the monster. | True | False |
| size | integer | The size, in tiles, of the monster. | True | False |
| hitpoints | integer | The number of hitpoints a monster has. | True | True |
| max_hit | integer | The maximum hit of the monster. | True | True |
| attack_type | list | The attack style (e.g., melee, magic, range) of the monster. | True | False |
| attack_speed | integer | The attack speed (in game ticks) of the monster. | True | True |
| aggressive | boolean | If the monster is aggressive, or not. | True | False |
| poisonous | boolean | If the monster poisons, or not | True | False |
| venomous | boolean | If the monster poisons using venom, or not | True | False |
| immune_poison | boolean | If the monster is immune to poison, or not | True | False |
| immune_venom | boolean | If the monster is immune to venom, or not | True | False |
| attributes | list | An array of monster attributes. | True | False |
| category | list | An array of monster category. | True | False |
| slayer_monster | boolean | If the monster is a potential slayer task. | True | False |
| slayer_level | integer | The slayer level required to kill the monster. | True | True |
| slayer_xp | float | The slayer XP rewarded for a monster kill. | True | True |
| slayer_masters | list | The slayer masters who can assign the monster. | True | False |
| duplicate | boolean | If the monster is a duplicate. | True | False |
| examine | string | The examine text of the monster. | True | False |
| wiki_name | string | The OSRS Wiki name for the monster. | True | False |
| wiki_url | string | The OSRS Wiki URL (possibly including anchor link). | True | False |
| attack_level | integer | The attack level of the monster. | True | False |
| strength_level | integer | The strength level of the monster. | True | False |
| defence_level | integer | The defence level of the monster. | True | False |
| magic_level | integer | The magic level of the monster. | True | False |
| ranged_level | integer | The ranged level of the monster. | True | False |
| attack_bonus | integer | The attack bonus of the monster. | True | False |
| strength_bonus | integer | The strength bonus of the monster. | True | False |
| attack_magic | integer | The magic attack of the monster. | True | False |
| magic_bonus | integer | The magic bonus of the monster. | True | False |
| attack_ranged | integer | The ranged attack of the monster. | True | False |
| ranged_bonus | integer | The ranged bonus of the monster. | True | False |
| defence_stab | integer | The defence stab bonus of the monster. | True | False |
| defence_slash | integer | The defence slash bonus of the monster. | True | False |
| defence_crush | integer | The defence crush bonus of the monster. | True | False |
| defence_magic | integer | The defence magic bonus of the monster. | True | False |
| defence_ranged | integer | The defence ranged bonus of the monster. | True | False |
| drops | list | An array of monster drop objects. | True | False |
### Monster Drops
Most monsters in OSRS drop items when they have been defeated (killed). All monster drops are stored in the `drops` property in an array containing properties about the item drop. When using the PyPi `osrsbox` package, these drops are represented by a list of `MonsterDrops` object type. When parsing the raw JSON files, the drops are stored in an array, that are nested under the `drops` key. The data included with the monster drops are the item `id`, item `name`, the drop `rarity`, whether the drop is `noted` and any `drop_requirements`. All of the properties available for item drops are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | The ID number of the item drop. | True | False |
| name | string | The name of the item drop. | True | False |
| members | boolean | If the drop is a members-only item. | True | False |
| quantity | string | The quantity of the item drop (integer, comma-separated or range). | True | True |
| noted | boolean | If the item drop is noted, or not. | True | False |
| rarity | float | The rarity of the item drop (as a float out of 1.0). | True | False |
| rolls | integer | Number of rolls from the drop. | True | False |
### Monster: Python Object Example
A description of the properties that each monster in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a monster, specifically the _Abyssal demon_ monster. Please note that the number of item `drops` key data has been reduced to make the data more readable.
```
MonsterProperties(
id=415,
name='Abyssal demon',
last_updated='2020-12-25',
incomplete=False,
members=True,
release_date='2005-01-26',
combat_level=124,
size=1,
hitpoints=150,
max_hit=8,
attack_type=['stab'],
attack_speed=4,
aggressive=False,
poisonous=False,
venomous=False,
immune_poison=False,
immune_venom=False,
attributes=['demon'],
category=['abyssal demon'],
slayer_monster=True,
slayer_level=85,
slayer_xp=150.0,
slayer_masters=[
'vannaka',
'chaeldar',
'konar',
'nieve',
'duradel'
],
duplicate=False,
examine='A denizen of the Abyss!',
wiki_name='Abyssal demon (Standard)',
wiki_url='https://oldschool.runescape.wiki/w/Abyssal_demon#Standard',
attack_level=97,
strength_level=67,
defence_level=135,
magic_level=1,
ranged_level=1,
attack_bonus=0,
strength_bonus=0,
attack_magic=0,
magic_bonus=0,
attack_ranged=0,
ranged_bonus=0,
defence_stab=20,
defence_slash=20,
defence_crush=20,
defence_magic=0,
defence_ranged=20,
drops=
[
MonsterDrop(
id=592,
name='Ashes',
members=False,
quantity='1',
noted=False,
rarity=1.0,
rolls=1
),
...
MonsterDrop(
id=4151,
name='Abyssal whip',
members=True,
quantity='1',
noted=False,
rarity=0.001953125,
rolls=1
)
]
)
```
### Monster: JSON Example
A description of the properties that each monster in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a monster, specifically the _Abyssal demon_ monster. Please note that the number of item `drops` key data has been reduced to make the data more readable.
```
{
"id": 415,
"name": "Abyssal demon",
"last_updated": "2020-12-25",
"incomplete": false,
"members": true,
"release_date": "2005-01-26",
"combat_level": 124,
"size": 1,
"hitpoints": 150,
"max_hit": 8,
"attack_type": [
"stab"
],
"attack_speed": 4,
"aggressive": false,
"poisonous": false,
"venomous": false,
"immune_poison": false,
"immune_venom": false,
"attributes": [
"demon"
],
"category": [
"abyssal demon"
],
"slayer_monster": true,
"slayer_level": 85,
"slayer_xp": 150.0,
"slayer_masters": [
"vannaka",
"chaeldar",
"konar",
"nieve",
"duradel"
],
"duplicate": false,
"examine": "A denizen of the Abyss!",
"wiki_name": "Abyssal demon (Standard)",
"wiki_url": "https://oldschool.runescape.wiki/w/Abyssal_demon#Standard",
"attack_level": 97,
"strength_level": 67,
"defence_level": 135,
"magic_level": 1,
"ranged_level": 1,
"attack_bonus": 0,
"strength_bonus": 0,
"attack_magic": 0,
"magic_bonus": 0,
"attack_ranged": 0,
"ranged_bonus": 0,
"defence_stab": 20,
"defence_slash": 20,
"defence_crush": 20,
"defence_magic": 0,
"defence_ranged": 20,
"drops": [
{
"id": 1623,
"name": "Uncut sapphire",
"members": true,
"quantity": "1",
"noted": false,
"rarity": 0.009765625,
"rolls": 1
},
...
{
"id": 4151,
"name": "Abyssal whip",
"members": true,
"quantity": "1",
"noted": false,
"rarity": 0.001953125,
"rolls": 1
}
]
}
```
## The Prayer Database
Each prayer is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects Additionally, the data is accessible directly by parsing the raw JSON files. All prayer data is stored in a single object to represent the properties of an in-game OSRS prayer, which is outlined in the following subsection.
### Prayer Properties
A `PrayerProperties` object type includes basic prayer metadata such as `id`, `name`, `description` text, `drain_per_minute`, `requirements` and `bonuses` values. Every prayer object in the prayer database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique prayer ID number. | True | False |
| name | string | The name of the prayer. | True | False |
| members | boolean | If the prayer is members-only. | True | False |
| description | string | The prayer description (as show in-game). | True | False |
| drain_per_minute | float | The prayer point drain rate per minute. | True | False |
| wiki_url | string | The OSRS Wiki URL. | True | False |
| requirements | dict | The stat requirements to use the prayer. | True | False |
| bonuses | dict | The bonuses a prayer provides. | True | False |
| icon | string | The prayer icon. | True | False |
### Prayer: Python Object Example
A description of the properties that each prayer in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a prayer, specifically the _Rigour_ prayer, as loaded in the `osrsbox` PyPi Python package.
```
PrayerProperties(
id=28,
name='Rigour',
members=True,
description='Increases your Ranged attack by 20% and damage by 23%, and your defence by 25%.',
drain_per_minute=40.0,
wiki_url='https://oldschool.runescape.wiki/w/Rigour',
requirements={'prayer': 74, 'defence': 70},
bonuses={'ranged': 20, 'ranged_strength': 25, 'defence': 23},
icon='iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAABMklEQVR42rWW3Q0CIRCEjwJ8tgBrMPHZFmzAIny0gOvA+izAGjCYcMwNswucSrLJHT/7McvyM02bSojTfwo7Tv8h3h/PqKFfTSTEYqUuwTRQ9R8Erp0XdV79ANBWw7Y/7Mw2W7mhqDSGxTkC0vf5eqqg2I99CKAOVXZ0mY+Lw/SdgFjHk7DD3xE+hLZsINR2+BQMlXG7Gu8Cc2jyt4KketWWw22HWYTUWqcMsYzVcmIBMFQZqBSxmvl1+xj2Z7XdQByQHbKSDET1qNCB1uuHs1ZhY2NgQ2W9fpbCEaAT0jpLeZAKaQvmJI3OUs5QhHoZqoDuWcr7jDe4lURqL3bcIOsTxwJbxmvdcV0FeQPgPmydpZ3KJvcg904bVNi+GwegCPYgG2D1g6nXfvCu4cdRy9rlDXGzl98mKbMMAAAAAElFTkSuQmCC'
)
```
### Prayer: JSON Example
A description of the properties that each prayer in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a prayer, specifically the _Rigour_ prayer, as a JSON object.
```
"id": 28,
"name": "Rigour",
"members": true,
"description": "Increases your Ranged attack by 20% and damage by 23%, and your defence by 25%.",
"drain_per_minute": 40.0,
"wiki_url": "https://oldschool.runescape.wiki/w/Rigour",
"requirements": {
"prayer": 74,
"defence": 70
},
"bonuses": {
"ranged": 20,
"ranged_strength": 25,
"defence": 23
},
"icon": "iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAABMklEQVR42rWW3Q0CIRCEjwJ8tgBrMPHZFmzAIny0gOvA+izAGjCYcMwNswucSrLJHT/7McvyM02bSojTfwo7Tv8h3h/PqKFfTSTEYqUuwTRQ9R8Erp0XdV79ANBWw7Y/7Mw2W7mhqDSGxTkC0vf5eqqg2I99CKAOVXZ0mY+Lw/SdgFjHk7DD3xE+hLZsINR2+BQMlXG7Gu8Cc2jyt4KketWWw22HWYTUWqcMsYzVcmIBMFQZqBSxmvl1+xj2Z7XdQByQHbKSDET1qNCB1uuHs1ZhY2NgQ2W9fpbCEaAT0jpLeZAKaQvmJI3OUs5QhHoZqoDuWcr7jDe4lURqL3bcIOsTxwJbxmvdcV0FeQPgPmydpZ3KJvcg904bVNi+GwegCPYgG2D1g6nXfvCu4cdRy9rlDXGzl98mKbMMAAAAAElFTkSuQmCC"
}
```
## Project Contribution
This project would thoroughly benefit from contributions from additional developers. Please feel free to submit a pull request if you have code that you wish to contribute - I would thoroughly appreciate the helping hand. For any code contributions, the best method is to [open a new GitHub pull request](https://github.com/osrsbox/osrsbox-db/pulls) in the project repository. Also, feel free to contact me (e.g., on the Discord server) if you wish to discuss contribution before making a pull request. If you are not a software developer and want to contribute, even something as small as _Staring_ this repository really makes my day and keeps me motivated!
### Crowd Sourcing Item Skill Requirements
A really manual part of the item database is the `item.equipment.requirements` data. So far, I have manually populated this data... for over 3,500 items! To keep this project alive, I have stopped adding in this data (as it takes a lot of time). Here is a summary of how the item skill requirements work:
- All item requirements are stored in the [`skill-requirements.json`](https://github.com/osrsbox/osrsbox-db/blob/master/data/items/items-skill-requirements.json) file
- They have a structure of:
```
"item_id": {
"skill_name": integer
},
```
- For example, the Abyssal whip item:
```
"4151": {
"attack": 70
},
```
- For the `skill_name`, the [`schema-items.json`](https://github.com/osrsbox/schemas/blob/67b062b8d8499f80f43a95ff3b72cc40a6a833c9/schema-items.json#L293) file has a list of the allowed values - to help get the correct skill name. For example, `runecraft` and not `runecrafting`!
With some community help (by crowd sourcing) we could keep this data point fresh. If you find an error or want to add in a requirement, and want to contribute, here are the best ways to help:
- GitHub PR: Clone the project repo, make changes to `skill-requirements.json`, submit PR
- GitHub Issue: Submit an issue with the fix. It would really help me if you put the request in the correct JSON format as described above!
FYI - there is currently no quest-associated requirements. This would be a great addition to the project, but seems to be a very complex thing to add.
## Additional Project Information
This section contains additional information about the osrsbox-db project. For detailed information about the project see the [`osrsbox.com`](https://www.osrsbox.com/) website for the official project page, and the _Database_ tag to find blog posts about the project:
- https://www.osrsbox.com/projects/osrsbox-db/
- https://www.osrsbox.com/blog/tags/Database/
### Project Feedback
I would thoroughly appreciate any feedback regarding the osrsbox-db project, especially problems with the inaccuracies of the data provided. So if you notice any problem with the accuracy of item property data, could you please let me know. The same goes for any discovered bugs, or if you have a specific feature request. The best method is to [open a new Github issue](https://github.com/osrsbox/osrsbox-db/issues) in the project repository.
### Project License
The osrsbox-db project is released under the GNU General Public License version 3 as published by the Free Software Foundation. You can read the [LICENSE](LICENSE) file for the full license, check the [GNU GPL](https://www.gnu.org/licenses/gpl-3.0.en.html) page for additional information, or check the [tl;drLegal](https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)) documentation for the license explained in simple English. The GPL license is specified for all source code contained in this project. Other content is specified under GPL if not listed in the **Exceptions to GPL** below.
#### Exceptions to GPL
Old School RuneScape (OSRS) content and materials are trademarks and copyrights of JaGeX or its licensors. All rights reserved. OSRSBox and the osrsbox-db project is not associated or affiliated with JaGeX or its licensors.
Additional data to help build this project is sourced from the [OSRS Wiki](https://oldschool.runescape.wiki/). This primarily includes item and monster metadata that is not available in the OSRS cache. As specified by the [Weird Gloop Copyright](https://meta.weirdgloop.org/w/Meta:Copyrights) page, this content is licensed under CC BY-NC-SA 3.0 - [Attribution-NonCommercial-ShareAlike 3.0 Unported](https://creativecommons.org/licenses/by-nc-sa/3.0/) license.
### Project Attribution
The osrsbox-db project is a labor of love. I put a huge amount of time and effort into the project, and I want people to use it. That is the entire reason for its existence. I am not too fussed about attribution guidelines... but if you want to use the project please adhere to the licenses used. Please feel free to link to this repository or my [OSRSBox website](https://www.osrsbox.com/) if you use it in your project - mainly so others can find it, and hopefully use it too!
%package help
Summary: Development documents and examples for osrsbox
Provides: python3-osrsbox-doc
%description help
# osrsbox-db
 
[](https://badge.fury.io/py/osrsbox) 
[](https://discord.gg/HFynKyr)
[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9J44ADGJQ5BC6&source=url)
## A complete and up-to-date database of Old School Runescape (OSRS) items, monsters and prayers
This project hosts a complete and up-to-date database items, monsters and prayers in OSRS. **Complete** means it holds every single item, monster and prayer in OSRS. **Up-to-date** means this database is updated after every weekly game update to ensure accurate information.
The item database has extensive properties for each item: a total of 27 properties for every item, an additional 16 properties for equipable items, and an additional 3 properties for equipable weapons. These properties include the item ID and name, whether an item is tradeable, stackable, or equipable or if the item is members only. For any equipable item, there are additional properties about combat stats; for example, what slash attack bonus, magic defence bonus or prayer bonus that an item provides. For weapons, additional properties are added which include attack speed, combat stance and weapon type information.
The monster database also has extensive properties: a total of 44 unique properties for each monster, as well as an array of item drops for each monster that has 6 additional properties per item drop. The base properties include the monster ID, name, member status, slayer properties, attack type, max hit, attack types and all monster combat stats. Each monster also has an associated array of drops which document the item ID, name, rarity, quantity, and any requirements to get the drop.
The prayer database documents each prayer that available in-game and has detailed properties: a total of 8 properties for every prayer. The base properties include the prayer name, members status, description, requirements, and bonuses that it provides.
## Table of Contents
- [Project Summary](#project-summary)
- [The `osrsbox` Python PyPi Package](#the-osrsbox-python-pypi-package)
- [The osrsbox RESTful API](#the-osrsbox-restful-api)
- [The osrsbox Static JSON API](#the-osrsbox-static-json-api)
- [The `osrsbox-db` GitHub Repository](#the-osrsbox-db-github-repository)
- [The Item Database](#the-item-database)
- [The Monster Database](#the-monster-database)
- [The Prayer Database](#the-prayer-database)
- [Project Contribution](#project-contribution)
- [Additional Project Information](#additional-project-information)
## Project Summary
The osrsbox-db project provides data for three different categories:
1. **Items**
1. **Monsters**
1. **Prayers**
The osrsbox-db project and data is accessible using four methods:
1. [**The Python PyPi package**](https://pypi.org/project/osrsbox/)
1. [**The RESTful API**](https://github.com/osrsbox/osrsbox-api/)
1. [**The Static JSON API**](https://github.com/osrsbox/osrsbox-db/tree/master/docs)
1. [**The GitHub development repository**](https://github.com/osrsbox/osrsbox-db/)
With four different methods to access data... most people will have the following question: _Which one should I use?_ The following list is a short-sharp summary of the options:
1. [**The Python PyPi package**](https://pypi.org/project/osrsbox/): Use this if you are programming anything in Python - as it is the simplest option. Install using `pip`, and you are ready to do anything from experimenting and prototyping, to building a modern web app using something like Flask.
1. [**The RESTful API**](https://github.com/osrsbox/osrsbox-api/): Use this if you are not programming in Python, and want an Internet-accessible API with rich-quering including filtering, sorting and projection functionality.
1. [**The Static JSON API**](https://github.com/osrsbox/osrsbox-db/tree/master/docs): Use this if you want Internet-accessible raw data (JSON files and PNG images) and don't need queries to filter data. This is a good option if you want to _dump_ the entire database contents, and saves the RESTful API from un-needed traffic.
1. [**The GitHub development repository**](https://github.com/osrsbox/osrsbox-db/): The development repository provides the code and data to build the database. I would not recommend using the development repository unless you are (really) interested in the project or you want to contribute to the project.
## The `osrsbox` Python PyPi Package
If you want to access the item and monster database programmatically using Python, the simplest option is to use the [`osrsbox` package available from PyPi](https://pypi.org/project/osrsbox/). You can load the item and/or monster database and process item objects, monster objects, and their properties.
### Package Quick Start
- Make sure you have >= Python 3.6
- Install package using: `pip install osrsbox`
- Item database quick start:
- Import items API using: `from osrsbox import items_api`
- Load all items using: `items = items_api.load()`
- Loop items using: `for item in items: print(item.name)`
- Monster database quick start:
- Import monsters API using: `from osrsbox import monsters_api`
- Load all monsters using: `monsters = monsters_api.load()`
- Loop monsters using: `for monster in monsters: print(monster.name)`
- Prayer database quick start:
- Import prayers API using: `from osrsbox import prayers_api`
- Load all prayers using: `prayers = prayers_api.load()`
- Loop prayers using: `for prayer in prayers: print(prayer.name)`
### Package Requirements
For the `osrsbox` PyPi package you must meet the following requirements:
- Python 3.6 or above
- Pip package manager
- Dataclasses package (if Python is below 3.7)
If you are using Python 3.6, the `dataclasses` package will automatically be installed. If you are using Python 3.7 or above, the `dataclasses` package is part of the standard library and will not be installed automatically.
### Package Installation
The easiest way to install the osrsbox package is through the [Python Package Index](http://pypi.python.org/) using the `pip` command. You need to have `pip` installed - and make sure it is updated (especially on Windows). Then you can install the `osrsbox` package using the following `pip` command:
```
pip install osrsbox
```
### Package Upgrading
The package is consistently updated - usually after each weekly in-game update. This is because the in-game update usually introduces additional items into the game or changes existing items. Therefore, you should regularly check and update the `osrsbox` package. To achieve this, run `pip` with the `upgrade` flag, as demonstrated in the following command:
```
pip install --upgrade osrsbox
```
### Package Usage
The key use of the `osrsbox` package is to load and automate the processing of OSRS items and their associated metadata. You can load the package using `import osrsbox`, however, you probably want to load the `items_api` module or `monsters_api` module. A simple example of using the package to `load` all the items, then loop and print out the item ID and name of every item in OSRS is provided below:
```
phoil@gilenor ~ $ python3.6
Python 3.6.8 (default, Jan 14 2019, 11:02:34)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from osrsbox import items_api
>>> items = items_api.load()
>>> for item in items:
... print(item.id, item.name)
```
Instead of using the Python interpreter, you can also write a simple script and import the `osrsbox` Python package. An example script is provided below, this time for the `monsters_api`:
```
#!/usr/bin/python3
from osrsbox import monsters_api
monsters = monsters_api.load()
for monster in monsters:
print(monster.id, monster.name)
```
If you would like to review additional examples of using the `osrsbox` Python API, have a look at the [`items_api_examples` folder](https://github.com/osrsbox/osrsbox-db/tree/master/osrsbox/items_api_examples) and [`monsters_api_examples` folder](https://github.com/osrsbox/osrsbox-db/tree/master/osrsbox/monsters_api_examples). There are a number of scripts available that provide examples of loading and processing data using the Python API.
## The osrsbox RESTful API
The [official osrsbox-api GitHub repository](https://github.com/osrsbox/osrsbox-api) hosts the source code used for the RESTful API. The official `osrsbox-api` project is available from:
- [https://api.osrsbox.com](https://api.osrsbox.com)
The link provided above has an API landing page with detailed information on the project including a project summary, API endpoints, and links to useful documentation. Also, have a look at the [official `osrsbox-api` project README](https://github.com/osrsbox/osrsbox-api/blob/master/README.md) for more information. The README has a tutorial on how to build the API docker environment locally for testing purposes which might be useful.
## The `osrsbox` Static JSON API
This project also includes an Internet-accessible, static JSON API for all items/monsters in the database. The JSON API was originally written for the [`osrsbox-tooltips` project](https://github.com/osrsbox/osrsbox-tooltips) but has since been used for a variety of other projects. The JSON API is useful when you do not want to write a program in Python (as using the PyPi package is probably easier), but would like to fetch the database information programmatically over the Internet, and receive the data back in nicely structured JSON syntax. A key example is a web application.
### Static JSON API Files
The JSON API is available in the [`docs` folder](https://github.com/osrsbox/osrsbox-db/tree/master/docs/) in the osrsbox-db project repository. This folder contains the publicly available database. Every file inside this specific folder can be fetched using HTTP GET requests. The base URL for this folder is `https://www.osrsbox.com/osrsbox-db/`. Simply append any name of any file from the `docs` folder to the base URL, and you can fetch this data. A summary of the folders/files provided in the JSON API are listed below with descriptions:
- `items-complete.json`: A single JSON file that combines all single JSON files from `items-json` folder. This file contains the entire osrsbox-db items database in one file. This is useful if you want to get the data for every single item.
- `items-icons`: Collection of PNG files (20K+) for every item inventory icon in OSRS. Each inventory icon is named using the unique item ID number.
- `items-json`: Collection of JSON files (20K+) of extensive item metadata for every item in OSRS. This folder contains the entire osrsbox-db item database where each item has an individual JSON file, named using the unique item ID number. This is useful when you want to fetch data for a single item where you already know the item ID number.
- `items-json-slot`: Collection of JSON files extracted from the database that are specific for each equipment slot (e.g., head, legs). This is useful when you want to only get item data for equipable items for one, or multiple, specific item slot.
- `items-summary.json`: A single JSON file that contains only the item names and item ID numbers. This file is useful when you want to download a small file (1.1MB) to quickly scan/process item data when you only need the item name and/or ID number.
- `models-summary.json`: A single JSON file that contains model ID numbers for items, objects, and NPCs. This file is useful to determine the model ID number for a specific item, object or NPC.
- `monsters-complete.json`: A single JSON file that combines all single JSON files from the `monsters-json` folder. This file contains the entire osrsbox-db monster database in one file. This is useful if you want to get the data for every single monster in one file.
- `monsters-json`: Collection of JSON files (2.5K+) of extensive monster metadata for every monster in OSRS. This folder contains the entire osrsbox-db monster database where each monster has an individual JSON file, named using the unique monster ID number. This is useful when you want to fetch data for a single monster where you already know the item ID number.
- `npcs-summary.json`: A single JSON file that contains only the NPC names and NPC ID numbers. This file is useful when you want to download a small file (0.35MB) to quickly scan/process NPC data when you only need the NPC name and/or ID number. Note that this file contains both attackable, and non-attackable (monster) NPCs.
- `objects-summary.json`: A single JSON file that contains only the object names and object ID numbers. This file is useful when you want to download a small file (0.86MB) to quickly scan/process in-game object data when you only need the object name and/or ID number.
- `prayer-icon`: Collection of PNG files for each prayer in OSRS.
- `prayer-json`: Collection of individual JSON files with properties and metadata about OSRS prayers.
### Accessing the Static JSON API
The JSON file for each OSRS item can be directly accessed using unique URLs provide through the [`osrsbox.com`](https://www.osrsbox.com/osrsbox-db/) base URL. As mentioned, you can fetch JSON files using a unique URL, but cannot modify any JSON content. Below is a list of URL examples for items and monsters in the osrsbox-db database:
- [`https://www.osrsbox.com/osrsbox-db/items-json/2.json`](https://www.osrsbox.com/osrsbox-db/items-json/2.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/74.json`](https://www.osrsbox.com/osrsbox-db/items-json/74.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/35.json`](https://www.osrsbox.com/osrsbox-db/items-json/35.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/415.json`](https://www.osrsbox.com/osrsbox-db/items-json/415.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json/239.json`](https://www.osrsbox.com/osrsbox-db/items-json/239.json)
As displayed by the links above, each item or monster is stored in the `osrsbox-db` repository, under the [`items-json`](https://github.com/osrsbox/osrsbox-db/tree/master/docs/items-json) folder or [`monsters-json`](https://github.com/osrsbox/osrsbox-db/tree/master/docs/monsters-json) folder. In addition to the single JSON files for each item, many other JSON files can be fetched. Some more examples are provided below:
- [`https://www.osrsbox.com/osrsbox-db/items-complete.json`](https://www.osrsbox.com/osrsbox-db/items-complete.json)
- [`https://www.osrsbox.com/osrsbox-db/monsters-complete.json`](https://www.osrsbox.com/osrsbox-db/monsters-complete.json)
- [`https://www.osrsbox.com/osrsbox-db/items-summary.json`](https://www.osrsbox.com/osrsbox-db/items-summary.json)
- [`https://www.osrsbox.com/osrsbox-db/items-json-slot/items-cape.json`](https://www.osrsbox.com/osrsbox-db/items-json-slot/items-cape.json)
- [`https://www.osrsbox.com/osrsbox-db/prayer-json/protect-from-magic.json`](https://www.osrsbox.com/osrsbox-db/prayer-json/protect-from-magic.json)
So how can you get and use these JSON files about OSRS items? It is pretty easy but depends on what you are trying to accomplish and what programming language you are using. Some examples are provided in the following subsections.
### Accessing the JSON API using Command Line Tools
Take a simple example of downloading a single JSON file. In a Linux system, we could use the `wget` command to download a single JSON file, as illustrated in the example code below:
```
wget https://www.osrsbox.com/osrsbox-db/items-json/12453.json
```
You could perform a similar technique using the `curl` tool:
```
curl https://www.osrsbox.com/osrsbox-db/items-json/12453.json
```
For Windows users, you could use PowerShell:
```
Invoke-WebRequest -Uri "https://www.osrsbox.com/osrsbox-db/items-json/12453.json" -OutFile "12453.json"
```
### Accessing the JSON API using Python
Maybe you are interested in downloading a single (or potentially multiple) JSON files about OSRS items and processing the information in a Python program. The short script below downloads the `12453.json` file using Python's `urllib` library, loads the data as a JSON object and prints the contents to the console. The code is a little messy, primarily due to supporting both Python 2 and 3 - as you can see from the `try` and `except` importing method implemented.
```
import json
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
url = ("https://www.osrsbox.com/osrsbox-db/items-json/12453.json")
response = urlopen(url)
data = response.read().decode("utf-8")
json_obj = json.loads(data)
print(json_obj)
```
### Accessing the JSON API using JavaScript
Finally, let's have a look at JavaScript (specifically jQuery) example to fetch a JSON file from the osrsbox-db and build an HTML element to display in a web page. The example below is a very simple method to download the JSON file using the jQuery `getJSON` function. Once we get the JSON file, we loop through the JSON entries and print each key and value (e.g., `name` and _Black wizard hat (g)_) on its own line in a `div` element.
```
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.getJSON("https://www.osrsbox.com/osrsbox-db/items-json/12453.json", function(result){
$.each(result, function(i, field){
$("div").append(i + " " + field + "<br>");
});
});
});
});
</script>
</head>
<body>
<button>Get JSON data</button>
<div></div>
</body>
</html>
```
## The `osrsbox-db` GitHub Repository
The [official osrsbox-db GitHub repository](https://github.com/osrsbox/osrsbox-db) hosts the source code for the entire osrsbox-db project. The Python PyPi package is located in the `osrsbox` folder of the official development repository, while the other folders in this repository are used to store essential data and Python modules to build the item database.
### Using the Development Repository
If using this repository (the development version), you will need to fulfill some specific requirements. This includes having the following tools available on your system:
- Python 3.6 or above
- Pip - the standard package manager for Python
- A selection of additional Python packages
As a short example, I configured my Ubuntu 18.04 system to run the development repository code using the following steps:
```
sudo apt update
sudo apt install python3-pip
```
These two commands will install the `pip3` command, allowing the installation of Python packages. Then you can use `pip3` to install additional packages. The development repository requires a variety of Python packages in addition to the mandatory `dataclasses` package. These package requirements are documented in the [`requirements.txt`](https://github.com/osrsbox/osrsbox-db/tree/master/requirements.txt) file. It is recommended to use the `venv` module to set up your environment, then install the specified requirements. As an example, the following workflow is provided for Linux-based environments (make sure `python3` is available first):
```
git clone --recursive https://github.com/osrsbox/osrsbox-db.git
cd osrsbox-db
python -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
```
When you have finished with working in the `osrsbox-db` repository, make sure to deactivate the current `venv` environment using:
```
deactivate
```
### Summary of Repository Structure
- `builders`: The builders are the code that performs automatic regeneration of the databases. These builders read in a variety of data and produce a JSON file for each item or monster.
- `items`: The item database builder that uses a collection of Python scripts to build the item database. The `builder.py` script is the primary entry point, and the `build_item.py` module does the processing of each item.
- `monsters`: The monster database builder that uses a collection of Python scripts to build the monster database. The `builder.py` script is the primary entry point, and the `build_monster.py` module does the processing of each monster. Additionally, the `drop_table.py` module contains a selection of hard-coded drop tables for the various OSRS Wiki drop table templates such as the rare, herb, seed, gem and catacombs drop tables.
- `data`: Collection of useful data files used in the osrsbox-db project.
- `cache`: OSRS client cache dump (not present in repository due to size, but populated using the `scripts/cache` scripts).
- `icons`: Item and prayer icons in base64.
- `items`: Data used for item database generation.
- `monsters`: Data used for monster database generation.
- `schemas`: JSON schemas for the item and monster database, as well as schemas for item, npc and object definitions from cache data.
- `wiki`: OSRS Wiki data dump including all item and monster page titles and page data.
- `docs`: The publicly accessible item database available through this repo or by using the static JSON API. This folder contains the actual item database that is publicly available, or browsable within this repository (see section above for more information).
- `osrsbox`: The Python PyPi package:
- `items_api`: The Python API for interacting with the items database. The API has modules to load all items in the database, iterate through items, and access the different item properties.
- `items_api_examples`: A collection of simple Python scripts that use the `items_api` to provide an example of what can be achieved and how to use the items database.
- `monsters_api`: The Python API for interacting with the monster database. The API has modules to load all monsters in the database, iterate through items, and access different monster properties.
- `monsters_api_examples`: A collection of simple Python scripts that use the `monsters_api` to provide an example of what can be achieved and how to use the monster's database.
- `scripts`: A collection of scripts (using Python and BASH) to help automate common tasks including dumping the OSRS cache, scraping the OSRS wiki, generating schemas, updating the databases, and inserting data into a MongoDB database.
- `cache`: A collection of scripts to extract useful data from the OSRS cache item, npc and object definition files.
- `icons`: Various scripts to help process, check or update item icons.
- `items`: A collection of scripts to help process data for the item builder.
- `monsters`: A collection of scripts to help process data for the monster builder.
- `update`: A collection of scripts for automating the data collection and database regeneration.
- `wiki`: A collection of scripts for automating data extraction from the OSRS Wiki using the MediaWiki API.
- `test`: A collection of PyTest tests.
### Item, Monster and Prayer Database Schemas
Technically, the `osrsbox-db` is not really a database - more specifically it should be called a data set. Anyway... the contents in the item/monster/prayer database need to adhere to a specified structure, as well as specified data types for each property. This is achieved (documented and tested) using the [Cerberus project](https://docs.python-cerberus.org/en/stable/). The Cerberus schema is useful to determine the properties that are available for each entity, and the types and requirements for each property, including:
- `type`: Specifies the data type (e.g., boolean, integer, string)
- `required`: If the property must be populated (true or false)
- `nullable`: If the property can be set to `null` or `None`
The Cerberus schemas are provided in a dedicated repository called [`osrsbox/schemas`](https://github.com/osrsbox/schemas), and implorted into this project as a submodule - this is because the schemas are used in other repositories and central management is required. The schemas are loaded into the `data/schemas` folder and includes:
1. [`schema-items.json`](https://github.com/osrsbox/schemas/blob/master/schema-items.json): This file defines the item schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
1. [`schema-monsters.json`](https://github.com/osrsbox/schemas/blob/master/schema-monsters.json): This file defines the monster schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
1. [`schema-prayers.json`](https://github.com/osrsbox/schemas/blob/master/schema-prayers.json): This file defines the prayer schema, the defined properties, the property types, and some additional specifications including regex validation, and/or property type specification.
All Cerberus schema files are authored using Cerberus version 1.3.2. This project uses the [`Cerberus` PyPi package](https://pypi.org/project/Cerberus/).
## The Item Database
Each item is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects. Additionally, the data is accessible directly by parsing the raw JSON files. There are three types of objects, or classifications of data, that can be used to represent part of an in-game OSRS item, each outlined in the following subsections.
### Item Properties
An `ItemProperties` object type includes basic item metadata such as `id`, `name`, `examine` text, store `cost`, `highalch` and `lowalch` values and `quest_item` association. Every item object in the item database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique OSRS item ID number. | True | False |
| name | string | The name of the item. | True | False |
| last_updated | string | The last time (UTC) the item was updated (in ISO8601 date format). | True | False |
| incomplete | boolean | If the item has incomplete wiki data. | True | False |
| members | boolean | If the item is a members-only. | True | False |
| tradeable | boolean | If the item is tradeable (between players and on the GE). | True | False |
| tradeable_on_ge | boolean | If the item is tradeable (only on GE). | True | False |
| stackable | boolean | If the item is stackable (in inventory). | True | False |
| stacked | integer | If the item is stacked, indicated by the stack count. | True | True |
| noted | boolean | If the item is noted. | True | False |
| noteable | boolean | If the item is noteable. | True | False |
| linked_id_item | integer | The linked ID of the actual item (if noted/placeholder). | True | True |
| linked_id_noted | integer | The linked ID of an item in noted form. | True | True |
| linked_id_placeholder | integer | The linked ID of an item in placeholder form. | True | True |
| placeholder | boolean | If the item is a placeholder. | True | False |
| equipable | boolean | If the item is equipable (based on right-click menu entry). | True | False |
| equipable_by_player | boolean | If the item is equipable in-game by a player. | True | False |
| equipable_weapon | boolean | If the item is an equipable weapon. | True | False |
| cost | integer | The store price of an item. | True | False |
| lowalch | integer | The low alchemy value of the item (cost * 0.4). | True | True |
| highalch | integer | The high alchemy value of the item (cost * 0.6). | True | True |
| weight | float | The weight (in kilograms) of the item. | True | True |
| buy_limit | integer | The Grand Exchange buy limit of the item. | True | True |
| quest_item | boolean | If the item is associated with a quest. | True | False |
| release_date | string | Date the item was released (in ISO8601 format). | True | True |
| duplicate | boolean | If the item is a duplicate. | True | False |
| examine | string | The examine text for the item. | True | True |
| icon | string | The item icon (in base64 encoding). | True | False |
| wiki_name | string | The OSRS Wiki name for the item. | True | True |
| wiki_url | string | The OSRS Wiki URL (possibly including anchor link). | True | True |
| equipment | dict | The equipment bonuses of equipable armour/weapons. | True | True |
| weapon | dict | The weapon bonuses including attack speed, type and stance. | True | True |
### Item Equipment
Many items in OSRS are equipable, this includes armor, weapons, and other _wearable_ items. Any equipable item has additional properties stored as an `ItemEquipment` object type - including attributes such as `attack_slash`, `defence_crush` and `melee_strength` values. The `ItemEquipment` object is nested within an `ItemProperties`. If you are parsing the raw JSON files, this data is nested under the `equipment` key. It is very important to note that not all items in OSRS are equipable. Only items with the `equipable_by_player` property set to `true` are equipable. The `equipable` property is similar, but this is the raw data extracted from the game cache - and can sometimes be incorrect (not equipable by a player). All of the properties available for equipable items are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| attack_stab | integer | The attack stab bonus of the item. | True | False |
| attack_slash | integer | The attack slash bonus of the item. | True | False |
| attack_crush | integer | The attack crush bonus of the item. | True | False |
| attack_magic | integer | The attack magic bonus of the item. | True | False |
| attack_ranged | integer | The attack ranged bonus of the item. | True | False |
| defence_stab | integer | The defence stab bonus of the item. | True | False |
| defence_slash | integer | The defence slash bonus of the item. | True | False |
| defence_crush | integer | The defence crush bonus of the item. | True | False |
| defence_magic | integer | The defence magic bonus of the item. | True | False |
| defence_ranged | integer | The defence ranged bonus of the item. | True | False |
| melee_strength | integer | The melee strength bonus of the item. | True | False |
| ranged_strength | integer | The ranged strength bonus of the item. | True | False |
| magic_damage | integer | The magic damage bonus of the item. | True | False |
| prayer | integer | The prayer bonus of the item. | True | False |
| slot | string | The equipment slot associated with the item (e.g., head). | True | False |
| requirements | dict | An object of requirements {skill: level}. | True | True |
### Item Weapon
A select number of items in OSRS are equipable weapons. Any equipable item that is a weapon has additional properties stored as an `ItemWeapon` type object including attributes such as `attack_speed` and `weapon_types` values. Additionally, each weapon has an array of combat stances associated with it to determine the `combat_style`, `attack_type`, `attack_style` and any `bonuses` or combat `experience` association. The `ItemWeapon` object is nested within an `ItemProperties` object when using the Python API. If you are parsing the raw JSON files, this data is nested under the `weapon` key. It is very important to note that not all items in OSRS are equipable weapons. Only items with the `equipable_weapon` property set to `true` are equipable. All of the properties available for equipable weapons are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| attack_speed | integer | The attack speed of a weapon (in game ticks). | True | False |
| weapon_type | string | The weapon classification (e.g., axes) | True | False |
| stances | list | An array of weapon stance information. | True | False |
### Item: Python Object Example
A description of the properties that each item in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of an item as loaded in a Python object, specifically the _Abyssal whip_ item. Since this item is a type of equipment, there is an `EquipmentProperties` object nested with combat bonuses. Additionally, this item is also a weapon, so there is a `WeaponProperties` object with extra information. If the item was not equipable, the `EquipmentProperties` property would be `None` and the `equipable_by_player` would be `False`. If the item was not a weapon, the `WeaponProperties` key would be `None` and the `equipable_weapon` would be `False`.
```
ItemProperties(
id=4151,
name='Abyssal whip',
last_updated='2020-12-27',
incomplete=False,
members=True,
tradeable=True,
tradeable_on_ge=True,
stackable=False,
stacked=None,
noted=False,
noteable=True,
linked_id_item=None,
linked_id_noted=4152,
linked_id_placeholder=14032,
placeholder=False,
equipable=True,
equipable_by_player=True,
equipable_weapon=True,
cost=120001,
lowalch=48000,
highalch=72000,
weight=0.453,
buy_limit=70,
quest_item=False,
release_date='2005-01-26',
duplicate=False,
examine='A weapon from the abyss.',
icon='iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAABvUlEQVR4Xu2Xv26DMBDG4QEyZECKIkVCKIoyVR26dOrQpUOHDn3/V3F7nL7689kGAo6z9JNuiH1wP+6PIU3zr2Jq3bRVkQ/Y7feBvfcn93o8upfDwT11XQKwOGQMwfYx9O7rcnaf52GEezuFgNdfn4JQ7RjAQojZLAAMcPJbAOH73PcloBTIQiEAG8MB7Pt6MQ+wSW1QAs6Kh1A/NgtnHyKMcZMUCP3AIBw0XcqmgU9qb4W0JwTIwuRAYHETF4FSIMkORjn1xCnjayy8lN/vLVY7TglfvBRGTJpZrpXM+my1f6DhPRdJs8M3nAPibGDseY9hVgHxzbh3chC22dkPQ8EnufddpBgI69Lk3B8hnPrwOsPEw7FYqUzoOsqBUtps8XUASh0bYbxZxUCcJZzCNnjOBGgDDBRD8d4tQAVgRAqEs2jusLOGEhaCgTQTgApLp/s5A0RBGMg3shx2YZb0fZUz9issD4VpsR4PkJ+uYbczJQr94rW7KT3yDJcegLtqeuRlAFa+0bdoeuTxPV2538Ixt1D86Vutr8IR16CSndzfoSpQLIDh09dmscL5lJICMUClw3JKD8tGXiVgfgACr1tEhnw7UAAAAABJRU5ErkJggg==',
wiki_name='Abyssal whip',
wiki_url='https://oldschool.runescape.wiki/w/Abyssal_whip',
equipment=ItemEquipment(
attack_stab=0,
attack_slash=82,
attack_crush=0,
attack_magic=0,
attack_ranged=0,
defence_stab=0,
defence_slash=0,
defence_crush=0,
defence_magic=0,
defence_ranged=0,
melee_strength=82,
ranged_strength=0,
magic_damage=0,
prayer=0,
slot='weapon',
requirements={'attack': 70}
),
weapon=ItemWeapon(
attack_speed=4,
weapon_type='whip',
stances=[
{
'combat_style': 'flick',
'attack_type': 'slash',
'attack_style': 'accurate',
'experience': 'attack',
'boosts': None
},
{
'combat_style': 'lash',
'attack_type': 'slash',
'attack_style': 'controlled',
'experience': 'shared',
'boosts': None},
{
'combat_style': 'deflect',
'attack_type': 'slash',
'attack_style': 'defensive',
'experience': 'defence',
'boosts': None
}
]
)
)
```
### Item: JSON Example
A description of the properties that each item in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of an item, specifically the _Abyssal whip_ item. Since this item is a type of equipment, there is an `equipment` key with combat bonuses. Additionally, this item is also a weapon, so there is a `weapon` key with extra information. If the item was not equipable, the `equipment` key would be `null` and the `equipable_by_player` would be `false`. If the item was not a weapon, the `weapon` key would be `null` and the `equipable_weapon` would be `false`.
```
{
"id": 4151,
"name": "Abyssal whip",
"last_updated": "2020-12-27",
"incomplete": false,
"members": true,
"tradeable": true,
"tradeable_on_ge": true,
"stackable": false,
"stacked": null,
"noted": false,
"noteable": true,
"linked_id_item": null,
"linked_id_noted": 4152,
"linked_id_placeholder": 14032,
"placeholder": false,
"equipable": true,
"equipable_by_player": true,
"equipable_weapon": true,
"cost": 120001,
"lowalch": 48000,
"highalch": 72000,
"weight": 0.453,
"buy_limit": 70,
"quest_item": false,
"release_date": "2005-01-26",
"duplicate": false,
"examine": "A weapon from the abyss.",
"icon": "iVBORw0KGgoAAAANSUhEUgAAACQAAAAgCAYAAAB6kdqOAAABvUlEQVR4Xu2Xv26DMBDG4QEyZECKIkVCKIoyVR26dOrQpUOHDn3/V3F7nL7689kGAo6z9JNuiH1wP+6PIU3zr2Jq3bRVkQ/Y7feBvfcn93o8upfDwT11XQKwOGQMwfYx9O7rcnaf52GEezuFgNdfn4JQ7RjAQojZLAAMcPJbAOH73PcloBTIQiEAG8MB7Pt6MQ+wSW1QAs6Kh1A/NgtnHyKMcZMUCP3AIBw0XcqmgU9qb4W0JwTIwuRAYHETF4FSIMkORjn1xCnjayy8lN/vLVY7TglfvBRGTJpZrpXM+my1f6DhPRdJs8M3nAPibGDseY9hVgHxzbh3chC22dkPQ8EnufddpBgI69Lk3B8hnPrwOsPEw7FYqUzoOsqBUtps8XUASh0bYbxZxUCcJZzCNnjOBGgDDBRD8d4tQAVgRAqEs2jusLOGEhaCgTQTgApLp/s5A0RBGMg3shx2YZb0fZUz9issD4VpsR4PkJ+uYbczJQr94rW7KT3yDJcegLtqeuRlAFa+0bdoeuTxPV2538Ixt1D86Vutr8IR16CSndzfoSpQLIDh09dmscL5lJICMUClw3JKD8tGXiVgfgACr1tEhnw7UAAAAABJRU5ErkJggg==",
"wiki_name": "Abyssal whip",
"wiki_url": "https://oldschool.runescape.wiki/w/Abyssal_whip",
"equipment": {
"attack_stab": 0,
"attack_slash": 82,
"attack_crush": 0,
"attack_magic": 0,
"attack_ranged": 0,
"defence_stab": 0,
"defence_slash": 0,
"defence_crush": 0,
"defence_magic": 0,
"defence_ranged": 0,
"melee_strength": 82,
"ranged_strength": 0,
"magic_damage": 0,
"prayer": 0,
"slot": "weapon",
"requirements": {
"attack": 70
}
},
"weapon": {
"attack_speed": 4,
"weapon_type": "whip",
"stances": [
{
"combat_style": "flick",
"attack_type": "slash",
"attack_style": "accurate",
"experience": "attack",
"boosts": null
},
{
"combat_style": "lash",
"attack_type": "slash",
"attack_style": "controlled",
"experience": "shared",
"boosts": null
},
{
"combat_style": "deflect",
"attack_type": "slash",
"attack_style": "defensive",
"experience": "defence",
"boosts": null
}
]
}
}
```
## The Monster Database
Each monster is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects. Additionally, the data is accessible directly by parsing the raw JSON files. There are two types of objects, or classifications of data, that can be used to represent part of an in-game OSRS monster, each outlined in the following subsections.
### Monster Properties
A `MonsterProperties` object type includes basic monster metadata such as `id`, `name`, `examine` text, `combat_level`, `attack_speed` and `hitpoints` values and slayer association such as `slayer_masters` who give this monster as a task. Every monster object in the monster database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique OSRS monster ID number. | True | False |
| name | string | The name of the monster. | True | False |
| last_updated | string | The last time (UTC) the monster was updated (in ISO8601 date format). | True | True |
| incomplete | boolean | If the monster has incomplete wiki data. | True | False |
| members | boolean | If the monster is members only, or not. | True | False |
| release_date | string | The release date of the monster (in ISO8601 date format). | True | True |
| combat_level | integer | The combat level of the monster. | True | False |
| size | integer | The size, in tiles, of the monster. | True | False |
| hitpoints | integer | The number of hitpoints a monster has. | True | True |
| max_hit | integer | The maximum hit of the monster. | True | True |
| attack_type | list | The attack style (e.g., melee, magic, range) of the monster. | True | False |
| attack_speed | integer | The attack speed (in game ticks) of the monster. | True | True |
| aggressive | boolean | If the monster is aggressive, or not. | True | False |
| poisonous | boolean | If the monster poisons, or not | True | False |
| venomous | boolean | If the monster poisons using venom, or not | True | False |
| immune_poison | boolean | If the monster is immune to poison, or not | True | False |
| immune_venom | boolean | If the monster is immune to venom, or not | True | False |
| attributes | list | An array of monster attributes. | True | False |
| category | list | An array of monster category. | True | False |
| slayer_monster | boolean | If the monster is a potential slayer task. | True | False |
| slayer_level | integer | The slayer level required to kill the monster. | True | True |
| slayer_xp | float | The slayer XP rewarded for a monster kill. | True | True |
| slayer_masters | list | The slayer masters who can assign the monster. | True | False |
| duplicate | boolean | If the monster is a duplicate. | True | False |
| examine | string | The examine text of the monster. | True | False |
| wiki_name | string | The OSRS Wiki name for the monster. | True | False |
| wiki_url | string | The OSRS Wiki URL (possibly including anchor link). | True | False |
| attack_level | integer | The attack level of the monster. | True | False |
| strength_level | integer | The strength level of the monster. | True | False |
| defence_level | integer | The defence level of the monster. | True | False |
| magic_level | integer | The magic level of the monster. | True | False |
| ranged_level | integer | The ranged level of the monster. | True | False |
| attack_bonus | integer | The attack bonus of the monster. | True | False |
| strength_bonus | integer | The strength bonus of the monster. | True | False |
| attack_magic | integer | The magic attack of the monster. | True | False |
| magic_bonus | integer | The magic bonus of the monster. | True | False |
| attack_ranged | integer | The ranged attack of the monster. | True | False |
| ranged_bonus | integer | The ranged bonus of the monster. | True | False |
| defence_stab | integer | The defence stab bonus of the monster. | True | False |
| defence_slash | integer | The defence slash bonus of the monster. | True | False |
| defence_crush | integer | The defence crush bonus of the monster. | True | False |
| defence_magic | integer | The defence magic bonus of the monster. | True | False |
| defence_ranged | integer | The defence ranged bonus of the monster. | True | False |
| drops | list | An array of monster drop objects. | True | False |
### Monster Drops
Most monsters in OSRS drop items when they have been defeated (killed). All monster drops are stored in the `drops` property in an array containing properties about the item drop. When using the PyPi `osrsbox` package, these drops are represented by a list of `MonsterDrops` object type. When parsing the raw JSON files, the drops are stored in an array, that are nested under the `drops` key. The data included with the monster drops are the item `id`, item `name`, the drop `rarity`, whether the drop is `noted` and any `drop_requirements`. All of the properties available for item drops are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | The ID number of the item drop. | True | False |
| name | string | The name of the item drop. | True | False |
| members | boolean | If the drop is a members-only item. | True | False |
| quantity | string | The quantity of the item drop (integer, comma-separated or range). | True | True |
| noted | boolean | If the item drop is noted, or not. | True | False |
| rarity | float | The rarity of the item drop (as a float out of 1.0). | True | False |
| rolls | integer | Number of rolls from the drop. | True | False |
### Monster: Python Object Example
A description of the properties that each monster in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a monster, specifically the _Abyssal demon_ monster. Please note that the number of item `drops` key data has been reduced to make the data more readable.
```
MonsterProperties(
id=415,
name='Abyssal demon',
last_updated='2020-12-25',
incomplete=False,
members=True,
release_date='2005-01-26',
combat_level=124,
size=1,
hitpoints=150,
max_hit=8,
attack_type=['stab'],
attack_speed=4,
aggressive=False,
poisonous=False,
venomous=False,
immune_poison=False,
immune_venom=False,
attributes=['demon'],
category=['abyssal demon'],
slayer_monster=True,
slayer_level=85,
slayer_xp=150.0,
slayer_masters=[
'vannaka',
'chaeldar',
'konar',
'nieve',
'duradel'
],
duplicate=False,
examine='A denizen of the Abyss!',
wiki_name='Abyssal demon (Standard)',
wiki_url='https://oldschool.runescape.wiki/w/Abyssal_demon#Standard',
attack_level=97,
strength_level=67,
defence_level=135,
magic_level=1,
ranged_level=1,
attack_bonus=0,
strength_bonus=0,
attack_magic=0,
magic_bonus=0,
attack_ranged=0,
ranged_bonus=0,
defence_stab=20,
defence_slash=20,
defence_crush=20,
defence_magic=0,
defence_ranged=20,
drops=
[
MonsterDrop(
id=592,
name='Ashes',
members=False,
quantity='1',
noted=False,
rarity=1.0,
rolls=1
),
...
MonsterDrop(
id=4151,
name='Abyssal whip',
members=True,
quantity='1',
noted=False,
rarity=0.001953125,
rolls=1
)
]
)
```
### Monster: JSON Example
A description of the properties that each monster in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a monster, specifically the _Abyssal demon_ monster. Please note that the number of item `drops` key data has been reduced to make the data more readable.
```
{
"id": 415,
"name": "Abyssal demon",
"last_updated": "2020-12-25",
"incomplete": false,
"members": true,
"release_date": "2005-01-26",
"combat_level": 124,
"size": 1,
"hitpoints": 150,
"max_hit": 8,
"attack_type": [
"stab"
],
"attack_speed": 4,
"aggressive": false,
"poisonous": false,
"venomous": false,
"immune_poison": false,
"immune_venom": false,
"attributes": [
"demon"
],
"category": [
"abyssal demon"
],
"slayer_monster": true,
"slayer_level": 85,
"slayer_xp": 150.0,
"slayer_masters": [
"vannaka",
"chaeldar",
"konar",
"nieve",
"duradel"
],
"duplicate": false,
"examine": "A denizen of the Abyss!",
"wiki_name": "Abyssal demon (Standard)",
"wiki_url": "https://oldschool.runescape.wiki/w/Abyssal_demon#Standard",
"attack_level": 97,
"strength_level": 67,
"defence_level": 135,
"magic_level": 1,
"ranged_level": 1,
"attack_bonus": 0,
"strength_bonus": 0,
"attack_magic": 0,
"magic_bonus": 0,
"attack_ranged": 0,
"ranged_bonus": 0,
"defence_stab": 20,
"defence_slash": 20,
"defence_crush": 20,
"defence_magic": 0,
"defence_ranged": 20,
"drops": [
{
"id": 1623,
"name": "Uncut sapphire",
"members": true,
"quantity": "1",
"noted": false,
"rarity": 0.009765625,
"rolls": 1
},
...
{
"id": 4151,
"name": "Abyssal whip",
"members": true,
"quantity": "1",
"noted": false,
"rarity": 0.001953125,
"rolls": 1
}
]
}
```
## The Prayer Database
Each prayer is represented by Python objects when using the PyPi `osrsbox` package, specifically using Python dataclass objects Additionally, the data is accessible directly by parsing the raw JSON files. All prayer data is stored in a single object to represent the properties of an in-game OSRS prayer, which is outlined in the following subsection.
### Prayer Properties
A `PrayerProperties` object type includes basic prayer metadata such as `id`, `name`, `description` text, `drain_per_minute`, `requirements` and `bonuses` values. Every prayer object in the prayer database has all of these properties. If you are parsing the raw JSON files all of these properties are in the root of the JSON document - so they are not nested. All of the properties available are listed in the table below including the property name, the data types used, a description of the property, if the property is required to be populated, and if the property is nullable (able to be set to `null` or `None`).
| Property | Data type | Description | Required | Nullable |
| -------- | --------- | ----------- | -------- |----------|
| id | integer | Unique prayer ID number. | True | False |
| name | string | The name of the prayer. | True | False |
| members | boolean | If the prayer is members-only. | True | False |
| description | string | The prayer description (as show in-game). | True | False |
| drain_per_minute | float | The prayer point drain rate per minute. | True | False |
| wiki_url | string | The OSRS Wiki URL. | True | False |
| requirements | dict | The stat requirements to use the prayer. | True | False |
| bonuses | dict | The bonuses a prayer provides. | True | False |
| icon | string | The prayer icon. | True | False |
### Prayer: Python Object Example
A description of the properties that each prayer in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a prayer, specifically the _Rigour_ prayer, as loaded in the `osrsbox` PyPi Python package.
```
PrayerProperties(
id=28,
name='Rigour',
members=True,
description='Increases your Ranged attack by 20% and damage by 23%, and your defence by 25%.',
drain_per_minute=40.0,
wiki_url='https://oldschool.runescape.wiki/w/Rigour',
requirements={'prayer': 74, 'defence': 70},
bonuses={'ranged': 20, 'ranged_strength': 25, 'defence': 23},
icon='iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAABMklEQVR42rWW3Q0CIRCEjwJ8tgBrMPHZFmzAIny0gOvA+izAGjCYcMwNswucSrLJHT/7McvyM02bSojTfwo7Tv8h3h/PqKFfTSTEYqUuwTRQ9R8Erp0XdV79ANBWw7Y/7Mw2W7mhqDSGxTkC0vf5eqqg2I99CKAOVXZ0mY+Lw/SdgFjHk7DD3xE+hLZsINR2+BQMlXG7Gu8Cc2jyt4KketWWw22HWYTUWqcMsYzVcmIBMFQZqBSxmvl1+xj2Z7XdQByQHbKSDET1qNCB1uuHs1ZhY2NgQ2W9fpbCEaAT0jpLeZAKaQvmJI3OUs5QhHoZqoDuWcr7jDe4lURqL3bcIOsTxwJbxmvdcV0FeQPgPmydpZ3KJvcg904bVNi+GwegCPYgG2D1g6nXfvCu4cdRy9rlDXGzl98mKbMMAAAAAElFTkSuQmCC'
)
```
### Prayer: JSON Example
A description of the properties that each prayer in the database can have is useful, but sometimes it is simpler to provide an example. Below is a full example of a prayer, specifically the _Rigour_ prayer, as a JSON object.
```
"id": 28,
"name": "Rigour",
"members": true,
"description": "Increases your Ranged attack by 20% and damage by 23%, and your defence by 25%.",
"drain_per_minute": 40.0,
"wiki_url": "https://oldschool.runescape.wiki/w/Rigour",
"requirements": {
"prayer": 74,
"defence": 70
},
"bonuses": {
"ranged": 20,
"ranged_strength": 25,
"defence": 23
},
"icon": "iVBORw0KGgoAAAANSUhEUgAAABwAAAAYCAYAAADpnJ2CAAABMklEQVR42rWW3Q0CIRCEjwJ8tgBrMPHZFmzAIny0gOvA+izAGjCYcMwNswucSrLJHT/7McvyM02bSojTfwo7Tv8h3h/PqKFfTSTEYqUuwTRQ9R8Erp0XdV79ANBWw7Y/7Mw2W7mhqDSGxTkC0vf5eqqg2I99CKAOVXZ0mY+Lw/SdgFjHk7DD3xE+hLZsINR2+BQMlXG7Gu8Cc2jyt4KketWWw22HWYTUWqcMsYzVcmIBMFQZqBSxmvl1+xj2Z7XdQByQHbKSDET1qNCB1uuHs1ZhY2NgQ2W9fpbCEaAT0jpLeZAKaQvmJI3OUs5QhHoZqoDuWcr7jDe4lURqL3bcIOsTxwJbxmvdcV0FeQPgPmydpZ3KJvcg904bVNi+GwegCPYgG2D1g6nXfvCu4cdRy9rlDXGzl98mKbMMAAAAAElFTkSuQmCC"
}
```
## Project Contribution
This project would thoroughly benefit from contributions from additional developers. Please feel free to submit a pull request if you have code that you wish to contribute - I would thoroughly appreciate the helping hand. For any code contributions, the best method is to [open a new GitHub pull request](https://github.com/osrsbox/osrsbox-db/pulls) in the project repository. Also, feel free to contact me (e.g., on the Discord server) if you wish to discuss contribution before making a pull request. If you are not a software developer and want to contribute, even something as small as _Staring_ this repository really makes my day and keeps me motivated!
### Crowd Sourcing Item Skill Requirements
A really manual part of the item database is the `item.equipment.requirements` data. So far, I have manually populated this data... for over 3,500 items! To keep this project alive, I have stopped adding in this data (as it takes a lot of time). Here is a summary of how the item skill requirements work:
- All item requirements are stored in the [`skill-requirements.json`](https://github.com/osrsbox/osrsbox-db/blob/master/data/items/items-skill-requirements.json) file
- They have a structure of:
```
"item_id": {
"skill_name": integer
},
```
- For example, the Abyssal whip item:
```
"4151": {
"attack": 70
},
```
- For the `skill_name`, the [`schema-items.json`](https://github.com/osrsbox/schemas/blob/67b062b8d8499f80f43a95ff3b72cc40a6a833c9/schema-items.json#L293) file has a list of the allowed values - to help get the correct skill name. For example, `runecraft` and not `runecrafting`!
With some community help (by crowd sourcing) we could keep this data point fresh. If you find an error or want to add in a requirement, and want to contribute, here are the best ways to help:
- GitHub PR: Clone the project repo, make changes to `skill-requirements.json`, submit PR
- GitHub Issue: Submit an issue with the fix. It would really help me if you put the request in the correct JSON format as described above!
FYI - there is currently no quest-associated requirements. This would be a great addition to the project, but seems to be a very complex thing to add.
## Additional Project Information
This section contains additional information about the osrsbox-db project. For detailed information about the project see the [`osrsbox.com`](https://www.osrsbox.com/) website for the official project page, and the _Database_ tag to find blog posts about the project:
- https://www.osrsbox.com/projects/osrsbox-db/
- https://www.osrsbox.com/blog/tags/Database/
### Project Feedback
I would thoroughly appreciate any feedback regarding the osrsbox-db project, especially problems with the inaccuracies of the data provided. So if you notice any problem with the accuracy of item property data, could you please let me know. The same goes for any discovered bugs, or if you have a specific feature request. The best method is to [open a new Github issue](https://github.com/osrsbox/osrsbox-db/issues) in the project repository.
### Project License
The osrsbox-db project is released under the GNU General Public License version 3 as published by the Free Software Foundation. You can read the [LICENSE](LICENSE) file for the full license, check the [GNU GPL](https://www.gnu.org/licenses/gpl-3.0.en.html) page for additional information, or check the [tl;drLegal](https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)) documentation for the license explained in simple English. The GPL license is specified for all source code contained in this project. Other content is specified under GPL if not listed in the **Exceptions to GPL** below.
#### Exceptions to GPL
Old School RuneScape (OSRS) content and materials are trademarks and copyrights of JaGeX or its licensors. All rights reserved. OSRSBox and the osrsbox-db project is not associated or affiliated with JaGeX or its licensors.
Additional data to help build this project is sourced from the [OSRS Wiki](https://oldschool.runescape.wiki/). This primarily includes item and monster metadata that is not available in the OSRS cache. As specified by the [Weird Gloop Copyright](https://meta.weirdgloop.org/w/Meta:Copyrights) page, this content is licensed under CC BY-NC-SA 3.0 - [Attribution-NonCommercial-ShareAlike 3.0 Unported](https://creativecommons.org/licenses/by-nc-sa/3.0/) license.
### Project Attribution
The osrsbox-db project is a labor of love. I put a huge amount of time and effort into the project, and I want people to use it. That is the entire reason for its existence. I am not too fussed about attribution guidelines... but if you want to use the project please adhere to the licenses used. Please feel free to link to this repository or my [OSRSBox website](https://www.osrsbox.com/) if you use it in your project - mainly so others can find it, and hopefully use it too!
%prep
%autosetup -n osrsbox-2.2.3
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-osrsbox -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 2.2.3-1
- Package Spec generated
|