How to use the hyperlink.DecodedURL.from_text function in hyperlink

To help you get started, we’ve selected a few hyperlink examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alexwlchan / docstore / src / api.py View on Github external
return jsonify({
                "error": f"Unrecognised sort parameter: {sort_param}"}), 400

        sorted_documents = sorted(
            matching_documents.items(),
            key=lambda doc: doc[1].get(sort_field, ""),
            reverse=sort_order_reverse
        )

        display_documents = sorted_documents

        tag_aggregation = search_helpers.get_tag_aggregation(
            [doc for (_, doc) in display_documents]
        )

        req_url = hyperlink.DecodedURL.from_text(request.url)

        params = {k: v for k, v in request.args.items()}
        try:
            params["_message"] = json.loads(params["_message"])
        except KeyError:
            pass

        view_options = viewer.ViewOptions(
            list_view=request.args.get("view", self.config.list_view),
            tag_view=self.config.tag_view,
            expand_document_form=(request.cookies.get('form-collapse__show') == 'true'),
            expand_tag_list=(request.cookies.get('tags-collapse__show') == 'true')
        )

        pagination = Pagination(
            page_size=page_size,

hyperlink

A featureful, immutable, and correct URL for Python.

MIT
Latest version published 4 years ago

Package Health Score

76 / 100
Full package analysis