Closed L4in closed 8 years ago
There is currently a work-around for python syntax clashes.
nationstates.Shard("census", scale="all", mode="history", **{"from":"one_week_ago"})
Other python modules will sometimes use something like _from
, but that's not currently supported.
I would like to implement a watcher system that reports all changes in a nation's census since last week. For the moment, I built a shard
nationstates.Shard("census", scale="all", mode="history")
, collect the data and manually browse the points until I find the desired timestamp.Using
nationstates.Shard("census", scale="all", mode="history",from="one_week_ago")
would be the best option server-wise, as it would reduce network usage and not contain any unneeded data, thus being in accord with the Nationstates API. Alas, the keywordfrom
is reserved in Python and cannot be used in this way as it yield aSyntaxError
The current implementation put an unneeded strain on the server as it forces to fetch much more data than needed. This is specially true for quite old nations, with great amounts of data points.