Welcome to pyLinkwarden’s documentation!
Contents:
Modules
- class pyLinkwarden.utils.http.Helper(endpoint, params=None, headers=None)[source]
Bases:
objectHTTP client to make API calls to Linkwarden
- _delete(path, params=None, headers=None, data=None)[source]
Call DELETE against a URL
- _get(path, params=None, headers=None)[source]
Call GET against a URL
- _head(path, params=None, headers=None)[source]
Call HEAD against a URL
- _merge_dicts(base_dict, additional_dict)[source]
Merges two dictionaries, giving precedence to the additional_dict.
- _options(path, params=None, headers=None)[source]
Call OPTIONS against a URL
- _patch(path, data=None, params=None, headers=None)[source]
Call PATCH against a URL
- _post(path, data=None, params=None, headers=None)[source]
Call POST against a URL
- _put(path, data=None, params=None, headers=None)[source]
Call PUT against a URL
- _request(method, path, params=None, headers=None, data=None, **kwargs)[source]
General method to handle HTTP requests
- class pyLinkwarden.api.Client(endpoint, access_token=None)[source]
Bases:
objectInteracts with Linkwarden’s API
- class pyLinkwarden.content.Collections(client)[source]
Bases:
object- _get()[source]
Returns JSON of collections endpoint response.
- Returns:
JSON of link data
- _get_raw()[source]
Returns entirety of collections endpoint response.
- Returns:
Requests library response object
- delete(collection_id)[source]
Deletes a collection
- Parameters:
collection_id – Id of collection you wish to delete
- Returns:
Requests library response object
- list()[source]
Returns list of collections
- Returns:
List of collections
- class pyLinkwarden.content.Links(client)[source]
Bases:
object- _get(link_id=None, specific_attribute=None)[source]
Returns JSON of links endpoint response. Returns all links if link_id is not specified. Otherwise, returns the specific link.
- Parameters:
link_id – Id of the link that you wish to view. Optional.
specific_attribute – Returns the value of this attribute. Optional.
- Returns:
JSON of link data or the specific attribute’s value.
- _get_raw(link_id=None)[source]
Returns entirety of links endpoint response. Returns all links if link_id not specified. Otherwise, returns specific link.
- Parameters:
link_id – Id of link that you wish to view. Optional.
- Returns:
Requests library response object
- check_if_url_exists(url)[source]
Checks to see if the provided URL already exists.
- Parameters:
url – URL of page
- Returns:
True if page exists, False if page does not exist.
- delete(link_id)[source]
Deletes a link
- Parameters:
link_id – Id of link you wish to delete
- Returns:
Requests library response object
- list()[source]
Returns list of links
- Returns:
List of titles of links.
- list_all_urls()[source]
Lists all URLs in Linkwarden.
- Returns:
List of URLs
- class pyLinkwarden.content.Tags(client)[source]
Bases:
object- _get()[source]
Returns JSON of tags endpoint response.
- Returns:
JSON of link data
- _get_raw()[source]
Returns entirety of tags endpoint response.
- Returns:
Requests library response object
- delete(tag_id)[source]
Deletes a tag
- Parameters:
tag_id – Id of tag you wish to delete
- Returns:
Requests library response object
- list()[source]
Returns list of tags
- Returns:
List of tags
- rename(tag_id, new_name)[source]
Renames a tag
- Parameters:
tag_id – Id of tag you wish to rename
new_name – New name for tag to be renamed to
- Returns:
Requests library response object