File: index.rst

package info (click to toggle)
python-agate-excel 0.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 816 kB
  • sloc: python: 534; makefile: 126
file content (77 lines) | stat: -rw-r--r-- 1,533 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
=====================
agate-excel |release|
=====================

.. include:: ../README.rst

Install
=======

To install:

.. code-block:: bash

    pip install agate-excel

For details on development or supported platforms see the `agate documentation <https://agate.readthedocs.org>`_.

Usage
=====

agate-excel uses a monkey patching pattern to add read for xls and xlsx files support to all :class:`agate.Table <agate.table.Table>` instances.

.. code-block:: python

  import agate
  import agateexcel

Importing agate-excel adds methods to :class:`agate.Table <agate.table.Table>`. Once you've imported it, you can create tables from both XLS and XLSX files.

.. code-block:: python

  table = agate.Table.from_xls('examples/test.xls')
  print(table)

  table = agate.Table.from_xlsx('examples/test.xlsx')
  print(table)

  table = agate.Table.from_xlsx('examples/test.xlsx', sheet=1)
  print(table)

  table = agate.Table.from_xlsx('examples/test.xlsx', sheet='dummy')
  print(table)

  table = agate.Table.from_xlsx('examples/test.xlsx', sheet=[1, 'dummy'])
  print(table)

Both ``Table`` methods accept a :code:`sheet` argument to specify which sheet to create the table from.

===
API
===

.. autofunction:: agateexcel.table_xls.from_xls

.. autofunction:: agateexcel.table_xlsx.from_xlsx

Authors
=======

.. include:: ../AUTHORS.rst

Changelog
=========

.. include:: ../CHANGELOG.rst

License
=======

.. include:: ../COPYING

Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`