Skip to content

Commit

Permalink
Prepare v1.4.0; include parts of README in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam Cooke committed May 20, 2017
1 parent 405af30 commit aa54e9e
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 97 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ All notable changes to this project will be documented in this file. This
project adheres to `Semantic Versioning <http://semver.org>`__ as of v1.1.0.


Unreleased_
--------------------
.. Unreleased_
.. --------------------
.. v1.4.0_ / 2017-05-20
.. --------------------
**Added**

- Test each of the ``is`` functions from the *inspect* module, such as
``isclass`` and ``isgenerator``, and include them in the result.

- Documentation using Sphinx.


v1.3.2_ / 2016-04-30
--------------------
Expand Down
109 changes: 55 additions & 54 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,87 +4,88 @@ see: dir for humans
.. image:: https://img.shields.io/pypi/v/see.svg
:target: https://pypi.python.org/pypi/see

.. see/docs <common-badges>
.. image:: https://travis-ci.org/araile/see.svg?branch=develop
:target: https://travis-ci.org/araile/see

.. image:: https://coveralls.io/repos/github/araile/see/badge.svg?branch=develop
:target: https://coveralls.io/github/araile/see?branch=develop

**see** is an alternative to the built-in ``dir`` function in Python. It shows
you what you can do with things.

Supports Python 2.6+ and 3.3+. Also works in iPython and PyPy.

Licensed under the BSD 3-Clause License. See the *LICENSE* file.
.. see/docs </common-badges>
Contributions are welcome. See the *CODE_OF_CONDUCT.md*, *CHANGELOG.rst*
and *AUTHORS.rst* files.
.. see/docs <summary>
Install
-------
**see** is an alternative to Python's ``dir()``.
It shows you a neat summary of what you can do with an object.
Use it to debug your code or learn new APIs.

To install **see**, run::
For Python 2.6+ and 3.3+.

$ pip3 install --upgrade see
.. see/docs </summary>
Usage
-----
Example
-------

**see** is designed for the interactive Python interpreter. Import the ``see``
function like so::
.. For examples, use a 64-column terminal and set sys.ps1 = '>>> '
>>> from see import see
.. see/docs <example>
Call ``see()`` without arguments to see all objects in the global scope. ::
Try inspecting a list with ``see``::

>>> foo = 'bar'
>>> see()
foo see()
>>> see(list)
[] in + += *
*= < <= == !=
> >= dir() hash()
help() iter() len() repr()
reversed() str() .append() .clear()
.copy() .count() .extend() .index()
.insert() .pop() .remove() .reverse()
.sort()

Call ``see(an_object)`` to see what you can do with ``an_object``. ::
Some of the information revealed here:

>>> number = 1
>>> see(number)
+ - * / //
% ** << >> &
^ | +obj -obj ~
< <= == != >
>= abs() bool() dir()
divmod() float() hash() help()
hex() int() oct() repr()
round() str() .bit_length() .conjugate()
.denominator .from_bytes() .imag .numerator
.real .to_bytes()
* You can use the ``in`` keyword with a list.
* You can get the length of a list with ``len()``.
* The list has a ``count`` attribute that is a function.

>>> async def hello_world():
... print("Hello World!")
...
>>> see(hello_world)
iscoroutinefunction isfunction isroutine ()
< <= == != >
>= dir() hash() repr() str()
Compare with the output of ``dir``::

>>> dir(list)
['__add__', '__class__', '__contains__', '__delattr__', '__delit
em__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '
__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd_
_', '__imul__', '__init__', '__init_subclass__', '__iter__', '__
le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__r
educe__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__
', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__sub
classhook__', 'append', 'clear', 'copy', 'count', 'extend', 'ind
ex', 'insert', 'pop', 'remove', 'reverse', 'sort']

Startup
-------
.. see/docs </example>
You can use a Python startup file to ensure that ``see`` is available every
time you run Python. The following example uses a startup file named
``.pythonrc.py`` in the user's home directory:
1. Create the Python startup file, if it does not already exist::
Documentation
-------------

$ touch ~/.pythonrc.py
Documentation is available at https://araile.github.io/see/

2. Open this file in your preferred editor. Add the following line::
* `Installation <https://araile.github.io/see/install.html>`_
* `Usage <https://araile.github.io/see/usage.html>`_
* `Startup File <https://araile.github.io/see/startup.html>`_
* `Developer Reference <https://araile.github.io/see/dev/index.html>`_

from see import see

3. Set the following environment variable (e.g. in ``~/.bashrc`` for Bash)::
Contributing
------------

$ export PYTHONSTARTUP="$HOME/.pythonrc.py"
The source code is maintained
`on GitHub <https://github.com/araile/see>`_.
Contributions are welcome.

Now you can use ``see`` immediately after running ``python``, without having to
manually import it.
* `Change Log <https://github.com/araile/see/blob/develop/CHANGELOG.rst>`_
* `Code of Conduct <https://github.com/araile/see/blob/develop/CODE_OF_CONDUCT.md>`_
* `Authors <https://github.com/araile/see/blob/develop/AUTHORS.rst>`_
* `License <https://github.com/araile/see/blob/develop/LICENSE>`_
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# built documents.
#
# The short X.Y version.
version = '1.4.0a0'
version = '1.4.0'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
1 change: 1 addition & 0 deletions docs/dev/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Get the source code

The source code is maintained
`on GitHub <https://github.com/araile/see>`_.
Contributions are welcome.

* `Change Log <https://github.com/araile/see/blob/develop/CHANGELOG.rst>`_
* `Code of Conduct <https://github.com/araile/see/blob/develop/CODE_OF_CONDUCT.md>`_
Expand Down
47 changes: 9 additions & 38 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,23 @@ see: dir for humans

Release v\ |release|.

.. image:: https://travis-ci.org/araile/see.svg?branch=develop
:target: https://travis-ci.org/araile/see
.. include:: ../README.rst
:start-after: see/docs <common-badges>
:end-before: see/docs </common-badges>

.. image:: https://coveralls.io/repos/github/araile/see/badge.svg?branch=develop
:target: https://coveralls.io/github/araile/see?branch=develop

**see** is an alternative to Python's ``dir()``.
It shows you a neat summary of what you can do with an object.
Use it to debug your code or learn new APIs.
.. include:: ../README.rst
:start-after: see/docs <summary>
:end-before: see/docs </summary>

To get started, see the :doc:`install` and :doc:`usage` pages.


Example
-------

Try inspecting a list with ``see``::

>>> see(list)
[] in + += *
*= < <= == !=
> >= dir() hash()
help() iter() len() repr()
reversed() str() .append() .clear()
.copy() .count() .extend() .index()
.insert() .pop() .remove() .reverse()
.sort()

Some of the information revealed here:

* You can use the ``in`` keyword with a list.
* You can get the length of a list with ``len()``.
* The list has a ``count`` attribute that is a function.

Compare with the output of ``dir``::

>>> dir(list)
['__add__', '__class__', '__contains__', '__delattr__', '__delit
em__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '
__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd_
_', '__imul__', '__init__', '__init_subclass__', '__iter__', '__
le__', '__len__', '__lt__', '__mul__', '__ne__', '__new__', '__r
educe__', '__reduce_ex__', '__repr__', '__reversed__', '__rmul__
', '__setattr__', '__setitem__', '__sizeof__', '__str__', '__sub
classhook__', 'append', 'clear', 'copy', 'count', 'extend', 'ind
ex', 'insert', 'pop', 'remove', 'reverse', 'sort']
.. include:: ../README.rst
:start-after: see/docs <example>
:end-before: see/docs </example>


Contents
Expand Down
2 changes: 1 addition & 1 deletion see/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@

__author__ = 'Liam Cooke'
__contributors__ = 'See AUTHORS.rst'
__version__ = '1.4.0a0'
__version__ = '1.4.0'
__copyright__ = 'Copyright (c) 2009-2017 Liam Cooke'
__license__ = 'BSD License'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
]

setup(name='see',
version='1.4.0a0',
version='1.4.0',
description='dir for humans',
author='Liam Cooke',
author_email='see@araile.com',
Expand Down

0 comments on commit aa54e9e

Please sign in to comment.