semvec/pypi-packages huggingface dataset:
dictionary-transformer 0.0.3
Dictionary Transformer
License: MIT

# Dictionary transformer

AWS State language inspired library to convert dictionaries to different formats.

## Installation

```shell
pip install dictionary-transformer
```

## Example usage

```python
from dictionary_transformer import transform_json


data = {
    "id": 1,
    "first_name": "John",
    "last_name": "Doe"
}

mapping = {
    "type": "user",
    "meta": {
        "firstName": "$.first_name",
        "lastName": "$.last_name"
    }
}

transform_json(data, mapping)

# Output
{
    "type": "user",
    "meta": {
        "firstName": "John",
        "lastName": "Doe"
    }
}
```

If input is of iterable type, the formatting will be applied to every single item in the list.

```python
from dictionary_transformer import transform_json


data = [
    {
        "id": 1,
        "first_name": "John",
        "last_name": "Doe"
    },
    ...
]

mapping = {
    "type": "user",
    "meta": {
        "firstName": "$.first_name",
        "lastName": "$.last_name"
    }
}

transform_json(data, mapping)

# Output
[
    {
        "type": "user",
        "meta": {
            "firstName": "John",
            "lastName": "Doe"
        }
    },
    ...
]
```

You can also parse items from a list of objects into a list:

```python
from dictionary_transformer import transform_json


data = [
    {
        "id": 1,
        "first_name": "John",
        "last_name": "Doe"
    },
    ...
]

mapping = {
    "type": "user_first_names",
    "firstNames": "$.[*].first_name"
}

transform_json(data, mapping)

# Output
{
    "type": "user_first_names",
    "firstNames": ["John"]
}
```
rdifftime 0.0.1
recursively compare dictrories and report which files are newer
License: MIT
Requires Python: >=3.6

# rdifftime
Compare directories recursively and (for files which content differs) report which files are most recenly modified.

rdifftime uses md5 to compare content of files. Better then `diff -qr`.

~~~shell
$ ./rdifftime /tmp/dir1/ /tmp/dir2/
/tmp/dir1/x.txt > /tmp/dir2/x.txt
./dir1only.txt MISS /tmp/dir2/
./dir2only.txt MISS /tmp/dir1/
~~~
In this example x.txt differs, and `/tmp/dir1/x.txt` is newer (mtime is bigger). Files which exists in both directories and has same md5sum are not reported.

Use '-i TEMPLATE' to ignore specific files (full path relative to any of dir is used, not just filename). Example:

~~~
./rdifftime /tmp/dir1/ /tmp/dir2/ -i .svn/* ./dir1*
~~~