semvec/pypi-packages huggingface dataset:
ibm935 0.2.1
Supports encoding conversion between `unicode` and `ibm935` in Python
License: MIT

![version](https://img.shields.io/pypi/v/ibm935.svg) ![license](https://img.shields.io/pypi/l/ibm935.svg)

# IBM935
The codec `ibm935` is not yet officially supported. This package is designed for conversion between `unicode` and `ibm935`.

## Installation
Using `pip`:
```bash
$ pip install ibm935 
```

Or manually download the archive and run the command after extracting the stuff inside:
```bash
$ python setup.py install
```

## Usage
Before using this codec, import the module: 
```python
import ibm935
```

Then we can convert `unicode` strings into `ibm935` codec as usual:
```python
# Python 2
encoded_bytes = u"我爱Python这么美好的语言！".encode("ibm935")
decoded_string = encoded_bytes.decode("ibm935")

# Python 3 - the prefix `u` can be omitted
encoded_bytes = "我爱Python这么美好的语言！".encode("ibm935")
decoded_string = encoded_bytes.decode("ibm935")
``` 

We can also write files using this codec:
```python
with open("ibm935.txt", "w", encoding="ibm935") as f:
    f.write("我爱Python！")
```

Note:
* This package is not yet fully tested.
* There is a tough situation where writing a file with separate `words`(double-byte) causes redundant bytes like `\x0f\x0e`.
scrub 0.1.2
Scrub sensitive fields for production and data that keeps changing for testing.
License: MIT
Keywords: dict,data,nested,functional

![](media/cover.png)

# Scrub

A Python library for cleaning sensitive data for production and normalizing data for testing.


```py
>>> from scrub import scrub_headers
>>> sensitive_headers = {
        "x-api-key": "--key--",
        "x-date": "--filtered--",
        "Set-Cookie": "--filtered--",
    }
>>> scrubber = scrub_headers(sensitive_headers)
>>> scrubber({
        "x-api-key": "3faf",
        "x-date": "Oct 18 2001",
        "Set-Cookie": "secret=3faf00",
        "Accept": "application/json",
    })
{
    'Accept': 'application/json',
    'Set-Cookie': '--filtered--',
    'x-api-key': '--key--',
    'x-date': '--filtered--'
}
>>>
```

## Quick Start

Install using pip/pipenv/etc. (we recommend [poetry](https://github.com/sdispater/poetry) for sane dependency management):

```
$ poetry add --dev scrub
```

Import a scrubber that you need:

```py
from scrub import scrub_headers scrub_body, scrub_request
```

### Available Scrubbers

`scrub_headers`

Scrubs HTTP headers, or more generally a plain python dict. Initialize with a key replacements dict:

```py
{
    "x-api-key": "--key--",
    "x-date": "--filtered--",
    "Set-Cookie": "--filtered--",
}
```


`scrub_body`

Scrubs HTTP body, or more generally any piece of text. Initialize with content matching replacement dict:

```py
{
    "<Secret>.*</Secret>": "<Secret>{}</Secret>".format(
        base64.b64encode(b"--filtered--").decode()
    ),
    "{.*}": "{}",
}
```

`scrub_request`

Scrubs a [requests](https://github.com/requests/requests) request. Give it headers and body scrubbers, or identity function if you don't want to replace anything there.

```py
from scrub import scrub_request
scrubber = scrub_request(headerscrubber, lambda x: x)

scrubber(req)
```



### Thanks:

To all [Contributors](https://github.com/jondot/scrub/graphs/contributors) - you make this happen, thanks!

# Copyright

Copyright (c) 2018 [@jondot](http://twitter.com/jondot). See [LICENSE](LICENSE.txt) for further details.