semvec/pypi-packages huggingface dataset:
exitcode 0.1.0
Preferred system exit codes as defined by sysexits.h
License: MIT
Requires Python: >=3.10

# exitcode

Preferred system exit codes as defined by [`sysexits.h`](https://man.openbsd.org/sysexits).
This library is inspired by this [rust library](https://docs.rs/exitcode).

## Example

All constants from the manpage [sysexits(3)](https://man.openbsd.org/sysexits) are available without the `EX_` prefix.

``` python
import exitcode
import sys

sys.exit(exitcode.OK)
```
babla-translate 1.0
A module for translating words and generating examples using Bab.la dictionary.
License: MIT
Keywords: translation,scraper,api

# babla-translate
A Python module for translating words and generating examples using [Bab.la](https://bab.la) dictionary.

## Installation
```pip install babla_translate```

## Functions

Module contains class `Babla` with two functions:
```python
babla.translation(word, exact_word = 1)
babla.example(word, exact_word = 1)
```

`word`, accepts string, which you'd like to translate.\
`exact_word`, optional argument which takes int (1 by default), defining if function has to use the exact word; for example if for word 'used' translation of 'use' should also be shown.



## Entry point
All operations are implemented in class `Babla`.     
It takes source and target languages ("english", "polish", "german", "spanish"...) as required arguments.

```python
from babla_translate import Babla

babla = Babla("english", "polish")
```
All usable languages can be found [here](https://bab.la/dictionary/).


## Usage
* Getting translations:
```python
>>> list(babla.translation("use"))
['użyć', 'używać', 'wykorzystać', 'wykorzystywać', 'zastosować', 'skorzystać', 'zażyć',...]
```
* Getting examples:
```python
>>> for context in babla.example("use"):
...     print(context)
'This use of turmeric leaves usually takes place in areas where turmeric is grown locally, since the leaves used are freshly picked.'
```
All the functions return iterators to not request more results than needed.