summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorKenneth Reitz <me@kennethreitz.com>2010-10-10 10:01:51 -0400
committerKenneth Reitz <me@kennethreitz.com>2010-10-10 10:01:51 -0400
commit3b0e0c7991da92e8a65c637afd19ac52e93deddd (patch)
tree2b69a4b35dde8919d3790b936b7acd33f75bcf7f /docs
parent23440fb7a3849217c2549023fd46b5156bec3416 (diff)
downloadtablib-3b0e0c7991da92e8a65c637afd19ac52e93deddd.tar.gz
Updates.
Diffstat (limited to 'docs')
-rw-r--r--docs/development.rst125
-rw-r--r--docs/index.rst4
-rw-r--r--docs/install.rst1
-rw-r--r--docs/tutorial.rst12
4 files changed, 104 insertions, 38 deletions
diff --git a/docs/development.rst b/docs/development.rst
index e665265..5fb9c2b 100644
--- a/docs/development.rst
+++ b/docs/development.rst
@@ -3,11 +3,17 @@
Development
===========
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+Tablib is under active development, and contributors are welcome.
-There's a todo list.
+If you have a feature request, suggestion, or bug report, please open a new issue on GitHub_. To submit patches, please send a pull request on GitHub_.
+
+If you'd like to contribute, there's plenty to do. Here's a short todo list.
+
+ .. include:: ../TODO.rst
+
+
+.. _GitHub: http://github.com/kennethreitz/tablib/
-.. include:: ../TODO.rst
.. _design:
@@ -24,8 +30,10 @@ Tablib was developed with a few :pep:`20` idioms in mind.
#. Complex is better than complicated.
#. Readability counts.
-It strives to be as simple to use as possible.
+A few other things to keep in mind:
+#. Keep your code DRY.
+#. Strive to be as simple (to use) as possible.
.. _scm:
@@ -36,30 +44,100 @@ Source Control
Tablib source is controlled with Git_, the lean, mean, distributed source control machine.
-**Branch Structure**
+The repository is publicly accessable.
+
+ ``git clone git://github.com/kennethreitz/tablib.git``
+
+The project is hosted both on **GitHub** and **git.kennethreitz.com**.
+
+
+ GitHub:
+ http://github.com/kennethreitz/tablib
+ "Mirror":
+ http://git.kennethreitz.com/projects/tablib
+
+
+Git Branch Structure
+++++++++++++++++++++
+
+Feature / Hotfix / Release branches follow a `Successful Git Branching Model`_ . Git-flow_ is a great tool for managing the repository. I highly recommend it.
+
+``develop``
+ The "next release" branch. Likely unstable.
+``master``
+ Current production release (|version|) on PyPi.
+``gh-pages``
+ Current release of http://tablib.org.
- ``develop``
- The "next release" branch. Likely unstable.
- ``master``
- Current production release (|version|) on PyPi.
+Each release is tagged.
-Git.
-GitHub.
-git.kennethreitz.com
+When submitting patches, please place your feature/change in its own branch prior to opening a pull reqeust on GitHub_.
-Git Flow
.. _Git: http://git-scm.org
+.. _`Successful Git Branching Model`: http://nvie.com/posts/a-successful-git-branching-model/
+.. _git-flow: http://github.com/nvie/gitflow
-.. _newformats:
+.. _newformats:
------------------
Adding New Formats
------------------
-Don't.
+Tablib welcomes new format additions! Format suggestions include:
+
+* Tab Seperated Values
+* MySQL Dump
+* HTML Table
+
+
+Coding by Convention
+++++++++++++++++++++
+
+Tablib features a micro-framework for adding format support. The easiest way to understand it is to use it. So, let's define our own format, named *xxx*.
+
+1. Write a new format interface.
+
+ :class:`tablib.core` follows a simple pattern for automatically utilizing your format throughout Tablib. Function names are crucial.
+
+ Example **tablib/formats/_xxx.py**: ::
+ title = 'xxx'
+
+ def export_set(dset):
+ ....
+ # returns string representation of given dataset
+
+ def export_book(dbook):
+ ....
+ # returns string representation of given databook
+
+ def import_set(dset, in_stream):
+ ...
+ # populates given Dataset with given datastream
+
+ def import_book(dbook, in_stream):
+ ...
+ # returns Databook instance
+
+ def detect(stream):
+ ...
+ # returns True if given stream is parsable as xxx
+
+.. admonition:: Excluding Support
+
+
+ If the format excludes support for an import/export mechanism (*eg.* :class:`csv <tablib.Dataset.csv>` excludes :class:`Databook <tablib.Databook>` support), simply don't define the respecive functions. Appropriate errors will be raised.
+
+2.
+
+ Add your new format module to the :class:`tablib.formats.avalable` tuple.
+
+3.
+ Add a mock property to the :class:`Dataset <tablib.Dataset>` class with verbose `reStructured Text`_ docstring. This alleviates IDE confusion, and allows for pretty auto-generated Sphinx_ documentation.
+
+4. Write respective :ref:`tests <testing>`.
.. _testing:
@@ -69,12 +147,6 @@ Testing Tablib
Testing is crucial to Tablib's stability. This stable project is used in production by many companies and developers, so it is important to be certian that every version released is fully operational. When developing a new feature for Tablib, be sure to write proper tests for it as well.
-
-++++++++++++++++++++++
-Running the Test Suite
-++++++++++++++++++++++
-
-
When developing a feature for Tablib, the easiest way to test your changes for potential issues is to simply run the test suite directly. ::
$ ./test_tablib.py
@@ -95,17 +167,10 @@ This will generate a **nosetests.xml** file, which can then be analyzed.
.. _Nose: http://somethingaboutorange.com/mrl/projects/nose/
-++++++++++++++++++++++++
-Extending the Test Suite
-++++++++++++++++++++++++
-
-
-Example: ::
-
- import tablib.formats.sql.test_sql
-
.. _hudson:
+
+----------------------
Continuous Integration
----------------------
diff --git a/docs/index.rst b/docs/index.rst
index a9b2726..87a8d3b 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -24,12 +24,12 @@ Welcome to Tablib's documentation.
Tablib is a format-agnostic tabular dataset library, written in Python. It allows you to import, export, and manipulate tabular data sets. Oh, and it's :ref:`MIT Lisenced <mit>`.
-I recommend you start off with :ref:`Installation <install>`.
+I recommend you start with :ref:`Installation <install>`.
User's Guide
------------
-This part of the documentation, which is mostly prose, begins with some background information about Tablib, then focuses on step-by-step instructions for web development with Flask.
+This part of the documentation, which is mostly prose, begins with some background information about Tablib, then focuses on step-by-step instructions for getting the most out of your datasets.
.. toctree::
:maxdepth: 2
diff --git a/docs/install.rst b/docs/install.rst
index bcf0fc3..0b5d212 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -21,6 +21,7 @@ Or, if you must: ::
But, you really shouldn't do that.
+
-------------------
Download the Source
-------------------
diff --git a/docs/tutorial.rst b/docs/tutorial.rst
index dfe066a..a403d4a 100644
--- a/docs/tutorial.rst
+++ b/docs/tutorial.rst
@@ -92,7 +92,7 @@ Now that we have a basic :class:`Dataset` in place, let's add a column of **ages
Let's view the data now. ::
>>> data.dict
- [{'Last Name': 'Reitz', 'First Name': 'Kenneth', 'Age': 22}, {'Last Name': 'Monke', 'First Name': 'Bessie', 'Age': 21}]
+ [{'Last Name': 'Reitz', 'First Name': 'Kenneth', 'Age': 22}, {'Last Name': 'Monke', 'First Name': 'Bessie', 'Age': 20}]
It's that easy.
@@ -108,19 +108,19 @@ Tablib's killer feature is the ability to export your :class:`Dataset` objects i
>>> data.csv
Last Name,First Name,Age
Reitz,Kenneth,22
- Monke,Bessie,21
+ Monke,Bessie,20
**JavaScript Object Notation** ::
>>> data.json
- [{"Last Name": "Reitz", "First Name": "Kenneth", "Age": 22}, {"Last Name": "Monke", "First Name": "Bessie", "Age": 21}]
+ [{"Last Name": "Reitz", "First Name": "Kenneth", "Age": 22}, {"Last Name": "Monke", "First Name": "Bessie", "Age": 20}]
**YAML Ain't Markup Language** ::
>>> data.yaml
- {Age: 22, First Name: Kenneth, Last Name: Reitz}
- - {Age: 21, First Name: Bessie, Last Name: Monke}
+ - {Age: 20, First Name: Bessie, Last Name: Monke}
**Microsoft Excel** ::
@@ -214,7 +214,7 @@ Let's have a look at our data. ::
>>> data.yaml
- {Age: 22, First Name: Kenneth, Grade: 0.6, Last Name: Reitz}
- - {Age: 21, First Name: Bessie, Grade: 0.75, Last Name: Monke}
+ - {Age: 20, First Name: Bessie, Grade: 0.75, Last Name: Monke}
Let's remove that column. ::
@@ -244,7 +244,7 @@ Adding this function to our dataset as a dynamic column would result in: ::
>>> data.yaml
- {Age: 22, First Name: Kenneth, Gender: Male, Last Name: Reitz}
- - {Age: 21, First Name: Bessie, Gender: Female, Last Name: Monke}
+ - {Age: 20, First Name: Bessie, Gender: Female, Last Name: Monke}