tradedangerous 10.15.2__py3-none-any.whl → 10.16.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tradedangerous might be problematic. Click here for more details.
- tradedangerous/cache.py +7 -5
- tradedangerous/plugins/eddblink_plug.py +115 -722
- tradedangerous/plugins/spansh_plug.py +205 -119
- tradedangerous/templates/Category.csv +17 -0
- tradedangerous/tradedb.py +1 -0
- tradedangerous/version.py +1 -1
- {tradedangerous-10.15.2.dist-info → tradedangerous-10.16.1.dist-info}/METADATA +1 -1
- {tradedangerous-10.15.2.dist-info → tradedangerous-10.16.1.dist-info}/RECORD +12 -12
- tradedangerous/templates/DefaultShipIndex.json +0 -6330
- {tradedangerous-10.15.2.dist-info → tradedangerous-10.16.1.dist-info}/LICENSE +0 -0
- {tradedangerous-10.15.2.dist-info → tradedangerous-10.16.1.dist-info}/WHEEL +0 -0
- {tradedangerous-10.15.2.dist-info → tradedangerous-10.16.1.dist-info}/entry_points.txt +0 -0
- {tradedangerous-10.15.2.dist-info → tradedangerous-10.16.1.dist-info}/top_level.txt +0 -0
|
@@ -14,12 +14,21 @@ from .. import plugins, cache, fs, transfers, csvexport
|
|
|
14
14
|
SOURCE_URL = 'https://downloads.spansh.co.uk/galaxy_stations.json'
|
|
15
15
|
|
|
16
16
|
STATION_TYPE_MAP = {
|
|
17
|
-
'
|
|
18
|
-
'
|
|
17
|
+
'None' : [0, False],
|
|
18
|
+
'Outpost' : [1, False],
|
|
19
|
+
'Coriolis Starport' : [2, False],
|
|
20
|
+
'Ocellus Starport' : [3, False],
|
|
21
|
+
'Orbis Starport' : [4, False],
|
|
22
|
+
'Planetary Outpost' : [11, True],
|
|
23
|
+
'Planetary Port' : [12, True],
|
|
24
|
+
'Mega ship' : [13, False],
|
|
25
|
+
'Asteroid base' : [14, False],
|
|
26
|
+
'Drake-Class Carrier': [24, False], # fleet carriers
|
|
27
|
+
'Settlement': [25, True], # odyssey settlements
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
System = namedtuple('System', 'name,pos_x,pos_y,pos_z,modified')
|
|
22
|
-
Station = namedtuple('Station', 'name,distance,max_pad_size,market,black_market,shipyard,outfitting,rearm,refuel,repair,planetary,type,modified')
|
|
30
|
+
System = namedtuple('System', 'id,name,pos_x,pos_y,pos_z,modified')
|
|
31
|
+
Station = namedtuple('Station', 'id,name,distance,max_pad_size,market,black_market,shipyard,outfitting,rearm,refuel,repair,planetary,type,modified')
|
|
23
32
|
Commodity = namedtuple('Commodity', 'id,name,category,demand,supply,sell,buy,modified')
|
|
24
33
|
|
|
25
34
|
|
|
@@ -68,40 +77,56 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
68
77
|
assert not (self.url and self.file), 'Provide either url or file, not both'
|
|
69
78
|
if self.file and (self.file != '-'):
|
|
70
79
|
self.file = (Path(self.tdenv.cwDir) / self.file).resolve()
|
|
71
|
-
|
|
80
|
+
if not self.tdb.dbPath.exists():
|
|
81
|
+
ri_path = self.tdb.dataPath / Path("RareItem.csv")
|
|
82
|
+
rib_path = ri_path.with_suffix(".tmp")
|
|
83
|
+
if ri_path.exists():
|
|
84
|
+
if rib_path.exists():
|
|
85
|
+
rib_path.unlink()
|
|
86
|
+
ri_path.rename(rib_path)
|
|
87
|
+
cache.buildCache(self.tdb, self.tdenv)
|
|
88
|
+
if ri_path.exists():
|
|
89
|
+
ri_path.unlink()
|
|
90
|
+
if rib_path.exists():
|
|
91
|
+
rib_path.rename(ri_path)
|
|
92
|
+
|
|
93
|
+
# self.known_space = self.load_known_space()
|
|
94
|
+
self.known_systems = self.load_known_systems()
|
|
95
|
+
self.known_stations = self.load_known_stations()
|
|
72
96
|
self.known_commodities = self.load_known_commodities()
|
|
73
97
|
|
|
74
98
|
def print(self, *args, **kwargs):
|
|
75
99
|
return self.tdenv.uprint(*args, **kwargs)
|
|
76
100
|
|
|
77
101
|
def run(self):
|
|
78
|
-
fs.ensurefolder(self.tdenv.tmpDir)
|
|
79
|
-
filePath = self.tdenv.tmpDir / Path("spansh.prices")
|
|
80
|
-
if self.tdenv.detail
|
|
102
|
+
# fs.ensurefolder(self.tdenv.tmpDir)
|
|
103
|
+
# filePath = self.tdenv.tmpDir / Path("spansh.prices")
|
|
104
|
+
if not self.tdenv.detail:
|
|
81
105
|
self.print('This will take at least several minutes...')
|
|
82
106
|
self.print('You can increase verbosity (-v) to get a sense of progress')
|
|
83
|
-
with
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
107
|
+
with Timing() as timing:
|
|
108
|
+
# with open(filePath, 'w') as f, Timing() as timing:
|
|
109
|
+
# self.print(f'Writing prices to {filePath}')
|
|
110
|
+
# f.write('# Generated from spansh galaxy data\n')
|
|
111
|
+
# f.write(f'# Source: {self.file or self.url}\n')
|
|
112
|
+
# f.write('#\n')
|
|
113
|
+
# f.write((
|
|
114
|
+
# '# {name:50s} {sell:>7s} {buy:>7s} '
|
|
115
|
+
# '{demand:>11s} {supply:>11s} {ts}\n'
|
|
116
|
+
# ).format(
|
|
117
|
+
# name='Item Name',
|
|
118
|
+
# sell='SellCr',
|
|
119
|
+
# buy='BuyCr',
|
|
120
|
+
# demand='Demand',
|
|
121
|
+
# supply='Supply',
|
|
122
|
+
# ts='Timestamp',
|
|
123
|
+
# ))
|
|
99
124
|
system_count = 0
|
|
100
125
|
total_station_count = 0
|
|
101
126
|
total_commodity_count = 0
|
|
102
|
-
self.need_commit = False
|
|
103
|
-
self.update_cache = False
|
|
104
|
-
seen_stations = set()
|
|
127
|
+
# self.need_commit = False
|
|
128
|
+
# self.update_cache = False
|
|
129
|
+
# seen_stations = set()
|
|
105
130
|
for system, stations in self.data_stream():
|
|
106
131
|
self.ensure_system(system)
|
|
107
132
|
station_count = 0
|
|
@@ -109,64 +134,104 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
109
134
|
for station, commodities in stations:
|
|
110
135
|
fq_station_name = f'@{system.name.upper()}/{station.name}'
|
|
111
136
|
if self.maxage and (datetime.now() - station.modified) > timedelta(days=self.maxage):
|
|
112
|
-
if self.tdenv.detail
|
|
137
|
+
if self.tdenv.detail:
|
|
113
138
|
self.print(f' | {fq_station_name:50s} | Skipping station due to age: {datetime.now() - station.modified}, ts: {station.modified}')
|
|
114
139
|
continue
|
|
115
|
-
if (system.name.upper(), station.name.upper()) in seen_stations:
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
seen_stations.add((system.name.upper(), station.name.upper()))
|
|
140
|
+
# if (system.name.upper(), station.name.upper()) in seen_stations:
|
|
141
|
+
# if self.tdenv.detail:
|
|
142
|
+
# self.print(f' | {fq_station_name:50s} | Skipping duplicate station record')
|
|
143
|
+
# continue
|
|
144
|
+
# seen_stations.add((system.name.upper(), station.name.upper()))
|
|
120
145
|
self.ensure_station(system, station)
|
|
121
|
-
f.write('\n')
|
|
122
|
-
f.write(f'@ {system.name.upper()}/{station.name}\n')
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
146
|
+
# f.write('\n')
|
|
147
|
+
# f.write(f'@ {system.name.upper()}/{station.name}\n')
|
|
148
|
+
|
|
149
|
+
items = []
|
|
150
|
+
for commodity in commodities:
|
|
151
|
+
commodity = self.ensure_commodity(commodity)
|
|
152
|
+
result = self.execute("""SELECT modified FROM StationItem
|
|
153
|
+
WHERE station_id = ? AND item_id = ?""",
|
|
154
|
+
station.id, commodity.id, ).fetchone()
|
|
155
|
+
modified = parse_ts(result[0]) if result else None
|
|
156
|
+
if modified and commodity.modified <= modified:
|
|
157
|
+
if self.tdenv.detail > 2:
|
|
158
|
+
self.print(f' | {commodity.name:50s} | Skipping older commodity data')
|
|
159
|
+
continue
|
|
160
|
+
items.append((station.id, commodity.id, commodity.modified,
|
|
161
|
+
commodity.sell, commodity.demand, -1,
|
|
162
|
+
commodity.buy, commodity.supply, -1, 0))
|
|
163
|
+
if items:
|
|
164
|
+
for item in items:
|
|
165
|
+
self.execute("""INSERT OR REPLACE INTO StationItem (
|
|
166
|
+
station_id, item_id, modified,
|
|
167
|
+
demand_price, demand_units, demand_level,
|
|
168
|
+
supply_price, supply_units, supply_level, from_live
|
|
169
|
+
) VALUES (
|
|
170
|
+
?, ?, IFNULL(?, CURRENT_TIMESTAMP),
|
|
171
|
+
?, ?, ?,
|
|
172
|
+
?, ?, ?, ?
|
|
173
|
+
)""", *item )
|
|
174
|
+
self.execute('COMMIT')
|
|
175
|
+
commodity_count += 1
|
|
176
|
+
|
|
177
|
+
# categories = self.categorise_commodities(commodities)
|
|
178
|
+
# for category_name, category_commodities in categories.items():
|
|
179
|
+
# f.write(f' + {category_name}\n')
|
|
180
|
+
# for commodity in category_commodities:
|
|
181
|
+
# commodity = self.ensure_commodity(commodity)
|
|
182
|
+
# f.write((
|
|
183
|
+
# ' {name:50s} {sell:7d} {buy:7d} '
|
|
184
|
+
# '{demand:10d}? {supply:10d}? {modified}\n'
|
|
185
|
+
# ).format(
|
|
186
|
+
# name=commodity.name,
|
|
187
|
+
# sell=commodity.sell,
|
|
188
|
+
# buy=commodity.buy,
|
|
189
|
+
# demand=commodity.demand,
|
|
190
|
+
# supply=commodity.supply,
|
|
191
|
+
# modified=commodity.modified,
|
|
192
|
+
# ))
|
|
193
|
+
# commodity_count += 1
|
|
140
194
|
station_count += 1
|
|
141
195
|
system_count += 1
|
|
142
196
|
total_station_count += station_count
|
|
143
197
|
total_commodity_count += commodity_count
|
|
144
|
-
if self.tdenv.detail
|
|
198
|
+
if self.tdenv.detail:
|
|
145
199
|
self.print(
|
|
146
200
|
f'{system_count:6d} | {system.name.upper():50s} | '
|
|
147
201
|
f'{station_count:3d} st {commodity_count:6d} co'
|
|
148
202
|
)
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
203
|
+
# self.execute('COMMIT')
|
|
204
|
+
# if self.need_commit:
|
|
205
|
+
# self.execute('COMMIT')
|
|
206
|
+
# self.need_commit = False
|
|
207
|
+
# self.update_cache = True
|
|
153
208
|
|
|
154
209
|
# Need to make sure cached tables are updated, if changes were made
|
|
155
|
-
if self.update_cache:
|
|
156
|
-
|
|
157
|
-
|
|
210
|
+
# if self.update_cache:
|
|
211
|
+
# for table in [ "Item", "Station", "System" ]:
|
|
212
|
+
# _, path = csvexport.exportTableToFile( self.tdb, self.tdenv, table )
|
|
158
213
|
|
|
214
|
+
self.execute('COMMIT')
|
|
215
|
+
# Need to make sure cached tables are updated
|
|
216
|
+
for table in [ "Item", "Station", "System", "StationItem" ]:
|
|
217
|
+
_, path = csvexport.exportTableToFile( self.tdb, self.tdenv, table )
|
|
218
|
+
|
|
159
219
|
self.print(
|
|
160
220
|
f'{timedelta(seconds=int(timing.elapsed))!s} Done '
|
|
161
221
|
f'{total_station_count} st {total_commodity_count} co'
|
|
162
222
|
)
|
|
163
223
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
224
|
+
with Timing() as timing:
|
|
225
|
+
self.print('Exporting to cache...')
|
|
226
|
+
cache.regeneratePricesFile(self.tdb, self.tdenv)
|
|
227
|
+
self.print(f'Cache export completed in {timedelta(seconds=int(timing.elapsed))!s}')
|
|
228
|
+
|
|
229
|
+
# if not self.listener:
|
|
230
|
+
# with Timing() as timing:
|
|
231
|
+
# self.print('Importing to database...')
|
|
232
|
+
# self.tdenv.mergeImport = True
|
|
233
|
+
# cache.importDataFromFile(self.tdb, self.tdenv, filePath)
|
|
234
|
+
# self.print(f'Database import completed in {timedelta(seconds=int(timing.elapsed))!s}')
|
|
170
235
|
return False
|
|
171
236
|
|
|
172
237
|
def data_stream(self):
|
|
@@ -197,56 +262,77 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
197
262
|
return categories
|
|
198
263
|
|
|
199
264
|
def execute(self, query, *params, **kwparams):
|
|
200
|
-
|
|
265
|
+
attempts = 5
|
|
201
266
|
cursor = self.tdb.getDB().cursor()
|
|
202
267
|
while True:
|
|
203
268
|
try:
|
|
204
269
|
return cursor.execute(query, params or kwparams)
|
|
205
270
|
except sqlite3.OperationalError as ex:
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
271
|
+
if not attempts:
|
|
272
|
+
raise
|
|
273
|
+
attempts -= 1
|
|
209
274
|
self.print(f'Retrying query \'{query}\': {ex!s}')
|
|
210
275
|
time.sleep(1)
|
|
211
276
|
|
|
212
|
-
def load_known_space(self):
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
277
|
+
# def load_known_space(self):
|
|
278
|
+
# cache = {}
|
|
279
|
+
# result = self.execute(
|
|
280
|
+
# '''
|
|
281
|
+
# SELECT System.name, Station.name FROM System
|
|
282
|
+
# LEFT JOIN Station USING (system_id)
|
|
283
|
+
# '''
|
|
284
|
+
# ).fetchall()
|
|
285
|
+
# for system, station in result:
|
|
286
|
+
# cache.setdefault(system.upper(), set())
|
|
287
|
+
# if station is not None:
|
|
288
|
+
# cache[system.upper()].add(station.upper())
|
|
289
|
+
# return cache
|
|
290
|
+
|
|
291
|
+
def load_known_systems(self):
|
|
292
|
+
try:
|
|
293
|
+
return dict(self.execute('SELECT system_id, name FROM System').fetchall())
|
|
294
|
+
except:
|
|
295
|
+
return dict()
|
|
296
|
+
|
|
297
|
+
def load_known_stations(self):
|
|
298
|
+
try:
|
|
299
|
+
return dict(self.execute('SELECT station_id, name FROM Station').fetchall())
|
|
300
|
+
except:
|
|
301
|
+
return dict()
|
|
302
|
+
|
|
226
303
|
def load_known_commodities(self):
|
|
227
|
-
|
|
304
|
+
try:
|
|
305
|
+
return dict(self.execute('SELECT fdev_id, name FROM Item').fetchall())
|
|
306
|
+
except:
|
|
307
|
+
return dict()
|
|
228
308
|
|
|
229
309
|
def ensure_system(self, system):
|
|
230
|
-
if system.
|
|
310
|
+
if system.id in self.known_systems:
|
|
231
311
|
return
|
|
232
312
|
self.execute(
|
|
233
313
|
'''
|
|
234
|
-
INSERT INTO System (name, pos_x, pos_y, pos_z, modified) VALUES (?, ?, ?, ?, ?)
|
|
314
|
+
INSERT INTO System (system_id, name, pos_x, pos_y, pos_z, modified) VALUES (?, ?, ?, ?, ?, ?)
|
|
235
315
|
''',
|
|
236
|
-
system.name, system.pos_x, system.pos_y, system.pos_z, system.modified,
|
|
316
|
+
system.id, system.name, system.pos_x, system.pos_y, system.pos_z, system.modified,
|
|
237
317
|
)
|
|
238
|
-
self.
|
|
239
|
-
if self.tdenv.detail
|
|
318
|
+
self.execute('COMMIT')
|
|
319
|
+
if self.tdenv.detail > 1:
|
|
240
320
|
self.print(f' | {system.name.upper():50s} | Added missing system')
|
|
241
|
-
self.
|
|
321
|
+
self.known_systems[system.id] = system.name
|
|
242
322
|
|
|
243
323
|
def ensure_station(self, system, station):
|
|
244
|
-
if station.
|
|
324
|
+
if station.id in self.known_stations:
|
|
325
|
+
system_id = self.execute('SELECT system_id FROM Station WHERE station_id = ?', station.id, ).fetchone()[0]
|
|
326
|
+
if system_id != system.id:
|
|
327
|
+
self.print(f' | {station.name:50s} | Megaship station moved, updating system')
|
|
328
|
+
self.execute("UPDATE Station SET system_id = ? WHERE station_id = ?", system.id, station.id, )
|
|
329
|
+
self.execute('COMMIT')
|
|
245
330
|
return
|
|
246
331
|
self.execute(
|
|
247
332
|
'''
|
|
248
333
|
INSERT INTO Station (
|
|
249
334
|
system_id,
|
|
335
|
+
station_id,
|
|
250
336
|
name,
|
|
251
337
|
ls_from_star,
|
|
252
338
|
max_pad_size,
|
|
@@ -263,10 +349,11 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
263
349
|
)
|
|
264
350
|
VALUES (
|
|
265
351
|
(SELECT system_id FROM System WHERE upper(name) = ?),
|
|
266
|
-
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
|
|
352
|
+
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
|
|
267
353
|
)
|
|
268
354
|
''',
|
|
269
355
|
system.name.upper(),
|
|
356
|
+
station.id,
|
|
270
357
|
station.name,
|
|
271
358
|
station.distance,
|
|
272
359
|
station.max_pad_size,
|
|
@@ -281,26 +368,26 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
281
368
|
station.modified,
|
|
282
369
|
station.type,
|
|
283
370
|
)
|
|
284
|
-
self.
|
|
285
|
-
if self.tdenv.detail
|
|
371
|
+
self.execute('COMMIT')
|
|
372
|
+
if self.tdenv.detail > 1:
|
|
286
373
|
self.print(f' | {station.name:50s} | Added missing station')
|
|
287
|
-
self.
|
|
374
|
+
self.known_stations[station.id]= station.name
|
|
288
375
|
|
|
289
|
-
def ensure_commodity(self,
|
|
376
|
+
def ensure_commodity(self, commodity):
|
|
290
377
|
if commodity.id in self.known_commodities:
|
|
291
|
-
if self.known_commodities[commodity.id] != commodity.name:
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
378
|
+
# if self.known_commodities[commodity.id] != commodity.name:
|
|
379
|
+
# if self.tdenv.detail >= 3:
|
|
380
|
+
# self.print(f' | - {commodity.name:45s} | Replace with pre-existing "{self.known_commodities[commodity.id]}"')
|
|
381
|
+
# return Commodity(
|
|
382
|
+
# id=commodity.id,
|
|
383
|
+
# name=self.known_commodities[commodity.id],
|
|
384
|
+
# category=commodity.category,
|
|
385
|
+
# demand=commodity.demand,
|
|
386
|
+
# supply=commodity.supply,
|
|
387
|
+
# sell=commodity.sell,
|
|
388
|
+
# buy=commodity.buy,
|
|
389
|
+
# modified=commodity.modified,
|
|
390
|
+
# )
|
|
304
391
|
return commodity
|
|
305
392
|
self.execute(
|
|
306
393
|
'''
|
|
@@ -333,8 +420,8 @@ class ImportPlugin(plugins.ImportPluginBase):
|
|
|
333
420
|
WHERE fdev_id = ?""",
|
|
334
421
|
ui_order, line[2],)
|
|
335
422
|
|
|
336
|
-
self.
|
|
337
|
-
if self.tdenv.detail
|
|
423
|
+
self.execute('COMMIT')
|
|
424
|
+
if self.tdenv.detail > 1:
|
|
338
425
|
self.print(f' | {commodity.name:50s} | Added missing commodity')
|
|
339
426
|
self.known_commodities[commodity.id] = commodity.name
|
|
340
427
|
return commodity
|
|
@@ -355,7 +442,8 @@ def ingest_stream(stream):
|
|
|
355
442
|
coords = system_data.get('coords', {})
|
|
356
443
|
yield (
|
|
357
444
|
System(
|
|
358
|
-
|
|
445
|
+
id = system_data.get('id64'),
|
|
446
|
+
name=system_data.get('name', 'Unnamed').strip(),
|
|
359
447
|
pos_x=coords.get('x', 999999),
|
|
360
448
|
pos_y=coords.get('y', 999999),
|
|
361
449
|
pos_z=coords.get('z', 999999),
|
|
@@ -368,7 +456,6 @@ def ingest_stream(stream):
|
|
|
368
456
|
def ingest_stations(system_data):
|
|
369
457
|
"""Ingest system-level data, yielding station-level data."""
|
|
370
458
|
targets = [system_data, *system_data.get('bodies', ())]
|
|
371
|
-
is_planetary = False
|
|
372
459
|
for target in targets:
|
|
373
460
|
for station_data in target.get('stations', ()):
|
|
374
461
|
services = set(station_data.get('services', ()))
|
|
@@ -387,7 +474,8 @@ def ingest_stations(system_data):
|
|
|
387
474
|
max_pad_size = 'S'
|
|
388
475
|
yield (
|
|
389
476
|
Station(
|
|
390
|
-
|
|
477
|
+
id = station_data.get('id'),
|
|
478
|
+
name=station_data.get('name', 'Unnamed').strip(),
|
|
391
479
|
distance=station_data.get('distanceToArrival', 999999),
|
|
392
480
|
max_pad_size=max_pad_size,
|
|
393
481
|
market=True,
|
|
@@ -397,14 +485,12 @@ def ingest_stations(system_data):
|
|
|
397
485
|
rearm='Restock' in services,
|
|
398
486
|
refuel='Refuel' in services,
|
|
399
487
|
repair='Repair' in services,
|
|
400
|
-
planetary=
|
|
401
|
-
type=STATION_TYPE_MAP.get(station_data.get('type')
|
|
488
|
+
planetary=STATION_TYPE_MAP.get(station_data.get('type'))[1] or False,
|
|
489
|
+
type=STATION_TYPE_MAP.get(station_data.get('type'))[0] or 0,
|
|
402
490
|
modified=parse_ts(station_data.get('updateTime')),
|
|
403
491
|
),
|
|
404
492
|
ingest_market(market),
|
|
405
493
|
)
|
|
406
|
-
# first target is system stations, everything else is planetary
|
|
407
|
-
is_planetary = True
|
|
408
494
|
|
|
409
495
|
|
|
410
496
|
def ingest_market(market):
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
unq:category_id,name
|
|
2
|
+
1,'Chemicals'
|
|
3
|
+
2,'Consumer Items'
|
|
4
|
+
3,'Legal Drugs'
|
|
5
|
+
4,'Foods'
|
|
6
|
+
5,'Industrial Materials'
|
|
7
|
+
6,'Machinery'
|
|
8
|
+
7,'Medicines'
|
|
9
|
+
8,'Metals'
|
|
10
|
+
9,'Minerals'
|
|
11
|
+
10,'Slavery'
|
|
12
|
+
11,'Technology'
|
|
13
|
+
12,'Textiles'
|
|
14
|
+
13,'Waste'
|
|
15
|
+
14,'Weapons'
|
|
16
|
+
15,'Unknown'
|
|
17
|
+
16,'Salvage'
|
tradedangerous/tradedb.py
CHANGED
|
@@ -648,6 +648,7 @@ class TradeDB(object):
|
|
|
648
648
|
|
|
649
649
|
fs.copy_if_newer((self.templatePath / Path("Added.csv")), (self.csvPath / Path("Added.csv")))
|
|
650
650
|
fs.copy_if_newer((self.templatePath / Path("RareItem.csv")), (self.csvPath / Path("RareItem.csv")))
|
|
651
|
+
fs.copy_if_newer((self.templatePath / Path("Category.csv")), (self.csvPath / Path("Category.csv")))
|
|
651
652
|
fs.copy_if_newer((self.templatePath / Path("TradeDangerous.sql")), (self.dataPath / Path("TradeDangerous.sql")))
|
|
652
653
|
|
|
653
654
|
self.dbPath = Path(tdenv.dbFilename or dataPath / TradeDB.defaultDB)
|
tradedangerous/version.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: tradedangerous
|
|
3
|
-
Version: 10.
|
|
3
|
+
Version: 10.16.1
|
|
4
4
|
Summary: Trade-Dangerous is a set of powerful trading tools for Elite Dangerous, organized around one of the most powerful trade run optimizers available.
|
|
5
5
|
Home-page: https://github.com/eyeonus/Trade-Dangerous
|
|
6
6
|
Author: eyeonus
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
tradedangerous/__init__.py,sha256=5ZeypoZaM8hlh6c-yTkD8x5hZYP8q3Q8a3bVeicHr90,1122
|
|
2
|
-
tradedangerous/cache.py,sha256=
|
|
2
|
+
tradedangerous/cache.py,sha256=MIoNCWE3AJohhx0r4m5xgf4C_4YkynWgfJyUokhuG98,33859
|
|
3
3
|
tradedangerous/cli.py,sha256=ycGkzMszwpP9OrngFIyhQbYoZ2wzRhJMTDCW1YhLrNI,4727
|
|
4
4
|
tradedangerous/corrections.py,sha256=QMs-7MKLw2imFgIHthnwcpqWT1yJTb3CrABJw9LaKLA,1441
|
|
5
5
|
tradedangerous/csvexport.py,sha256=OcOKe_VIgafw6rCvG3k5tM11KwwoYXMNY5DSSfCC0mU,8705
|
|
@@ -15,13 +15,13 @@ tradedangerous/submit-distances.py,sha256=lEHtCLUzR2QNRrgPD-PkDIzHYYHOODZVTRxDsA
|
|
|
15
15
|
tradedangerous/tools.py,sha256=pp-4WtA12SVaaQHFJFOMTF7EDFRCU2mQeOhC4xoXmEk,1331
|
|
16
16
|
tradedangerous/trade.py,sha256=vBEJZR3Bybesw9FMelcHOTRA7KqKeH-4_wqbJ4VMB_E,1779
|
|
17
17
|
tradedangerous/tradecalc.py,sha256=GyuYZNuyfn0y0eoPbxDEI7dxTJtHmRXAKFMpiR0Z1iU,42004
|
|
18
|
-
tradedangerous/tradedb.py,sha256=
|
|
18
|
+
tradedangerous/tradedb.py,sha256=VZHv_U1_EXRFUQbB5nS6YFlFKTO2zbrw37q4YWB2Jjc,73459
|
|
19
19
|
tradedangerous/tradeenv.py,sha256=FeeSvDI4Zpi5hJk2UAwrR_0Y7Y_gtYH0ofPEHKHLEBY,4412
|
|
20
20
|
tradedangerous/tradeexcept.py,sha256=aZ-Y31MbkjF7lmAzBAbaMsPPE7FEEfuf4gaX2GvriDk,368
|
|
21
21
|
tradedangerous/tradegui.py,sha256=JbGFnsWupgesk6hrcUgKSdD9NNDyo0U9gh6m3DccAwU,782
|
|
22
22
|
tradedangerous/transfers.py,sha256=NmXXk2aF88YkAvYqc9Syt_aO6d2jJjC-OxoRFoOyQH4,9923
|
|
23
23
|
tradedangerous/utils.py,sha256=PUPvAEqUyxYGqqQa0b_yfLAvq8YVUxK6HfdS-CxM-Lo,5186
|
|
24
|
-
tradedangerous/version.py,sha256=
|
|
24
|
+
tradedangerous/version.py,sha256=RqmS4iVwJ9QzcB35EvHKE2AZG7oAO5y7RdQfn6ZvRGo,647
|
|
25
25
|
tradedangerous/commands/TEMPLATE.py,sha256=7oXL124aqxGHwnb0h9yRylUiwc6M5QrRrGVrubwI1gg,2124
|
|
26
26
|
tradedangerous/commands/__init__.py,sha256=6B0WuqkFBOll5Hj67yKDAnhmyr5ZAnHc6nzUNEUh384,9640
|
|
27
27
|
tradedangerous/commands/buildcache_cmd.py,sha256=oJvP06fA8svnHrfrpWkHKR16cba8GIhHdMOyZqds18Y,2332
|
|
@@ -62,18 +62,18 @@ tradedangerous/misc/progress.py,sha256=-_V7E51sIYUtSxeeA1cphBEW4A_OBuH1guEDxUjik
|
|
|
62
62
|
tradedangerous/plugins/__init__.py,sha256=zCEVbTem1CAM1cOV9r96H3ikjqza3dd-XoaubE5_xkc,7868
|
|
63
63
|
tradedangerous/plugins/edapi_plug.py,sha256=IQxfDGM9IqwuJbDZRL8RFIyGMWzd0YmeJVWUVPDA3Ik,42275
|
|
64
64
|
tradedangerous/plugins/edcd_plug.py,sha256=ZPtRzLhcQZEiwEo3AoPyk3Uy4UmRLM6gv2Qi1s7K_Vs,14469
|
|
65
|
-
tradedangerous/plugins/eddblink_plug.py,sha256=
|
|
65
|
+
tradedangerous/plugins/eddblink_plug.py,sha256=Ne_5ltiWC1M3MOxS6XaY0DyESJL3XaGI9f-uLf67YiQ,21681
|
|
66
66
|
tradedangerous/plugins/edmc_batch_plug.py,sha256=3Ptr-SZqaZFR8ViIIrp9Ak7rvfU3zl11AZYBhIceN7s,4224
|
|
67
67
|
tradedangerous/plugins/journal_plug.py,sha256=K1oIeI7E3mb04fvYLXyoAh7fOTyM9NBelibTI88MIDQ,23696
|
|
68
68
|
tradedangerous/plugins/netlog_plug.py,sha256=Gw_HSZWpN17D--OIYEM3Vo8y9SvDOv9UwAUfY24kz28,13460
|
|
69
|
-
tradedangerous/plugins/spansh_plug.py,sha256=
|
|
69
|
+
tradedangerous/plugins/spansh_plug.py,sha256=dDX34KEt_jSjwyP45utQTUgB-oew__F1sYcPb209bC8,21334
|
|
70
70
|
tradedangerous/templates/Added.csv,sha256=8o54civQCcS9y7_DBo0GX196XWRbbREQqKDYTKibsgQ,649
|
|
71
|
-
tradedangerous/templates/
|
|
71
|
+
tradedangerous/templates/Category.csv,sha256=8xwUDcBZE25T6x6dZGlRUMTCqeDLt3a9LXU5h6hRHV8,250
|
|
72
72
|
tradedangerous/templates/RareItem.csv,sha256=F1RhRnTD82PiwrVUO-ai2ErGH2PTqNnQaDw5mcgljXs,10483
|
|
73
73
|
tradedangerous/templates/TradeDangerous.sql,sha256=6sjEogGHy-9zYpjPo0Y2a5tElowmHFyJNwrimOUBfHk,8079
|
|
74
|
-
tradedangerous-10.
|
|
75
|
-
tradedangerous-10.
|
|
76
|
-
tradedangerous-10.
|
|
77
|
-
tradedangerous-10.
|
|
78
|
-
tradedangerous-10.
|
|
79
|
-
tradedangerous-10.
|
|
74
|
+
tradedangerous-10.16.1.dist-info/LICENSE,sha256=HyVuytGSiAUQ6ErWBHTqt1iSGHhLmlC8fO7jTCuR8dU,16725
|
|
75
|
+
tradedangerous-10.16.1.dist-info/METADATA,sha256=b-_m5kXwu5FeCdMaBZDH7p0YQyCjeyxn-42y1VkmTTk,4421
|
|
76
|
+
tradedangerous-10.16.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
77
|
+
tradedangerous-10.16.1.dist-info/entry_points.txt,sha256=pSwa-q0ob443uiKux7xFKYQl8uen66iDTnjdrQhNLx8,92
|
|
78
|
+
tradedangerous-10.16.1.dist-info/top_level.txt,sha256=bF29i-oEltmNICgElEKxNsg83oahJvxg3a7YrxZi9Rk,15
|
|
79
|
+
tradedangerous-10.16.1.dist-info/RECORD,,
|