Metadata-Version: 2.4
Name: tezaursapi
Version: 0.1.0
Summary: Python wrapperis priekš Tezaurs.lv API
Author-email: nrenars <neimanis.renars@gmail.com>
License: MIT License
        
        Copyright (c) 2025 nrenars
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/nrenars/tezaurs
Project-URL: Issues, https://github.com/nrenars/tezaurs/issues
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: xmltodict
Dynamic: license-file

# Tezaurs API Wrapper

Tezaurs API Wrapper ir Python bibliotēka, kas ļauj ērti piekļūt [Tezaurs.lv](https://tezaurs.lv/) latviešu valodas vārdnīcas datubāzei caur API. Šī bibliotēka atvieglo vārdu locījumu, datu, un informācijas meklēšanu.

## Iespējas

- Atgriezt morfoloģisko vārda analīzi json formātā.
- Atgriezt informaciju par katru teikuma vārdu json formātā.
- Atgriezt katru vārda locījumu izvēlētajā formātā (json vai xml).
- Atgriezt frāzi katrā locījumā json formātā.
- Atrgiezt cilvēka vārdu un/vai uzvārdu katrā locījumā izvēlētajā formātā (json vai xml).
- Atgriezt vārda visas formas, locījumus un konjugācijas json formātā.
- Atgriezt frāzes normalizēto formu kā string.
- Atgriezt vārda iespējamos paradigmu tipus json formātā.
- Atgriezt katra vārda morfoloģisko marķējumu kā string.
- Vienkārša piekļuve vārdnīcas ierakstiem
- API pieprasījumu un atbilžu apstrāde ar kļūdu apstrādi
- Paplašināma dažādiem pielietojumiem

## Uzstādīšana

Klonējiet šo repozitoriju un instalējiet dependencies:

```bash
git clone https://github.com/nrenars/tezaurs-api-wrapper.git
cd tezaurs-api-wrapper
pip install -r requirements.txt
```

## Lietošana

Piemērs, kā izmantot API wrapperi:

Vārda morfoloģiskās analīzes atgriešana json formātā ar analyze() funkciju:
```python
from tezaurs_api_wrapper import TezaursAPI

tezaurs = TezaursAPI()

rezultats = tezaurs.analyze('vārds')
print(rezultats)
```
Katra teikuma vārda informācijas atgriešana json formātā ar analyze_sentence() funkciju:
```python
from tezaurs_api_wrapper import TezaursAPI

tezaurs = TezaursAPI()

rezultats = tezaurs.analyze_sentence('Vīrs ar cirvi.')
print(rezultats)
```

### API Metodes

- `analyze(word: str) -> dict`  
- `analyze_sentence(word_id: str) -> dict`  
- `inflect(word: str, target_lang: str) -> dict`  
- `inflect_phrase(word: str, target_lang: str) -> dict`
- `inflections(word: str, target_lang: str) -> dict`
- `normalize(word: str, target_lang: str) -> dict`
- `suitable_paradigm(word: str, target_lang: str) -> dict`
- `morphotagger()`

## Licence

Projekts ir licencēts saskaņā ar MIT licenci. Skatiet [LICENSE](LICENSE) failu.

## Resursi

- [Tezaurs.lv](https://tezaurs.lv/)

---

_Šis projekts nav saistīts ar Tezaurs.lv._




