Skip to main content

IKPU/MXIK product classifier for Uzbekistan tax codes

Project description

ikpu

Python library for matching products with IKPU/MXIK codes (Uzbekistan tax classification) by product name or barcode.

Uses TF-IDF similarity search over the official tasnif.soliq.uz catalog.

Installation

pip install ikpu

With FastAPI server support:

pip install ikpu[server]

Quick Start

from ikpu import IKPUMatcher

matcher = IKPUMatcher()

# Download the catalog (first time only)
matcher.update()

# Load indexes
matcher.load()

# Search by product name
results = matcher.search("Coca-Cola 0.5", language="ru", top_k=5)
for r in results:
    print(f"{r['ikpu']}{r['name']} ({r['similarity']:.2f})")

# Search by barcode
results = matcher.search_barcode("4600494600029", language="ru")

API Server

# Start the server
ikpu-server

# Or with uvicorn directly
uvicorn ikpu.api:app --host 0.0.0.0 --port 8044

Endpoints

Method Path Description
POST /search Search by name or barcode
GET /health Service status
POST /rebuild-cache Rebuild TF-IDF indexes
POST /check-update Check for catalog updates

POST /search

{
  "query": "Coca-Cola 0.5",
  "barcode": null,
  "language": "ru",
  "top_k": 5
}

CLI

# Download/update the IKPU catalog
ikpu-update

Configuration

Data is stored in ~/.ikpu/data/ by default. Override with the IKPU_DATA_DIR environment variable:

export IKPU_DATA_DIR=/path/to/custom/dir

Supported Languages

  • ru — Russian
  • uz_cyrl — Uzbek (Cyrillic)
  • uz_latn — Uzbek (Latin)

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

ikpu-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

ikpu-0.1.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file ikpu-0.1.0.tar.gz.

File metadata

  • Download URL: ikpu-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for ikpu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 273dc8d62404ba57d68940c2a6c8d9499fa927ffbd783f92b48ebe31c14cfccd
MD5 aa6b4eebf0c5ae5eadeace6818d6f022
BLAKE2b-256 21dc5e264bef0c294fbf60e22b1a19be76c1d34b4509e289546ce5cbc7593e60

See more details on using hashes here.

File details

Details for the file ikpu-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ikpu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for ikpu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16a201a1f37580f8799d691a90e69c6370d0aefa11431b6ec7aa494116d61e71
MD5 3a584f2ed9a9e5580acf65011e90bf88
BLAKE2b-256 01cadb09fb80b64e9c23b5167ae8085b6348593ce659e2136d124bd898710b2e

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