javalent / fantasy-statblocks

Create Dungeons and Dragons style statblocks for Obsidian.md
MIT License
353 stars 69 forks source link

"Mass" Import external Data #13

Closed stschoelzel closed 2 years ago

stschoelzel commented 2 years ago

Is the only way to import external Data (I own) on a file by file basis?

valentine195 commented 2 years ago

What format are you trying to import?

stschoelzel commented 2 years ago

5etools data of stuff i own, because its the simplest to get

valentine195 commented 2 years ago

As far as I could find, you can only get monster data one by one from 5e.tools. Do you have an example of a file with multiple?

stschoelzel commented 2 years ago

Ok, I realize it doesn't work as I thought. I can't just import the data file for an Source I own (from the 5etools mirror) - how do I import from there then? I just want to get accsess to the stuff I own for my campaign managment :(

stschoelzel commented 2 years ago

I understand now ... A mass Import from 5e would be nice but I was just uninformed :D Thanks anyway <3

SnortsAlot commented 2 years ago

You can pull en-masse if you'd like @valentine195 but it would be limited by source file.

take a look at the datasource (flat file) jsons. homebrew files you'll have to pull from separately.

Hit up their Discord for help on where to find the files

valentine195 commented 2 years ago

Are they on the repo?

dokzlo13 commented 2 years ago

I have found simple workaround for 5e.tool site dump imports.

You can split bestriary in separate files manually, or, in my case, with simple python script like this:

import json
with open("~/5e.tools/data/bestiary/bestiary-mm.json", "r") as f:
    data = json.load(f)

for monster in data["monster"]:
    with open(f"~/dnd/monsters-mm/{monster['name']}.json", "w") as o:
        json.dump(monster, o, indent=4)

After, you can import files into obsidian-5e-statblock from those .json-files. But it causes other problems:

related screen (SRD goblin) ![image](https://user-images.githubusercontent.com/7513464/144397657-b042ca38-7f9c-4029-8017-1d62e3ad33a4.png)

Mass import from 5e.tools may be simple feature for obsidian-5e-statblock. But first, it requires 5e.tool markup fix. After that, adding a selection of many files at a time will cover most use-cases for import (i think).

valentine195 commented 2 years ago

Hey guys, I’ll be releasing a version 2.0.0 soon (hopefully within the next week) that’ll have a bunch of import improvements, including mass-import and fixing the markup.

valentine195 commented 2 years ago

The latest beta should have the ability to mass-import creatures from 5e.tools, either from the bestiary files shown above or going to the bestiary, adding monsters to a list using the + option, and right clicking the list -> Download JSON Data.

Single creatures may still be imported as well.

valentine195 commented 2 years ago

As this is fixed in the beta, I'm going to close this.