Package: manabase
manabaseLanding rock solid mana bases for your decks.Manabase is a command-line tool that helps you generate a mana base for your
Magic: The Gathering decks.It usesscryfallas its source of truth to find suitable
lands and mana rocks for your colors.Note: Manabase comes pre-configured for Commander decks, but is fully customizable.InstallationManabase is available onPyPIInstall manabase usingpip:pipinstall--usermanabaseQuickstartTo generate a new manabase with default settings, run the following command:manabasegenerateWUBThis will output a manabase of 37 unique lands for a white, blue and black deck.UsageManabase offers a primary command,manabase, that generates a list of lands and
optionally rocks for a set of colors.ColorsColors must be specified in the command, and are expressed as a string of letters.Each color has one unique letter assigned:White:WBlue:UBlack:BRed:RGreen:GSo if you wanted to generate a red and green manabase, you would use the commandmanabase generate RG.FiltersManabase includes a set of powerful filters, defining which type of lands and rocks are
allowed in the output list.These type of cards are called cycles, and are defined by MTG Gamepedia for bothlandsandrocksFollowing is a list of supported cycles, and the name of the corresponding
filter.Lands:battle: Battle for Zendikar dual lands.bond: Battlebond and Commander Legends crowd lands.bounce: Ravnica bounce lands.check: Ixalan and Innistrad check lands.cycling:
Amonkhet cycling lands.fast: Mirrodin and Kaladesh fast lands.fetch: Onslaught and Zendikar fetch lands.filter: Odyssey and Future Sight filter lands.horizon: Future Sight and Modern Horizons horizon lands.original:
The original dual lands.pain: Ice Age and Apocalypse pain lands.reveal: Innistrad reveal lands.scry: Theros and M21 scry lands.shock: Ravnica shock lands.Rocks:banner: Khans of Tarkir banners.cluestone: Ravnica clue stones.crystal: Ikoria crystals.locket: Ravnica lockets.obelisk: Alara obelisks.signet: Ravnica signets.talisman: Mirrodin talismans.Additionally, two color-related filters are provided:These are:producer: This filter checks if the card produces mana of the given colors.reference: This filter checks if a reference to a land type of the given
colors is contained in the card text.Without these filters, all colors could be matched.Examples:fetchwill accept all fetch lands.producerwill accept all cards that can produce your colors.OperatorsFilters can be combined using four operators:&: Accepts only cards matching both filters.|: Accepts cards matching either filter.^: Accepts cards matching one filter or the other, but not both.~: Inverts the following filter results.Moreover, you can group operators and filters using parenthesis to
control operator precedence.Examples:reference & fetchwould match only fetch lands respecting your colors.(producer & original) | (reference & fetch)would match either original
dual lands producing your colors, or fetch lands of your colors.Filter argumentsFinally, some filters can take arguments to control their behavior.producerandreferenceeach takeexclusiveandminimum_countarguments.exclusive, which is true by default, prevents cards matching colors other than
yours. For example, if you asked for white and blue, a white and red producer would
be excluded, because it contains red.minimum_countsets the number of colors a card should match, among your colors,
before being accepted. By default this is 2, which means cards have to produce
or reference at least two of your colors to be accepted.This filters can help you define a better behavior, for example for fetch lands
it makes sense to disable theexclusiveargument and set theminimum_countto 1, so that all fetch lands matching at least one of your colors are included.To override arguments, specify your argument values in the right order, between
curly braces, separated by commas.Examples:producer { 0, 3 }would match all cards producing at least three of your
colors, without excluding other colors.reference { 0, 1 } & fetchwould match fetch lands producing at least one
of your colors, without excluding other colors.CommandsIn the following examples, we are using themanabasecommand to generate
a set of lands for a white, blue and black deck.Generate a set of lands using default settings:manabasegenerateWUBGenerate a set of 23 maximum lands, with 4 occurrence of each land:manabasegenerate--lands=23--occurrences=4WUBGenerate a list of only fetch lands and original dual lands.manabasegenerate--filters="(producer & original) | (reference & fetch)"WUBLand FillersIf Manabase cannot find as many lands as you asked for, it will begin filling
the list with basic lands.You have the option to specify weights to refine the distribution of these basic
lands.By default, the same amount of each basic land will be added.If your mana costs are heavier in one color for example, you might want to add
more of one basic land than the others.The following command will generate a manabase including more Plains than
Island or Swamp cards.manabasegenerate--filler-weights="4 1 1"WUBThe number of weights must match the number of colors, and express a ratio
between the basic land distribution.In our case, a two thirds of all basic lands should be plains, will the last
third will be equally Island and Swamp cards.PresetsSpecifying command-line arguments can be a bit cumbersome, especially for the--filtersoption.A generation preset allows you to specify anyoptionsthegeneratecommand
takes in, and apply them automatically.For the following sections, it is assumed the preset name isdefault.Creating a presetTo create a new preset, use themanabase presets newcommand, with a name for
the new preset and any option thegeneratecommand can take.manabasepresetsnewdefault--filters="(producer & (original | shock)) | (reference & fetch)"--lands=37--occurrences=1Selecting the active presetThe active preset is the one used automatically when using thegeneratecommand.You can activate an existing preset with the following command.manabasepresetsusedefaultNote: when you create a new preset, it is automatically activated
for you.Printing the active presetYou can print the active preset with the following command.manabasepresetsactiveListing existing presetsYou can list existing preset names with the following command.manabasepresetslistPrinting a presetTo print a preset content to the terminal, use the following command.manabasepresetsshowdefaultUpdating a presetUpdating a preset replaces all its options with new ones.If you meant to add a new option, or update a single option, use thepatchsubcommand.manabasepresetsupdatedefault--lands=35Patching a presetPatching a preset adds a new option or updates an existing one.manabasepresetspatchdefault--occurrences=4Deleting a presetDeleting a presets erases its file from disk.manabasepresetsdeletedefaultContributingThis package usespoetryto manage its
dependencies.InstallingInstall poetry.Clone this repository:gitclonehttps://github.com/Aphosis/manabasecdmanabaseInstall manabase for development:poetryinstallTestsTests are written usingpytest.Oncemanabasehas been installed, you can run tests to check if your
changes did not introduce regressions.To run the test suite,cdinto themanabasefolder, then run:pytestPytest is configured inpyproject.toml, you do not need to specify any
extra arguments.LicenseThis tool is licensed under MIT.Non affiliation disclaimerManabase is not affiliated, associated, authorized, endorsed by, or in any way
officially connected with Wizards of the Coast, or any of its subsidiaries or
its affiliates.