Skip to main content

Minimal Python client for the EUIPO trademark search API

Project description

euipo-tm-client

Minimal Python client for the EUIPO (European Union Intellectual Property Office) trademark search API.

It is a thin, synchronous wrapper (built on httpx) that handles OAuth2 authentication and returns responses as raw parsed JSON (dict). It covers the two core endpoints: searching for trade marks and retrieving the details of a single trade mark.

Installation

pip install euipo-tm-client

Configuration

The client reads credentials from environment variables (you can keep them in a .env file in the working directory — real environment variables take precedence):

Variable Description
EUIPO_API_KEY Your application's client ID
EUIPO_API_SECRET Your application's client secret
EUIPO_ENVIRONMENT "sandbox" (default) or "production"

Obtain credentials and subscribe your application to the Trademark search API plan via the EUIPO developer portal.

Usage

from euipo_tm_client import TrademarkSearchClient

with TrademarkSearchClient() as client:
    # Search using an RSQL query expression.
    results = client.search_trademarks(
        query="wordMarkSpecification.verbalElement==apple",
        size=10,
    )
    print(results["totalElements"])
    for tm in results["trademarks"]:
        print(tm["applicationNumber"], tm.get("status"))

    # Retrieve full details for one trade mark.
    detail = client.get_trademark("018692868", language="en")
    print(detail["status"])

Credentials and environment can also be passed explicitly instead of via the environment:

client = TrademarkSearchClient(
    api_key="...", api_secret="...", environment="production",
)

Errors

API and authentication failures raise typed exceptions, all subclasses of EUIPOError:

  • EUIPOAuthError — token acquisition failed.
  • EUIPOAPIError — the API returned a non-2xx response; exposes .status_code and the parsed .body.

Query language (RSQL)

The query argument of search_trademarks() accepts an RSQL (REST Query Language) expression — a compact, URL-friendly filter syntax. A clause is field + operator + value, and clauses combine with and / or (use parentheses to group). RSQL avoids unsafe characters, so no URL encoding is needed.

Comparison operators:

Operator Meaning
== equal to (supports * as a wildcard)
!= not equal to (supports * as a wildcard)
< <= > >= range comparison (dates and numbers)
=in= in a set, e.g. =in=(WORD,FIGURATIVE)
=out= not in a set
=all= contains all of a set

Each field supports only a subset of these operators. Date fields (applicationDate, registrationDate, expiryDate, …) expect yyyy-MM-dd values. Examples:

# Verbal element exactly "apple"
wordMarkSpecification.verbalElement==apple

# Wildcard match + status, with nice-class membership
niceClasses=all=(25,28,40) and wordMarkSpecification.verbalElement==*Dog* and status==REGISTERED

# Date range with grouped OR logic
applicationDate>=2023-05-04 and ((markFeature==FIGURATIVE and niceClasses=all=(25,26)) or (markFeature==WORD and niceClasses=out=(40)))

The full grammar, the list of supported fields, and the operators each field allows are documented in the query parameter of the OpenAPI spec (specs/openapi.json).

Development

This project is managed with uv.

uv sync          # install dependencies
uv run pytest    # run the test suite (mocks HTTP; no live credentials needed)
uv run main.py   # run the live sandbox demo (requires credentials)

Releasing

Releases publish to PyPI automatically when a GitHub Release is published — see RELEASING.md.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

euipo_tm_client-0.1.1.tar.gz (26.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

euipo_tm_client-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file euipo_tm_client-0.1.1.tar.gz.

File metadata

  • Download URL: euipo_tm_client-0.1.1.tar.gz
  • Upload date:
  • Size: 26.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for euipo_tm_client-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dfcf45574c41c3a09320ee88080408488f82a6eae532afa501a88f3d9ac9ad7b
MD5 9b94de7e57602347ab91d9ab9b447a0b
BLAKE2b-256 75fb21a3804624a32f7fbefa4cbea131b284945fa757d370e9f1b98f885043e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for euipo_tm_client-0.1.1.tar.gz:

Publisher: publish.yml on anseljh/euipo-tm-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file euipo_tm_client-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: euipo_tm_client-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for euipo_tm_client-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e14e16bdae6dea4b2193abc343fa166ef5a9246b0ed165d15d6d182a86426727
MD5 901e03781b869ed2a83c60814ac1e483
BLAKE2b-256 9933ec96c1be95281b54c211cfb81612f6d173257c905dd8fd58b485170c171e

See more details on using hashes here.

Provenance

The following attestation bundles were made for euipo_tm_client-0.1.1-py3-none-any.whl:

Publisher: publish.yml on anseljh/euipo-tm-client

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page