Skip to content

Filter countries, languages and tags by name - #1581

Merged
frenck merged 1 commit into
mainfrom
frenck/list-name-filter
Oct 1, 2026
Merged

frenck merged 1 commit into
mainfrom
frenck/list-name-filter

Conversation

@frenck

@frenck frenck commented Oct 1, 2026

Copy link
Copy Markdown
Owner

Breaking change

None. A new optional argument.

Proposed change

The API can filter the languages, tags and countries lists on part of their name, which is what you need for autocompletion. The library could only fetch the whole list.

countries(), languages() and tags() now take a name argument:

  • For languages and tags, the API does the filtering through a path segment. It matches case sensitive, on names it stores in lowercase, so languages/Dutch finds nothing while the library itself returns "Dutch". The filter is lowercased first, and escaped like the other path segments.
  • For countries, the API can only filter on the country code, so the library filters on the resolved name itself, ignoring case and accents: countries(name="aland") finds "Åland Islands".

Checked against the live API: languages(name="Dutch") returns Dutch and Dutch Colombo, tags(name="jazz") returns the jazz tags, and countries(name="land") includes Åland Islands. Documented in the README.

Type of change

  • Dependency or tooling upgrade
  • Bugfix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Deprecation (replaces or removes a feature, with a migration path)
  • Breaking change (a fix or feature that changes existing behavior)
  • Code quality, refactor, or test-only change
  • Documentation only

Additional information

  • This PR fixes or closes issue: fixes # None
  • This PR is related to: None
  • Link to a separate documentation pull request: None

Checklist

  • I fully understand the code in this pull request and can explain every line, including any AI-assisted changes.
  • The change is covered by tests, and poetry run pytest passes locally. A pull request cannot be merged unless CI is green.
  • poetry run prek run --all-files passes (lint, format, and type checks).
  • No commented-out or dead code is left in the pull request.

@frenck frenck added the new-feature New features or options. label Oct 1, 2026
Languages and tags are filtered by the API, on their lowercase name.
Countries are filtered on the resolved name, ignoring case and accents.
@frenck
frenck force-pushed the frenck/list-name-filter branch from 3cb8551 to 18a571b Compare October 1, 2026 17:18
@frenck
frenck merged commit 1669f28 into main Oct 1, 2026
30 checks passed
@frenck frenck mentioned this pull request Oct 1, 2026
4 of 11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant