python-shaarli-client icon indicating copy to clipboard operation
python-shaarli-client copied to clipboard

adding get_link() method and get-link endpoint

Open andreworg opened this issue 2 years ago • 1 comments

Hi all

I forked the repo and added a get_link() method and get-link endpoint to fetch a single link by id:

https://github.com/shaarli/python-shaarli-client/compare/master...andreworg:python-shaarli-client:andrew-get_link

I needed this for a project of mine (see https://github.com/shaarli/Shaarli/issues/1943); I think it also serves as partial workaround for https://github.com/shaarli/python-shaarli-client/issues/34 (you can use get_link() to fetch all data for an existing record, then use put_link() to update the record).

I'm writing this here before submitting a PR because I have not updated the test suite yet - I'm having trouble with that - and I was wondering what to do.

Thanks

andreworg avatar Feb 23 '23 17:02 andreworg

Hi @andreworg I think you should submit your patch (don't forget to update the documentation) About the tests, I think a simple copy of test_get_links_uri https://github.com/shaarli/python-shaarli-client/blob/master/tests/client/test_v1.py#L141 should be fine (just replace .get_links with .get_link)

We can start from there

nodiscc avatar Feb 08 '24 22:02 nodiscc