Tasnif Soliq UZ Client
A Python client for the tasnif.soliq.uz API, which provides access to the MXIK (National Classifier of Products) database in Uzbekistan.
Installation
pip install tsuz-search
Requirements
- Python 3.8+
- requests
- pydantic
Usage
Basic Usage
from tsuz_search import Client
# Initialize the client
client = Client()
# Search for MXIK codes
results = client.search_mxik("Kompyuter")
# Print the results
for item in results.data:
print(f"MXIK Code: {item.mxikCode}")
print(f"Name (UZ): {item.groupNameUz}")
print(f"Name (RU): {item.groupNameRu}")
print("---")
Advanced Search
from tsuz_search import Client, ElasticSearch, SearchParams
# Initialize the client
client = Client()
# Search using ElasticSearch
search_params = ElasticSearch(
search="телефон",
size=50,
page=0,
lang="ru"
)
results = client.search(search_params)
# Search using parameters
params = SearchParams(
params={"mxikCode": "12345"},
size=20,
page=0,
lang="uz"
)
results_by_params = client.search_by_params(params)
Custom Base URL
from tsuz_search import Client
# Initialize the client with a custom base URL
client = Client(base_url="https://custom-tasnif-api.example.com/api")
API Reference
Client
The main client class for interacting with the tasnif.soliq.uz API.
Constructor
Client(base_url: str = "https://tasnif.soliq.uz/api/cls-api")
base_url: The base URL for the API. Defaults to the official API endpoint.
Methods
search_mxik
search_mxik(query: str, limit: int = 10) -> MXIKSearchResponse
Search for MXIK codes by a simple text query.
query: The search query text.limit: Maximum number of results to return. Defaults to 10.
search
search(params: ElasticSearch) -> List[MxikData]
Search using ElasticSearch parameters.
params: AnElasticSearchobject containing search parameters.
search_by_params
search_by_params(params: SearchParams) -> List[MxikData]
Search by specific parameters.
params: ASearchParamsobject containing search parameters.
search_dv_cert
search_dv_cert(params: SearchParams) -> List[MxikData]
Search by DV certificate number.
params: ASearchParamsobject containing search parameters.
Models
ElasticSearch
ElasticSearch(
search: str,
size: int = 20,
page: int = 0,
lang: str = "uz"
)
search: The search query text.size: Number of results per page. Defaults to 20.page: Page number (0-based). Defaults to 0.lang: Language code ("uz", "ru", or "en"). Defaults to "uz".
SearchParams
SearchParams(
params: Dict[str, Any],
size: int = 20,
page: int = 0,
lang: str = "uz"
)
params: Dictionary of search parameters.size: Number of results per page. Defaults to 20.page: Page number (0-based). Defaults to 0.lang: Language code ("uz", "ru", or "en"). Defaults to "uz".
MxikData
Represents MXIK data returned by the API.
MxikResponse
Represents a response from the API containing a single MXIK item.
MXIKSearchResponse
Represents a response from the API containing a list of MXIK items.
Development
Setup Development Environment
# Clone the repository
git clone https://github.com/aslon1213/tsuz-search.git
cd tsuz-search
# Install development dependencies
pip install -e ".[dev]"
Running Tests
# Run all tests
python -m test.run_tests
# Run with pytest
pytest
License
MIT License
Metadata
Release files for tsuz-search 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tsuz_search-0.1.2.tar.gz | 3.7 kB | Without provenance | Details for tsuz_search-0.1.2.tar.gz |
Release files / tsuz_search-0.1.2.tar.gz
| Download URL | tsuz_search-0.1.2.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5bda54844f7634d84af83392e432e98b34a7f4528840d1791ecaa8f967a4f7c1
|
|
BLAKE2b-256 checksum How to use checksums |
6d3d31d05d32dc9ee2943e7ab003f2b6fb79289fbd48352cfcabe697e8496b95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.6
|
Security for tsuz-search 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.