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.
 

Reverence - 100% compatible EVE cache library for Python

First post
Author
Pantload
The Underpants Gnomes
#41 - 2012-02-05 16:32:32 UTC
Question:

Does Reverence library give access to all the same data as would be found in ccp's data dump?

I posted another very specific question about Python, Reverence, and looking up planet data here:
Linkage

Could you possibly answer that question, as well?

Thanks for any help you could give me.


Cheers,
PL
Entity
X-Factor Industries
Synthetic Existence
#42 - 2012-02-05 17:34:59 UTC
Pantload wrote:
Does Reverence library give access to all the same data as would be found in ccp's data dump?


Nope. the dump has a wee bit more info.

Planet names do appear in the cache but only after you've visited a system (and then only for as long as it takes for the entry to get overwritten by something else with the same hash)

There's probably some logic to the planetID vs names (ascending order maybe) but that still leaves a few named planets as special case though.

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Kontalaa
New Eden Trading Association
#43 - 2012-03-17 21:46:50 UTC  |  Edited by: Kontalaa
Is there a problem with the last update? I'm using the "GetOldPriceHistory"-action for finding out history-data on items ..

seems like i only get "GetNewPriceHistory" now (meaning just today .. and not the 30 days back i used to..)


anyone else experienced this problem?


---

Edit: Forget that problem .. looks like the history doesnt get exported as often as i expected it to be -.-
Entity
X-Factor Industries
Synthetic Existence
#44 - 2012-04-03 10:50:09 UTC
Just a heads-up everyone.

For the next release of Reverence I will be doing the following:

- EVE client compatibility mode will be removed.
This mode used RecordSets for the row data (matching what the EVE client uses). This change should not affect anyone as the default container classes in Reverence offer a larger set of features anyway.

- Minimum supported EVE version will be Crucible 1.5 or even 1.6
Older versions that use the same table scheme may still work

- Support for old table names and old attribute names will be removed.
Things like cfg.ramtypematerials being cfg.invtypematerials, and attribute aliases such as celestialID when you should be using itemID instead.

- Possibly some other changes that may require updates to applications using Reverence.

The reason is that with the changes in table layout over the years, and the recent addition of tables with fields composed by the localization subsystem, I was going to have to maintain 3-4 different code paths per loader for certain tables, which is a bloody mess and prone to cause issues in the long run.

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Entity
X-Factor Industries
Synthetic Existence
#45 - 2012-04-04 17:54:56 UTC
I've just pushed a fix that might be of importance to people using/dumping the cache data using Reverence.

The actual DBRow stuff in EVE supports NULL field values (as the data is basically straight from SQL). For some reason I did not implement this in Reverence. Oh well, better late than never.

Obviously, the difference between None and 0.0 or 0 is pretty important in some situations.

There is no new binary release yet, as I'd rather do all of the stuff that causes incompatibility at once.
You can build from source if you want the update though :)

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Kandreath
De Re Metallica
#46 - 2012-04-06 00:37:50 UTC
Hi there

Ok sorry for the walls of text, however I wanted to make a clear descriptions of what I'm seeing

I've been working on an application that uses the cache market order data that reverence provides

I'm using "autodumper" to pull it automatically, but autodumper is just a cache monitor and cache to market order file converter. I think the problem is with the reverence library and not autodumper. (it's the same autodumper that is mentioned in the Market scanner thread)

So what I'm seeing is occasionally the jump data has wrong values in it

I look up the item in the market, then export it manually, then compare what autodumper and the manually exported files say, and the jumps are different

Thanks to your debugging string in "blue" I was able to print to the screen the DBrow that comes directly from blue.marshal.load()

And from what I've been able to see that it's coming out of the blue.marshal.load() incorrectly

The call in autodumper looks like this
Quote:

blurb = open(filename, "rb").read()
what, obj = blue.marshal.Load(blurb


Now I can't see anywhere "obj" is referenced until it is used to pull data like thi
Quote:

for order in obj['lret'][0]
....writeline(f, order, type_id
....print order # this is my debugging string to show the DBro
for order in obj['lret'][1]
....writeline(f, order, type_id
....print order # this is my debugging string to show the DBro


Here is an example (I've sorted by OrderID to get some alignment between them)

This is the export from Eve

"price","volRemaining","typeID","range","orderID","volEntered","minVolume","bid","issueDate","duration","stationID","regionID","solarSystemID","jumps"
2.8,643561,2512,32767,2379503173,2500000,1,"True","2012-03-27 21:04:19.000",90,60004588,10000030,30002510,0
10,24748,2512,32767,2409627628,96349,1,"False","2012-01-17 02:48:28.000",90,60014833,10000030,30002527,2
1.46,48500,2512,3,2463275078,50000,1,"True","2012-03-06 23:39:16.000",90,60015041,10000030,30012505,5
7,110858,2512,32767,2464714096,181000,1,"False","2012-03-08 13:15:43.000",90,60014791,10000030,30002531,8
4.15,385109,2512,-1,2466518598,1000000,1,"True","2012-04-06 00:10:44.000",90,60004588,10000030,30002510,0
2.81,31703,2512,0,2475932287,35000,1,"True","2012-04-04 22:13:57.000",90,60010048,10000030,30002543,5
4.11,24718,2512,0,2476071310,50000,1,"True","2012-04-05 04:57:07.000",90,60004588,10000030,30002510,0
4,29178,2512,-1,2482936322,30000,1,"True","2012-03-25 19:38:39.000",90,60004588,10000030,30002510,0
9.99,699695,2512,32767,2483543767,1000000,1,"False","2012-03-26 09:53:05.000",90,60004588,10000030,30002510,0
8,668156,2512,32767,2485094991,701956,1,"False","2012-03-27 21:04:08.000",90,60004615,10000030,30002526,1
10.5,22500,2512,32767,2487298606,30000,1,"False","2012-03-30 03:41:42.000",90,60011413,10000030,30002546,5
9,4900,2512,32767,2493494716,4900,1,"False","2012-04-04 13:37:49.000",90,60004675,10000030,30002564,13
4.14,437665,2512,-1,2494487679,500000,1,"True","2012-04-05 12:59:06.000",3,60004588,10000030,30002510,0
9.95,50000,2512,32767,2494627775,50000,1,"False","2012-04-05 15:03:20.000",90,60004753,10000030,30002548,6

Here is what Autodumper says

"price","volRemaining","typeID","range","orderID","volEntered","minVolume","bid","issueDate","duration","stationID","regionID","solarSystemID","jumps"
2.8,643561,2512,32767,2379503173,2500000,1,"True","2012-03-27 21:04:19",90,60004588,10000030,30002510,0
10,24748,2512,32767,2409627628,96349,1,"False","2012-01-17 02:48:28",90,60014833,10000030,30002527,5
1.46,48500,2512,3,2463275078,50000,1,"True","2012-03-06 23:39:16",90,60015041,10000030,30012505,0
7,110858,2512,32767,2464714096,181000,1,"False","2012-03-08 13:15:43",90,60014791,10000030,30002531,8
4.15,385109,2512,-1,2466518598,1000000,1,"True","2012-04-06 00:10:44",90,60004588,10000030,30002510,0
2.81,31703,2512,0,2475932287,35000,1,"True","2012-04-04 22:13:57",90,60010048,10000030,30002543,0
4.11,24718,2512,0,2476071310,50000,1,"True","2012-04-05 04:57:07",90,60004588,10000030,30002510,0
4,29178,2512,-1,2482936322,30000,1,"True","2012-03-25 19:38:39",90,60004588,10000030,30002510,0
9.99,699695,2512,32767,2483543767,1000000,1,"False","2012-03-26 09:53:05",90,60004588,10000030,30002510,5
8,668156,2512,32767,2485094991,701956,1,"False","2012-03-27 21:04:08",90,60004615,10000030,30002526,4
10.5,22500,2512,32767,2487298606,30000,1,"False","2012-03-30 03:41:42",90,60011413,10000030,30002546,8
9,4900,2512,32767,2493494716,4900,1,"False","2012-04-04 13:37:49",90,60004675,10000030,30002564,13
4.14,437665,2512,-1,2494487679,500000,1,"True","2012-04-05 12:59:06",3,60004588,10000030,30002510,0
9.95,50000,2512,32767,2494627775,50000,1,"False","2012-04-05 15:03:20",90,60004753,10000030,30002548,0

Look at the second row of data (orderID: 2409627628), you can see Jumps is inconsistent

I know it could be Autodumper, but I can't see how at this point. By printing "order" I believe I'm getting what blue.marshal.load() returned

Any chance you can take a look at this one?
Entity
X-Factor Industries
Synthetic Existence
#47 - 2012-04-06 01:27:02 UTC
Kandreath wrote:
Hi there,

{wall of text}

Any chance you can take a look at this one?


Don't have to, this was covered ages ago on the old forums, but I'll say it again:

- The jumps field in the cache is the server's idea of jumps. Not the client's.
- The client's idea is affected by your autopilot settings.
- The client calculates jumps clientside, as doing that on the server for everyone's different settings would be silly.
- The client completely ignores the jumps value the server gave it (which is the stuff in the cache file).

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Nomad I
University of Caille
Gallente Federation
#48 - 2012-04-17 09:30:44 UTC
I would like to use Python 3.2. Are you able to provide a windows binary?
Entity
X-Factor Industries
Synthetic Existence
#49 - 2012-04-17 13:11:45 UTC
Nomad I wrote:
I would like to use Python 3.2. Are you able to provide a windows binary?


Nope. There are huge differences between Python 2.x and Python 3.x, and the cache format is specific to Python 2.x.
Some 2.x type objects don't exist in 3.x and vice versa, cPickle is not compatible, etc.

Of course it's -technically- possible to make a version that runs on 3.x, but I'm not actually mad enough to go do it.

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Steve MacWilliams
Center for Advanced Studies
Gallente Federation
#50 - 2012-04-30 19:22:26 UTC
Hi Entity, awesome library! For education''s sake, would you be willing to share a bit of the development process of your project, specifically decoding the table formats?
Entity
X-Factor Industries
Synthetic Existence
#51 - 2012-04-30 21:18:50 UTC  |  Edited by: Entity
Steve MacWilliams wrote:
Hi Entity, awesome library! For education''s sake, would you be willing to share a bit of the development process of your project, specifically decoding the table formats?


Not really, but I assume you mean the DBRow type when you say table formats.

I'll say this: The custom RLE CCP used to encode the DBRow data took a while.
Figured it out mostly by looking at cache files you can dictate the contents of, such as placing market orders at a specific price for an item that has no other buy/sell orders so there's only one row of data. If you have multiple market order cache files that only differ by price, that gives a lot of insight in the encoding used.

Of course other techniques were used, that I don't feel like discussing Twisted

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Sergie Wallbanger
Deep Core Mining Inc.
Caldari State
#52 - 2012-05-02 02:20:10 UTC
is this working for the new expansion?
Entity
X-Factor Industries
Synthetic Existence
#53 - 2012-05-02 08:51:46 UTC
it should.

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Desmont McCallock
#54 - 2012-05-02 09:19:01 UTC
It is.
Sergie Wallbanger
Deep Core Mining Inc.
Caldari State
#55 - 2012-05-04 03:34:32 UTC
I was getting mismatched data from the cache and the actual game.

Apparently revenant was reading the cache from previous eve builds aswel instead of just the latest.

I deleted the cached data from my app folder and revenant pulls the correct data now.

Thought i would post this someone may have a similar problem.
Vaerah Vahrokha
Vahrokh Consulting
#56 - 2012-05-08 11:09:40 UTC
I have a little issue.

I have created a quite large script that dumps the items price history on file (in various ways including OHLC format).

I use CachedMethodCalls => GetOldPriceHistory + GetNewPriceHistory as in the following small snippet


eve = blue.EVE(EVEROOT)
cfg = eve.getconfigmgr()
cachemgr = eve.getcachemgr()
cmc = cachemgr.LoadCacheFolder("CachedMethodCalls")

print "Deleting old records... \n"
for root, dirs, files in os.walk(OUTPATH, topdown=False):
for name in files:
os.remove(os.path.join(root, name))

for key, obj in cmc.iteritems():
for CurrentItemToDump in ItemsToDump:
if key[1]=="GetOldPriceHistory":
item = cfg.invtypes.Get(key[3])
region = cfg.evelocations.Get(key[2])

...

if key[1]=="GetNewPriceHistory":
item = cfg.invtypes.Get(key[3])
region = cfg.evelocations.Get(key[2])

...

I think the above should cover every price record.

But the behavior is not the expected.

On some markets, like Nitrogen Isotopes I get an output like:

1) GetOldPriceHistory => All old prices data up to 2 days ago
2) GetNewPriceHistory => Yesterday price.

Example:

...
2012-05-02 00:00:00, 1002.80, 1002.86, 1002.85, 47161814, 284
2012-05-03 00:00:00, 1003.43, 1039.97, 1004.96, 59085004, 330
2012-05-04 00:00:00, 1007.11, 1037.75, 1010.70, 80109798, 439
2012-05-05 00:00:00, 932.47, 969.96, 969.69, 83358331, 402
2012-05-06 00:00:00, 966.18, 1015.99, 998.76, 82448391, 370
2012-05-07 00:00:00, 998.47, 1005.60, 1001.90, 64987299, 372

As you see it ends May 7 and not 8 (today).


Other markets, like Isogen instead behave different:

2012-05-03 00:00:00, 86.00, 88.50, 88.00, 408729569, 1606
2012-05-04 00:00:00, 88.33, 88.69, 88.58, 309280884, 1509
2012-05-05 00:00:00, 87.43, 89.88, 87.87, 384421318, 1747
2012-05-06 00:00:00, 80.51, 88.25, 85.16, 522793936, 1973
2012-05-08 00:00:00, 30.00, 94.00, 83.65, 133281182, 464

In game I can see May 7 is all set to zero, the export as you can see does not include May 7 at all.

Anything that can be done to sanitize this situation?
Entity
X-Factor Industries
Synthetic Existence
#57 - 2012-05-08 11:43:05 UTC
Vaerah Vahrokha wrote:
I have a little issue.

... bla ...

1) GetOldPriceHistory => All old prices data up to 2 days ago
2) GetNewPriceHistory => Yesterday price.

... bla ...

As you see it ends May 7 and not 8 (today).


Other markets, like Isogen instead behave different:

... bla ...

In game I can see May 7 is all set to zero, the export as you can see does not include May 7 at all.

Anything that can be done to sanitize this situation?


Nope. cache works in mysterious ways.

Actually not that mysteriously.
The cache details say the following about cache update frequency:
GetOldPriceHistory - versioncheck = utcmidnight
GetNewPriceHistory - versioncheck = utcmidnight_or_3hours

So you've probably pulled the data across one of the update points, so half of it would be old and half of it new.

What you should of course always do, is delete your machonet folder before pulling prices to ensure you're getting the server's latest version, but I don't think that'd change much here, as you're not getting realtime data anyway.

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Christopher Crusman
Brutor Tribe
Minmatar Republic
#58 - 2012-06-16 23:12:48 UTC
Hey - love Reverence, it's a great tool! :)

Having a bit of an issue with mine, though. It requires ce99.cache to be in the cache folder to run, and my client doesn't seem to generate one on its own - not a huge deal, though, I got an old copy of it and manually putting it in the cache folder before running worked fine as a workaround.

However, since Crucible, this has made my market analysis tool increasingly lacking, as it's unable to recognize any items added more recently than the version of the cache file I have. Using the following code:

cmc = cachemgr.LoadCacheFolder("CachedMethodCalls")
key, obj = cmc.iteritems()
if key[1] == "GetOldPriceHistory":
itemid=key[3]
item = cfg.invtypes.Get(itemid)

returns None (as the value for 'item') for items added since Crucible.

I noticed in an earlier response, you were advocating not using the LoadCacheFolder command at all - I assume I'm doing something obvious hilariously wrong, and there's a better (if not necessarily simpler) way to do this. I only saw the ce99.cache issue mentioned a couple times in my research, and in those it seemed to be relating to setting the wrong directory path - mine reads the cache fine so long as ce99 is in there, but doesn't seem to generate it like it's presumably supposed to.

I would appreciate any input :)
Entity
X-Factor Industries
Synthetic Existence
#59 - 2012-06-17 01:12:32 UTC
Christopher Crusman wrote:

Having a bit of an issue with mine, though. It requires ce99.cache to be in the cache folder to run


Make sure you actually run the latest Reverence (1.4.2). If you are actually running that, then you probably have an issue with there being a second cache folder, or having folders named as an IP address and a folder "Tranquility" in the cache\MachoNet folder, But I'm guessing you didn't update Reverence.

╦......║...╔╗.║.║.╔╗.╦║.╔╗╔╦╗╔╗

║.╔╗╔╗╔╣.╔╗╠..╠ ╠╗╠╝.║╠ ╠╝║║║╚╗

╩═╚╝║.╚╝.╚╝║..╚╝║║╚╝.╩╚╝╚╝║.║╚╝

Got Item?

Christopher Crusman
Brutor Tribe
Minmatar Republic
#60 - 2012-06-17 03:06:53 UTC
It turns out I actually wasn't running the latest Reverence (due to being very not good with Git - I'd downloaded a newer version manually, but hadn't done it through Git so I believe I was still using the old one), but I've now fixed that (updating to the version released April 4 2012) and the problem remains.

My cache>MachoNet folder only has one folder (named for the tranquility IP, "87.237.38.200"), which I've cleared of everything but the most recent subfolder (329). This occurs whether I set EVEROOT to the Users/[username]/AppData chain ending in c_program_files_(x86)_ccp_eve_tranquility, or to the main CCP/EVE directory in Program Files (it correctly finds the cache in both cases, but requires ce99 to be placed in the CachedObjects subfolder manually to avoid crashing, and still has the missing-items problem mentioned above).

I'll continue my search to see if another cache folder's hiding somewhere, but haven't found anything yet (at least, there's no duplicate MachoNet folders anywhere - the only other place the name even cropped up was in my backups of the cache in a completely different directory, which I deleted just to make sure, to no effect). I will note that my EVE install and the Reverence files are on separate drives, though the odds of that actually mattering seem slim-to-none.

My code is available for inspection if taking a look at it would be helpful, though I'd prefer not to post it in thread :)

Thanks for the quick reply!