Skip to main content

CPV semantic annotation CLI tool — annotate natural language queries with brand, category, metric, and attribute entities

Project description

cpvmatch-cli

PyPI version Python

Semantic annotation CLI tool for CPV entity recognition. Supports brand, category, metric, and attribute entity identification in natural language queries.

Install

# From PyPI (recommended)
pip install cpvmatch-cli

# Or via uv
uv tool install cpvmatch-cli

# Or run without installing
uvx cpvmatch-cli

Quick Start

1. Configure API Key

Option 1: Environment variable (recommended)

export CPVMATCH_APIKEY="your-api-key-here"

Option 2: Login to save locally

cpvmatch-cli login
# Or pipe the key directly
echo "your-api-key-here" | cpvmatch-cli login

Option 3: Pass as argument

cpvmatch-cli annotation -q 'question' -k "your-api-key-here"

2. Annotate

cpvmatch-cli annotation -q '元气森林今年的销售额'
cpvmatch-cli annotation -q '查询元气森林无糖茶在即饮茶的市占率'

# Specify category scope
cpvmatch-cli annotation -q '元气森林销售额' --attribute-categories '饮料,食品'

# Disable full mode
cpvmatch-cli annotation -q '元气森林销售额' --no-full-mode

CLI Commands

login

Save API Key to ~/.cpvmatch/config.json.

cpvmatch-cli login

annotation

Annotate a natural language question.

Flag Description
-q, --question Natural language question to annotate (required)
-k, --apikey API Key (optional if set via env or login)
--full-mode / --no-full-mode Enable/disable full mode (default: enabled)
--attribute-categories Category scope, comma-separated, e.g., 饮料,食品

API Key Priority

CLI argument > CPVMATCH_APIKEY env var > saved config via cpvmatch-cli login

Development

# Install dependencies
uv sync

# Run tests
uv run pytest tests/ -v

# Lint
uv run ruff check .

# Format
uv run ruff format .

# Install locally
uv tool install .

Project Structure

cpvmatch-cli/
├── cpvmatch_cli/
│   ├── __init__.py    # Package init, version
│   ├── api.py         # HTTP API client
│   ├── cli.py         # Typer CLI commands
│   └── config.py      # Local config management
├── tests/
│   ├── test_api.py
│   ├── test_cli.py
│   └── test_config.py
├── pyproject.toml
├── Justfile

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

cpvmatch_cli-0.1.3.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

cpvmatch_cli-0.1.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file cpvmatch_cli-0.1.3.tar.gz.

File metadata

  • Download URL: cpvmatch_cli-0.1.3.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cpvmatch_cli-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7eec05a807885512df841c67023a206af45b73264e93cf2db5f14d034c753043
MD5 40e16a62675a266ca983d4f68ea86775
BLAKE2b-256 c39e0509618714512db478b9cc2379649c84a35435ad6675be68703191c2eac9

See more details on using hashes here.

File details

Details for the file cpvmatch_cli-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: cpvmatch_cli-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.0 {"installer":{"name":"uv","version":"0.11.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cpvmatch_cli-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b0105b9549751b6ebe795c8fde3a52cbdb6ed38a27ebd5c42e2a550b9e771f30
MD5 24100020e09bdfc0f86d0c52e7b50e6a
BLAKE2b-256 7f01ea26bf4094009ece3210732b516803283150a469dfb3b009767aef08540c

See more details on using hashes here.

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