mishmash package

Submodules

mishmash.config module

class mishmash.config.Config(filename, **kwargs)[source]

Bases: nicfit.config.Config

db_url
music_libs
class mishmash.config.MusicLibrary(name, paths=None, excludes=None, sync=True)[source]

Bases: object

static fromConfig(config)[source]

mishmash.console module

mishmash.console.promptArtist(text, name=None, default_name=None, default_city=None, default_state=None, default_country=None, artist=None)[source]
mishmash.console.selectArtist(heading, choices=None, multiselect=False, allow_create=True)[source]

mishmash.core module

class mishmash.core.Command(subparsers=None, **kwargs)[source]

Bases: nicfit.command.Command

Base class for MishMash commands.

Construct a command. Any kwargs are added to the class object using setattr. All commands have an ArgumentParser, either constructed here or when subparsers is given a new parser is created using its add_parser method.

config = None
db_conn = None
db_engine = None
db_session = None
run(args)[source]
exception mishmash.core.CommandError(msg, exit_status=1)[source]

Bases: Exception

Base error type for nicfit.command.Command errors.

mishmash.database module

class mishmash.database.DatabaseInfo(engine, SessionMaker, connection)

Bases: tuple

Create new instance of DatabaseInfo(engine, SessionMaker, connection)

SessionMaker

Alias for field number 1

connection

Alias for field number 2

engine

Alias for field number 0

mishmash.database.dropAll(url)[source]
mishmash.database.getTag(t, session, lid, add=False)[source]
mishmash.database.init(db_url, engine_args=None, session_args=None, trans_mgr=None, scoped=False)[source]
mishmash.database.search(session, query)[source]

Naive search of the database for query.

Returns:A dict with keys ‘artists’, ‘albums’, and ‘tracks’. Each containing a list of the respective ORM type.

mishmash.util module

mishmash.util.addLibraryArguments(cli: argparse.ArgumentParser, nargs)[source]

Add library options (-L/–library) with specific nargs.

mishmash.util.commonDirectoryPrefix(*args)[source]
mishmash.util.mostCommonItem(lst)[source]

Choose the most common item from the list, or the first item if all items are unique.

mishmash.util.normalizeCountry(country_str, target='iso3c')[source]

Return a normalized name/code for country in country_str. The input can be a code or name, the target determines output value. 3 character ISO code is the default (iso3c), or ‘iso2c’; otherwise then formal name is returned.

Raises ValueError if the country is unrecognized.

mishmash.util.safeDbUrl(db_url)[source]

Obfuscates password from a database URL.

mishmash.util.sortByDate(things, prefer_recording_date=False)[source]
mishmash.util.splitNameByPrefix(s)[source]

Module contents

mishmash.getLogger(name=None)[source]