Skip to content

Commit 3d9f033

Browse files
Significant changes!
The "labrinth" part (i.e. the "build" part) of the version is gone! setup.py now included! Project hosted on test.pypi.org Its beta.5 because of issues with PyPI. In future I will use "test.{}" for test.PyPI releases Useless methods and args removed. Kilt seperated into `labrinth`, `version`, `error`, and `__init__`. Labrinth: For interacting with Modrinth API / labrith (main file) Version: contains metadata. Errors: contains exception classes __init__: just `from kilt.version import *` for IMMEDIATE caching.
1 parent 7b25a93 commit 3d9f033

File tree

15 files changed

+531
-360
lines changed

15 files changed

+531
-360
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
/__pycache__/
44
/cache/
55
/modlist.html
6-
/desc.txt
6+
/descriptions.txt
77
/modlist.html
8-
8+
/.pypirc

.idea/Kilt.iml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
MIT License
2+
Copyright (c) 2018 YOUR NAME
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
The above copyright notice and this permission notice shall be included in all
10+
copies or substantial portions of the Software.
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17+
SOFTWARE.

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
## Kilt - A Python Libary / High-end API for interacting with the Modrinth API ([labrinth](https://github.com/modrinth/labrinth))
1+
## Kilt
22

3-
# Instaltion
4-
Kilt is still in alpha, expect bugs.
5-
Run `git clone https://github.com/Jefaxe/Kilt.git`
3+
- A Python Libary / High-end API for interacting with the Modrinth API ([labrinth](https://github.com/modrinth/labrinth))
64

7-
Move the `kilt` folder to your project dircetory, and import it.
5+
# Instaltion
6+
Run:
7+
`git clone https://github.com/Jefaxe/Kilt.git`
8+
`cd Kilt`
9+
`pip install .` or `python setup.py install`
10+
11+
# Usage
12+
13+
See the WIP [wiki](https://github.com/Jefaxe/Kilt/wiki)
14+
15+
Basically, you can search [modrinrth](https://modrinth.com) using kilt.labrinth.search,
16+
and there are other things you can do with it that are similiar. It may expand to working with CurseForge, which doesn't really have an API so it'll be very hacky.
817

9-
Read the [wiki](https://github.com/Jefaxe/Kilt/wiki)

examples.py

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,54 @@
1-
import time
2-
3-
import kilt
4-
import webbrowser
51

62
# a bunch of random things with Kilt!
73
##
84

95

106
def lambd_update():
7+
import kilt
118
# check lambdynamiclights version
129
mod = kilt.search("light dy")[0]
1310
print("The latest version of {} is {}".format(mod.name, mod.version))
1411

1512

1613
def caffein_install():
14+
import kilt
1715
# download sodium, lithium, and phosphor
1816
mods = kilt.search(search_array=["sodium", "lithium", "phosphor"])
1917
for i in mods:
2018
i.download()
2119

2220

2321
def open_wiki():
22+
import kilt
23+
import webbrowser
2424
webbrowser.open(kilt._doc)
2525

2626

2727
def specific_install():
28+
import kilt
2829
mod = kilt.search("lithium")[0]
2930
mod.download(specific_version="mc1.16.5-0.6.3")
3031

3132

3233
def search_by_id():
34+
import kilt
3335
mod = kilt.search(mod_id="AZomiSrC")[0]
3436
print("{} is on version {}".format(mod.name, mod.version))
3537

3638

37-
def works_but_depracted():
38-
# don't do this!
39-
kilt.search(download_folder=True)
40-
# don't do this!
41-
kilt.search(saveIcon=True)
42-
43-
44-
def correct_way():
45-
# do this
46-
mod = kilt.search()[0]
47-
mod.download()
48-
# do this
49-
mod = kilt.search()[0]
50-
mod.save_icon()
51-
5239

5340
def search_array():
41+
import kilt
5442
mods = kilt.search(logging_level=0, search_array=["hydrogen", "galacticaft rewoven"])
5543
for mod in mods:
5644
print(mod.name)
5745

5846

59-
start = time.time()
60-
search_array()
61-
print(time.time()-start)
47+
def change_configs():
48+
from kilt import config
49+
config.global_level = 0
50+
import kilt
51+
kilt.search("zoom")
52+
53+
54+
change_configs()

0 commit comments

Comments
 (0)