No project description provided
Project description
mod-manager
Table of Contents
Installation
pip install mod-manager
License
mod-manager
is distributed under the terms of the MIT license.
About
mod-manager is a command line utility meant to help in downloading, searching, and version controlling mods from thunderstore.io
mod-manager works by using click context in order to pass around flags and values to the underlying commands. For this reason, most of the options that are necessary will need to be given to the main tmm
command
It has 4 main utilities that get installed as a python binary under tmm
tmm download
tmm download
takes no arguments in and of itself, but uses all the flags of the main top command. Heres an example command for downloading 'BepInExPack'
> tmm -p BepInExPack download
tmm redownload
tmm redownload
takes one argument, the json file which was output by thetmm download
.tmm download
creates a 'versions.json' that has all the settings and values from when the package_index was downloaded
> tmm redownload /path/to/versions.json
tmm fsearch
tmm fsearch
searches through the index using a simple Fuzzy searching algorithm, and returns found deprecated and non-deprecated packages. To exclude deprecated packages, use--no-deprecated
or-n
. If you want to search case insensitive, use the-i
or--case-insensitive
flag
tmm dsearch
tmm dsearch
searches through the index package descriptions using a simple Fuzzy searching algorithm, and returns the found full-name packages that match. If you want to use the case insensitive flag, use the-i
flag
tmm search
DEPRECATEDtmm search
IS DEPRECATED, and will not be kept/upheld. For the current search, see Fuzzy Searchingtmm search
takes any amount of arguments for searching using the package_index that thunderstore provides. To show the actual output from the commands, you can use the--no-suppress
flag to see what the script would grab for that specific variable, and--only-latest
to only see the latest if you do choose to not suppress the output- The output looks like this
Fuzzy searching
- Currently
tmm
uses a simple fuzzy searching algorithm. It works by moving the string from left to right along the search value and counting how many letters match
Take the below example
string = "ABC"
In order to fuzzy search, the program instantiates a class with a list of strings
from mod_manager.algorithms import FuzzyFind
searcher = FuzzyFind(["AAA", "BBB", "CCC", "ABD", "ABC"])
The fuzzy searcher will then return the found entries with the count of what positions matched as it moved along the string. At first, the search will return only full matches in the string
> searcher.search(string) # searcher.search("ABC")
[FoundEntry(match_positions=[0,1,2], count=3, fullstring='ABC', percentage=1.0)]
To change this behavior, the limit option can be used in order to allow for different options (keep in mind, this can lead to duplicate search values as there can be multiple matches)
> searcher.search(string, limit=1)
[
Foundentry(match_positions=[0], count=1, fullstring='AAA', percentmatch=0.33),
Foundentry(match_positions=[1], count=1, fullstring='AAA', percentmatch=0.33),
Foundentry(match_positions=[2], count=1, fullstring='AAA', percentmatch=0.33),
...
]
To use an object in the index, there is an extractor
option that allows for you to put in objects but tell the class how to get the string out
from collections import namedtuple
Example = namedtuple("Example", ["name", "search"])
searcher = FuzzyFind([Example("name", "description")], extractor = lambda x: x.search)
The searcher will work as normal, searching through the properties of those objects
searcher.search("desc")
[
FoundEntry(match_positions=[0,1,2,3], count=4, fullstring=Example(name="name", search="description"), percentmatch=1.0)
]
Full list of arguments
tmm
-c
,--community
, the commumity to use, defaults to 'lethal-company'-q
,--quiet
, will suppress outputs when retrieving the package index-p
,--package
, will include this package name in the search to grab from the package index and download, can use this multiple times ie:-p BepInEx -p BiggerLobby
-i
,--ignore-dependencies
, similar to-p
but this will exclude dependencies for that mod when it is found. ie:-i BiggerLobby
-f
,--file
, use a file separated by new lines instead of using -p to look up for packages. If you want to mimic the capability of--ignore-dependencies
, you can append;ignore-dependencies
to the end of the string and it will add it to the list
BepInEx BiggerLobby;ignore-dependencies; Will ignore dependencies for BiggerLobby
-s
,--no-save
, does NOT save the mod versions found to aversions.json
file-o
,--output-directory
, the directory in which to create the output folder, defaults to current directory
download
N/Aredownload
json_file
, the json fileversions.json
that was made from using thedownload
command
fsearch
-n
,--no-deprecated
, Don't include deprecated packages in search-l
,--limit
, Match limit for fuzzy finder, defaults to length of string passed in-i
,--case-insensitive
, Search for packages without case sensitivity
dsearch
-l
,--limit
, Match limit for fuzzy finder, defaults to length of string passed in-i
,--case-insensitive
, Search without case sensitivity
search
DEPRECATED-l
,--only-latest
, only show the latest version when outputing with--no-suppression
--show-all
, show all variants of the found mod and continue without looking further into the mod-n
,--no-suppress
, Output the json package data found from the thunderstore apipackages
, the list of mod names to search for with the thunderstore api
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mod_manager-2.5.0.tar.gz
.
File metadata
- Download URL: mod_manager-2.5.0.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5347f0c551413d3b2769024fce8bd91f2fc40fe19d32c8f1c311df90276e0b5 |
|
MD5 | 1fd9755d23af0d1ad4799e004cf2d23e |
|
BLAKE2b-256 | 5ab0f24e1729743436b152443df30d942d26b6938307cb3b60364c3cb2c1acc9 |
File details
Details for the file mod_manager-2.5.0-py3-none-any.whl
.
File metadata
- Download URL: mod_manager-2.5.0-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c147469846e6e1e560c1ea15b7aafd3c51e246cd4dbde567817b3af8b0de9272 |
|
MD5 | e57fa306959b2a075d5e0b188fd13538 |
|
BLAKE2b-256 | 20b85cdf16b5e9d6fade64b08954391759f0f7a294d55c4b0f8e25f8d4de7578 |