These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

Convert .yaml files into more usable format

First post
Author
Brett Aubaris
Aliastra
Gallente Federation
#1 - 2014-07-21 03:24:20 UTC
Is there any way to to convert the new files (such as blueprints.yaml) into a more usable format similar to the old one?

I'm not good with macros and so don't know how to write one. Ideally, I'd like something similar to the old list with columns that were:

blueprint | material id | qty

Anyone able to help?
Louis Vitton
Viziam
Amarr Empire
#2 - 2014-07-21 08:33:30 UTC
Brett Aubaris
Aliastra
Gallente Federation
#3 - 2014-07-21 10:12:04 UTC
I've stumbled across those before, but would like to know how to do it myself.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#4 - 2014-07-21 12:15:10 UTC
I use:
https://github.com/fuzzysteve/yamlloader

downside: you need to install the pecl yaml module.


Short version: you need to write something to explicitly handle the yaml. no quick and easy 'use this, load any yaml into another format'.

It's probably possible to write it in vbscript, but that's a language I stay away from, in general.

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Zifrian
The Frog Pond
Ribbit.
#5 - 2014-07-21 21:44:02 UTC
Easiest way I found to do this was to import the data into a tree object. I just used VB.net's tree object they provide standard. I put it on the form and could see the yaml output when debugging it to make sure I had it right. But basically that's all the blueprints yaml file is, is a tree with a few branches and node levels.

Maximze your Industry Potential! - Download EVE Isk per Hour!

Import CCP's SDE - EVE SDE Database Builder

SJ Astralana
Syncore
#6 - 2014-07-27 08:26:11 UTC
[rant] I've got to say Yaml is the stupidest file format I've dealt with in over a decade. Crest data in Json, no dramas. Paste a url into a Json2Csharp, consume the url, done. Parsing Yaml is all of the pain of dealing with Xml with none of the upsides. [/rant]

Hyperdrive your production business: Eve Production Manager

Lukas Rox
Aideron Technologies
#7 - 2014-07-27 12:14:32 UTC
As part of deployment, LMeve loads all YAML data into MySQL using a library ather than PECL module, so it works on shared hosting where you don't have root access.

here's URL: https://github.com/roxlukas/lmeve/

Check file ./bin/update_yaml.php script and libraries included in it

Proud developer of LMeve: Industry Contribution and Mass Production Tracker: https://github.com/roxlukas/lmeve | Blogging about EVE on http://pozniak.pl/wp/

Hazzard
Chaotic Dynamics
#8 - 2014-08-11 02:04:26 UTC
SJ Astralana wrote:
[rant] I've got to say Yaml is the stupidest file format I've dealt with in over a decade. Crest data in Json, no dramas. Paste a url into a Json2Csharp, consume the url, done. Parsing Yaml is all of the pain of dealing with Xml with none of the upsides. [/rant]


Could not agree more. Everything is going or has already gone JSON, why are we working with YAML?
Dragonaire
Here there be Dragons
#9 - 2014-08-11 03:09:58 UTC
Concerning that Yaml is a superset of Json it not that hard to work with. Depending on the file you may even be able to use Json tools to work with it. For anyone working in PHP just use Symfony2's Yaml library. Just to show you how easy it is to use:
[code]
$yaml = new Yaml();
$config = $yaml->parse(file_get_contents($configFile));
[code]

It has little or no dependence outside of itself unlike what many Symfony2 components usually need.

I'm sure if you look around you'll all find a library like it for your favorite programming language to use. I'd suggest starting with the Yaml site itself since it list many existing ones for over 10 languages.

Finds camping stations from the inside much easier. Designer of Yapeal for the Eve API. Check out the Yapeal PHP API Library thread.

Leoric Firesword
Imperial Shipment
Amarr Empire
#10 - 2014-08-11 19:07:47 UTC
as a complete noob to working with the data, what is held in the YAML files and would just grabbing Steve's (thanks man) mysql data dump give me the data needed?
Khara Taredi
Parallel Production
Goonswarm Federation
#11 - 2014-08-14 06:58:59 UTC  |  Edited by: Khara Taredi
No idea why they wouldn't put this data into a table like invtypematerials

Anyway for PHP I'm using Spyc which you can find here

https://github.com/mustangostang/spyc/

Which is also super easy to use.

require_once "spyc.php";
$Data = spyc_load_file('spyc.yaml');

$Data will be an array that holds everything in the yaml file.
I parsed it and dumped it into a table as typeID | materialTypeID | quantity

Dumped the table to an excel file for you below.
If you want it in a different format just let me know :)

https://mega.co.nz/#!PZZUiaZb!S8vafYTBfFBLjKWz4J2LqRO9idmKaaIQnKjKFe7yI24

Link seems a bit broken so make sure you copy the whole thing.
Also, I don't really expect any errors in here and from what I've tested so far it seems fine but do check to be sure
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#12 - 2014-08-14 11:23:17 UTC
Leoric Firesword wrote:
as a complete noob to working with the data, what is held in the YAML files and would just grabbing Steve's (thanks man) mysql data dump give me the data needed?



I don't convert everything. I've pulled most of it through into tables though.

If there's something I've not, which you need, give me a yell and I'll strongly think about it?

(I don't update the base tables. I only add new ones)

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter