semvec/pypi-packages huggingface dataset:
certum 1.0a1
A dictionary validation library based on partial, composable and expressive rules.
Requires Python: >=3.6,<4

# Certum

A dictionary validation library based on partial, composable and expressive rules.

## Why use it

In case you need to assert some propeties from a particular dictionary in a DSL manner without comparing the entire structure or asserting fields.

Certum comes with the following features:
- Easy to use
- English friendly declaration
- Error accumulation
- Customizable
- Anti KeyError

## Using Certum

You can't use certum package for the moment, coming soon.

## How it works

### Basic usage

Imagine you have a very long json and you want to verify that it contains the following informations:
- He should contains a key named 'name' containing a string.
- He should contains a key named 'entities' being a list containing unique elements.
- He should contains a key named 'nested' containing a key 'value' equals to 4.

```python
from certum import ensure, that

my_obj = {
    "name": "hello",
    "entities": [1, 3, 5],
    "nested": {
        "value": 4
    }
}

validator = ensure(my_obj).respects(
    that("name").is_instance_of(str),
    that("entities").has_unique_elements(),
    that("nested", "value").equals(4)
)

validator.check()
```

### Error handling

If there is errors, certum will accumulate and return errors elegantly:

```python
from certum import ensure, that

my_obj = {
    "name": 2,
    "entities": [1, 3, 3],
    "nested": {
        "value": 2
    }
}

validator = (
    ensure(my_obj)
    .respects(
        that("name").is_instance_of(str),
        that("name").equals("Hello"),
        that("entities").foreach(this.equals(1)),
        that("nested", "value").equals(4),
    )
)

validator.check()

# certum.exception.CertumException: 

# [name] => The value is instance of int, expected str.
# [name] => The value is 2, expected Hello.
# [entities -> 2] => The value is 3, expected 1.
# [entities -> 1] => The value is 3, expected 1.
# [nested -> value] => The value is 2, expected 4.
```

### Strategies

Erros can be sorted, filtered and printed using different strategies.

As an example, you may want to try the GroupedPrinting strategy with the AlphabeticalSorting strategy, this will give you a list of errors like this:

```python
from certum import ensure, that, this
from certum.strategy.printing.grouped import GroupedPrinting
from certum.strategy.sorting.alphabetical import AlphabeticalSorting


my_obj = {
    "name": 2,
    "entities": [1, 3, 3],
    "nested": {
        "value": 2
    }
}

validator = (
    ensure(my_obj)
    .respects(
        that("name").is_instance_of(str),
        that("name").equals("Hello"),
        that("entities").foreach(this.equals(1)),
        that("nested", "value").equals(4),
    )
    .using(GroupedPrinting(), AlphabeticalSorting())
)

validator.check()

# certum.exception.CertumException: 

# entities -> 1   => The value is 3, expected 1.
# entities -> 2   => The value is 3, expected 1.
# name            => The value is 2, expected Hello.
#                    The value is instance of int, expected str.
# nested -> value => The value is 2, expected 4.
```
youtube-scraping-api-TheSillyCoder 0.0.1
A scraper for everything on YouTube
Requires Python: >=3.6

# YouTube-API
An easy-to-use YouTube API, without any kind of quota. I'm still working on it, so stay tuned for the updates to come.

## Documentation

### Importing The API
```python
from YouTubeAPI import YouTubeAPI
api = YouTubeAPI()
```

### Search
Returns a collection of search results that match the query parameters specified in the API request.
```python
api.search(query=None, continuation_token=None)
```
**query**: The query string of your search <br />
**continuation_token**: a token for continuing the search. You will find it at the very end of every search result JSON.

### Playlist
Returns a collection of items and metadata of playlists that match the API request parameters.
```python
api.playlist(playlistId=None, continuation_token=None, parseAll=True)
```
**playlistId**: The ID of playlist you want. You can find it at the url of the playlist page. <br />
**continuation_token**: a token for continuing the search. You will find it at the very end of search result JSON if ```parseAll=False.``` <br />
***parseAll***: Parse all items in the playlist. Default set to True.

### Channel (working)
Returns a collection data of channel resources that match the request criteria.
```python
api.channel(channelId=None, username=None)
```
**channelId**: The ID of channel. <br />
**username**: The username of channel user. <br />