or run

tessl search
Log in

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/furl@2.1.x
tile.json

tessl/pypi-furl

tessl install tessl/pypi-furl@2.1.0

URL manipulation made simple.

Agent Success

Agent success rate when using this tile

65%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.59x

Baseline

Agent success rate without this tile

41%

task.mdevals/scenario-1/

Multivalue Query Controls

Build a helper that adjusts multivalue query parameters on a URL while preserving order and returning the final values for a target key. Operations run in order: replacements overwrite listed keys, additions append new entries afterward, and an optional removal then drops a single matching occurrence.

Capabilities

Append values without losing existing ones

  • Given a URL that already has repeated parameters, adding new values for the same keys appends each value individually after the existing entries and preserves other keys unchanged. @test

Remove only one matching entry

  • Removing a specific key/value pair deletes a single matching occurrence while leaving other values for that key intact and ordered. @test

Replace an entire key set

  • Replacements swap all existing values for selected keys with the provided lists while leaving untouched keys as-is. @test

Report all values for a key

  • After updates, the helper returns every value for a requested key in order (or an empty list when absent) along with the updated URL string. @test

Implementation

@generates

API

from typing import Dict, List, Optional, Tuple

def apply_query_controls(
    url: str,
    additions: Dict[str, List[str]],
    removal: Optional[Tuple[str, str]],
    replacements: Dict[str, List[str]],
    read_key: str,
) -> Tuple[str, List[str]]:
    """
    Adjust multivalue query parameters on the given URL.

    - `replacements` overwrites all existing values for listed keys with the provided lists, in the order given.
    - Each list in `additions` then appends individual query entries after current values for that key, preserving overall ordering of other keys.
    - `removal`, when provided, removes one matching value for the given key without disturbing other values for that key.
    - Returns a tuple of the updated URL string and the ordered values for `read_key` after all operations.
    """

Dependencies { .dependencies }

furl { .dependency }

Provides URL parsing and ordered multivalue query handling.