Skip to content

Commit

Permalink
Updated README.markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Álvaro Justen aka Turicas committed Nov 2, 2011
1 parent d06103e commit 0234787
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ outputty
With `outputty` you can show the data of your Python software in text mode
(terminal, CSV or TXT) in a easy and beautiful way.

By now we have only the class `Table` (in future we'll add progress bar,
histogram and more).


Installation
------------

For now, just copy the file `outputty.py` in some path you can use it with
`import outputty`. We'll add it to PyPI soon.
Just copy the file `outputty.py` in some path you can do `import outputty`
(sorry for that - it'll be available in PyPI soon).


Examples
--------

By now we have only the class `Table` (in future we'll add progress bar,
histogram and more). We don't have docstrings yet, sorry. If you want to see
more examples, just open `tests/test_Table.py` in your favorite code editor.
:-)

### Example 1

A `Table` made with `dict`, `list` and `tuple`. This code:
Expand Down Expand Up @@ -88,19 +86,28 @@ The code:
+----+---------+-------------------------+


Type Of Data
------------
> If you want to see more examples, see `tests/test_Table.py`.

Every element inside a row will be transformed to
`unicode` -- you can use integers, float etc.

Type Of Data and Encodings
--------------------------

`outputty` will try to convert every element inside a row to `unicode`. In
strings it'll use `string.decode(input_encoding)`, where `input_encoding` is
specified in `Table.__init__`. For other types (integer, float etc.) it'll use
`unicode(element)`.

Input strings will be decoded using __UTF-8__ and output will be encoded using
__UTF-8__ by default. You can change this behaviour passing the parameters
`input_encoding` and `output_encoding` to `Table`, for example:

my_table = Table(headers=['First', 'Last'], input_encoding='iso8859-1',
my_table = Table(headers=['First', 'Last'], input_encoding='iso-8859-1',
output_encoding='utf16')

You can also get the table string decoded, in unicode:

table_in_unicode = unicode(my_table)


To Do
-----
Expand Down

0 comments on commit 0234787

Please sign in to comment.