v2.0.0
Warning
this is an api-breaking release. see 'the great api break'.
command-line usage of surplus has not changed.
Important
python 3.11 or later is required due to a bug in earlier versions.
(python/cpython#88089)
complete rewrite and string query support
install this release with pip:
pip install https://github.com/markjoshwel/surplus/releases/download/v2.0.0/surplus-2.0.0-py3-none-any.whl
changes
- surplus has been fully rewritten in #19
- support for string queries
$ s+ Wisma Atria surplus version 2.0.0 Wisma Atria 435 Orchard Road 238877 Central, Singapore
- mypy will now recognise surplus as a typed module
- python 3.11 is now the minimum version
the great api break
what is new
- nominatim keys are now stored in tuple constants
- surplus exception classes are now a thing
- surplus functions now operate using a unified
Behaviour
object - surplus functions now return a
Result
object for safer value retrieval instead of the previous(bool, value)
tuple - dedicated NamedTuple classes for each query type
what has been removed
-
surplus.handle_query()
instead, use
.to_lat_long_coord()
on your surplus 2.x query object
what has remained
surplus.surplus()
, the functionsurplus.parse_query()
, the function
what has changed
-
surplus.surplus()
reverser
anddebug
arguments are now under the unifiedsurplus.Behaviour
object- function now returns a
surplus.Result[str]
for safer error handling
-
surplus.parse_query()
query
anddebug
arguments are now under the unifiedsurplus.Behaviour
object- function now returns a
surplus.Result[surplus.Query]
for safer error handling
-
surplus.Latlong
attributes
lat
andlong
have been renamed tolatitude
andlongitude
respectively -
surplus.Localcode
renamed to
surplus.LocalCodeQuery
-
Localcode.full_length()
renamed to
LocalCodeQuery.to_full_plus_code()
, and returns asurplus.Result[str]
for safer error handling