Parse Drakdoo response into model fields

This commit is contained in:
2022-10-15 23:28:46 +01:00
parent 20a4e21eaa
commit bc27748396
4 changed files with 35 additions and 12 deletions

View File

@@ -1,18 +1,21 @@
from serde import Model, fields
class Market(Model):
exchange = fields.Str()
item = fields.Str()
currency = fields.Str()
contract = fields.Str()
class Timestamp(Model):
sent = fields.DateTime()
trade = fields.DateTime()
class BaseDrakdoo(Model):
title = fields.Str()
message = fields.Str()
period = fields.Str()
market = fields.Nested(Market)
timestamp = fields.Nested(Timestamp)
timestamp = fields.Nested(Timestamp)