• Stars
    star
    158
  • Rank 235,804 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 12 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Never see escaped bytes in output.

Uniout

It makes Python print the object representation in readable chars instead of the escaped string.

Example

>>> from pprint import pprint
>>> langs = [
...     'Hello, world!',
...     '你好,世界!',
...     'こんにちは世界',
...     u'Hello, world!',
...     u'你好,世界!',
...     u'こんにちは世界'
... ]
...

Before:

>>> pprint(langs)
['Hello, world!',
 '\xe4\xbd\xa0\xe5\xa5\xbd\xef\xbc\x8c\xe4\xb8\x96\xe7\x95\x8c\xef\xbc\x81',
 '\xe3\x81\x93\xe3\x82\x93\xe3\x81\xab\xe3\x81\xa1\xe3\x81\xaf\xe4\xb8\x96\xe7\x95\x8c',
 u'Hello, world!',
 u'\u4f60\u597d\uff0c\u4e16\u754c\uff01',
 u'\u3053\u3093\u306b\u3061\u306f\u4e16\u754c']

After:

>>> import uniout
>>> pprint(langs)
['Hello, world!',
 '你好,世界!',
 'こんにちは世界',
 u'Hello, world!',
 u'你好,世界!',
 u'こんにちは世界']

Installation

You can install it via PyPI,

sudo pip install uniout

or download it manually.

Changelog

v0.3.7

  1. Switch to long-string syntax (''' or """) automatically.

v0.3.6

  1. Fixed the issue with empty string.

v0.3.5

  1. Make it still works for files.

v0.3.4

  1. A better fix for the previous bug.

v0.3.3

  1. Fixed the problem that Uniout can't be installed by PIP.

v0.3.2

  1. Show the original string if the escaped string can't be decoded properly.
  2. Use better way to find string literals.
  3. Print more correct unescaped string representation.

v0.3.1

  1. Fixed a bug when Uniout works with IPython.

v0.3

Thanks for the pull requests #3 and #4 from @timtan, it now

  1. works well with IPython,
  2. and also supports stderr.

More Repositories

1

zipcodetw

Find Taiwan ZIP code by address fuzzily.
Python
281
star
2

clime

DEPRECATION: Convert functions into multi-command program breezily.
Python
151
star
3

mosql

Build SQL with native Python data structure smoothly.
Python
140
star
4

mosky-mini-configs

The configs just work. ✨
Shell
91
star
5

hypothesis-testing-with-python

True difference or noise? 📊
Jupyter Notebook
70
star
6

mosky.vim

DEPRECATE: This repo is merged into moskytw/mosky-mini-configs.
Vim Script
47
star
7

elegant-concurrency-lab

Make concurrency elegant with channels.
Python
43
star
8

practicing-python-3

Learn Python from zero to intermediate! 🚀
Jupyter Notebook
37
star
9

data-science-with-python

Introduce data science in plain Python. 🧪
Jupyter Notebook
35
star
10

git-count

Python
28
star
11

revivalkit

Python
26
star
12

slak

Collect data from Slack like a pro. ⚡️
Python
24
star
13

statistical-regression-with-python

Explain & predict! 📈
Jupyter Notebook
15
star
14

postbox

Python
13
star
15

mining-ptt-news

What kind of news will be voted down on PTT?
Jupyter Notebook
13
star
16

luthadel.vim

A simple but ardent Vim color scheme.
Vim Script
11
star
17

nginx-contrib-vim

Make Vim have better nginx.conf support.
Vim Script
9
star
18

enhancedyaml

Python
8
star
19

cython-lab

Python
7
star
20

uwsgi-emperor

7
star
21

coding-is-magic

Magic! ✨
Jupyter Notebook
5
star
22

examples-for-learning-python-from-data

Python
4
star
23

concurrency-lab

Python
4
star
24

memo-app

JavaScript
4
star
25

multi-celeryd

4
star
26

tacit

Python
2
star
27

snack

Python
1
star
28

tagit.vim

It is a vim plugin handles tags in background. Let you enjoy the benfits of tags without addational effort.
Vim Script
1
star
29

vim-color-scheme-template-generator

Generate Vim's color scheme template precisely.
Python
1
star
30

examples-for-programming-with-python

Python
1
star