Skip to content

v2.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 03 Sep 15:53
· 113 commits to future since this release
5bc64ed

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 function
  • surplus.parse_query(), the function

what has changed

  • surplus.surplus()

    1. reverser and debug arguments are now under the unified surplus.Behaviour object
    2. function now returns a surplus.Result[str] for safer error handling
  • surplus.parse_query()

    1. query and debug arguments are now under the unified surplus.Behaviour object
    2. function now returns a surplus.Result[surplus.Query] for safer error handling
  • surplus.Latlong

    attributes lat and long have been renamed to latitude and longitude respectively

  • surplus.Localcode

    renamed to surplus.LocalCodeQuery

  • Localcode.full_length()

    renamed to LocalCodeQuery.to_full_plus_code(), and returns a surplus.Result[str] for safer error handling

v1.1.3...v2.0.0