semvec/pypi-packages huggingface dataset:
poka 0.1
Poka database interface

# Poka database interface
Interface buildet on mysql-connector

# Set up
```
pip install -r req.txt
```

# Usage

Create Poka instance
```
from poka_constructor import Poka

cfg = database config
poka_instance_1 = Poka(cfg)  # Set database config
```

Select table
```
from poka_constructor import Poka

cfg = database config
poka_instance_1 = Poka(cfg)  # Set database config
poka_instance_1.table("users")  # Set table
```

Select from table
```
from poka_constructor import Poka

cfg = database config
poka_instance_1 = Poka(cfg)  # Set database config
poka_instance_1.table("users")  # Set table
poka_instance_1.where("column", "=", value)  # Set where instruction
poka_instance_1.whereNotNull("column", "=", value)  # Set is not null check
poka_instance_1.whereIn("column", "args")  # Set where in instruction
poka_instance_1.get()  # Fetch records from table 
```

Insert to db
```
from poka_constructor import Poka

cfg = database config
poka_instance_1 = Poka(cfg)  # Set database config
poka_instance_1.table("users")  # Set table
poka_instance_1.insert({"colum_name": "value", "column_name2": "value"})  # Set insert data
```


Update records 
```
from poka_constructor import Poka

cfg = database config
poka_instance_1 = Poka(cfg)  # Set database config
poka_instance_1.table("users")  # Set table
poka_instance_1.update({"colum_name": "value", "column_name2": "value"})  # Set update data
```

Limit
```
from poka_constructor import Poka

cfg = database config
poka_instance_1 = Poka(cfg)  # Set database config
poka_instance_1.table("users")  # Set table
poka_instance_1.where("column", "=", value)  # Set where instruction
poka_instance_1.take(5)  # Set count of fetching records
poka_instance_1.get()  # Fetch records from table
```

Order by ASC | DESC
```
from poka_constructor import Poka

cfg = database config
poka_instance_1 = Poka(cfg)  # Set database config
poka_instance_1.table("users")  # Set table
poka_instance_1.where("column", "=", value)  # Set where instruction
poka_instance_1.take(5)  # Set count of fetching records
poka_instance_1.orderBy("column", "ASC")  # Set order by instruction
poka_instance_1.get()  # Fetch records from table
```

# One line requests
For example: Select from table
```
from poka_constructor import Poka

cfg = database config
poka_instance_1 = Poka(cfg)
                .table("users")
                .where("column", "=", value)
                .whereNotNull("column", "=", value)
                .whereIn("column", "args")
                .get() 
```
Other functions work the same.
CarryLessRangeCoder 1.0.2
Python implementation of carry-less range coder

Python implementation of carry-less range coder
===================================================

Both static and dynamic encoding can be used.

Install
-------

.. code-block:: bash

   $ pip install CarryLessRangeCoder

Examples
--------

.. code-block:: python

    from collections import Counter
    import carryless_rangecoder as rc
    from io import BytesIO

    data = list(map(ord, 'qawsedrftgyhujikolp;'))
    count = [1] * 256
    for i, c in Counter(data).items():
        count[i] += c
    count_cum = [0] * 256
    for i in range(1, 256):
        count_cum[i] = count[i] + count_cum[i - 1]

    out = BytesIO()
    # Encode
    with rc.Encoder(out) as enc:  # or enc.finish()
        for index in data:
            enc.encode(count, count_cum, index)
    # Decode
    decoded = []
    with rc.Decode(out) as dec:  # or dec.start()
        for _ in range(len(data)):
            decoded.append(dec.decode(count, count_cum))

    assert decoded == data
cli-formatter 1.2.0
An utility for cli script to prettify their output
Requires Python: >=3.6

# cli-formatter

cli-formatter is a python3 utility for formatting console output for cli scripts.

## Current Features

* Colored output
* Ability to control the verbosity level
* Two table factories for ASCII tables

## Installation

Install the package with pip

    pip3 install cli-formatter


## Examples

### Example 1

```python
from cli_formatter.output_formatting import info, warning, set_verbosity_level

set_verbosity_level(level=3)

info(message='This is a Info message')
info(message='This is a Info message with very low verbosity level', verbosity_level=1)
warning(message='This is a warning')
```

```
[+] This is a Info message
[!] This is a warning
```


### Example 2

```python
from cli_formatter.table_builder import TableBuilderClassic, TableBuilderAlternative

header=['Column 1', 'Column 2', 'Column 3']
data=[
    ['This is a test', '123', 'abc'],
    ['cli-formatter', 'is', 'awesome']
]

print('classic design:')
classic_builder = TableBuilderClassic()
classic_builder.build_table(header=header, data=data)

print('\nalterative design:')
alternative_builder = TableBuilderAlternative()
alternative_builder.build_table(header=header, data=data)
```

```
classic design:
+----------------+----------+----------+
| Column 1       | Column 2 | Column 3 |
+----------------+----------+----------+
| This is a test | 123      | abc      |
| cli-formatter  | is       | awesome  |
+----------------+----------+----------+

alterative design:
 Column 1       | Column 2 | Column 3
--------------------------------------
 This is a test | 123      | abc
 cli-formatter  | is       | awesome
```