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.2.tar.gz (4.6 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.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cpvmatch_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 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.2.tar.gz
Algorithm Hash digest
SHA256 57f99ef44b43f3ca74cc710e00ea83de0fd1b63738553e73b80758710b276611
MD5 d4e9e4040a72cf5269838f2406b10686
BLAKE2b-256 09748f9b12cef7a6fc6d8469f928737b9eb8ef465c8e07d8804a712468adc33a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cpvmatch_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c46d66e6bd8befd8ff08fda3ef37df5092c9de00e8ed9a618464317aa903dbd
MD5 10b102c7c7d5788ff2273cd0c1d73467
BLAKE2b-256 d9e85011ea1a2c6bc1a881b25fd7821cd08428e74ce6c9e1d08fbd9460c03b65

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