doapfiend
=========

Doapfiend is a command-line client and library for fetching, displaying, creating, and manipulating `DOAP <http://trac.usefulinc.com/doap>`_ (Description of a Project) files.

Doapfiend uses RDFAlchemy/rdflib as an ORM to query and create DOAP. 

See `docs/api <http://doapspace.org/static/doapfiend/api/>`_ for Epydoc generated API documentation.

Features
--------

 * Display metadata in DOAP in a human-readable format
 * Get DOAP by a !SourceForge, Freshmeat, PyPI, !RubyForge etc. project name
 * Search all DOAP spidered on the web (`pingthesemanticweb.com <pingthesemanticweb.com>`_)
 * Access the metadata in the DOAP file using Python dot notation
 * Fetch DOAP by using the short name of a DOAP PURL `doapurl.org <http://doapurl.org>`_
 * Written in Python (Yes, that's a feature.)
 * Extensible with plugins using setuptools

Plugins in development
----------------------

 * Create a Gentoo ebuild from a DOAP file
 * Find DOAP by a Gentoo package name (Thanks `GLEP 46 <http://www.gentoo.org/proj/en/glep/glep-0046.html>`_)
 * Search for DOAP by names you know such as your distribution's package names, Source Forge name, etc.
 * Generate DOAP from well-known sites (Source Forge, PyPI etc.)
 * Generate a web page with CSS from a DOAP file (using `hdoap <http://purl.org/stuff/hdoap/profile>`_)

Installaion
-----------

You can InstallDoapfiend using distutils, easy_install or subversion. There is also a Gentoo Linux ebuild available.

*Example command-line usage*

Fetch DOAP for SourceForge project named 'nut':
::

  $ doapfiend -s nut


You have a project's homepage, display DOAP if any has been spidered:
::

  $ doapfiend -o http://news.tiker.net/software/tagpy


You have the URL to a DOAP file:
::

  $ doapfiend -d http://librdf.org/raptor/raptor.rdf


Display DOAP as RDF/XML for the SourceForge project 'nut':
::

  $ doapfiend -xs nut


Display DOAP as N3 (Notation Three) for the SourceForge project 'nut':
::

  $ doapfiend -ns nut

*Example library usage*

Use a Freshmeat project name to fetch and display DOAP:
::

  >>> from doapfiend.doaplib import get_by_pkg_index

  >>> print get_by_pkg_index('fm', 'nut')

Get some DOAP and access its metadata:
::

  >>> from doapfiend.doaplib import get_by_pkg_index, load
  >>> doap = load(get_by_pkg_index('fm', 'nut'))
  >>> print doap.name
  'nut'
  >>> print doap.created
  '2008-04-19'


Use a project's homepage to fetch DOAP and print the RDF/XML.
Note there may be more than one DOAP profile out there; we just use the first found in our example.
::

  >>> from doapfiend.doaplib import query_by_homepage, display_doap
  >>> url = query_by_homepage('http://news.tiker.net/software/tagpy')[0][1]
  >>> print fetch_doap(url)


Same as above but display DOAP in human readable text:
::

  >>> display_doap(fetch_doap(url))




