openknowledge-archive / dpm-old

**DEPRECATED** - see https://github.com/frictionlessdata/. [[Data package manager (dpm) is a command line tool and Python library for working with data packages - http://data.okfn.org/standards/data-package/]]
http://dpm.readthedocs.org/
15 stars 8 forks source link

Remove list command #27

Closed rufuspollock closed 12 years ago

rufuspollock commented 13 years ago

Not needed and covered by search

dgraziotin commented 13 years ago

If I correctly understand the internal mechanisms, what about listing all packages pointed by a FileIndex? Can it be still useful?

rufuspollock commented 13 years ago

They can just do search with a blank query.

dgraziotin commented 13 years ago

Good. I will keep it at the library level, by just calling the search function. It seems more elegant, even if it seems redundant Il giorno 08/nov/2011 18:40, "Rufus Pollock" < reply@reply.github.com> ha scritto:

They can just do search with a blank query.


Reply to this email directly or view it on GitHub: https://github.com/okfn/dpm/issues/27#issuecomment-2670745

dgraziotin commented 13 years ago

@rgrp, I need some help here. I would like to search with a blank query:

$ dpm search ckan:// 
Insufficient arguments. See command help

Ok, this is obvious

dpm search ckan:// "" --debug
DEBUG:dpm.index:dpm: CKAN config: {'base_location': 'http://thedatahub.org/api', 'api_key': '*****'}
2000-us-census-rdf -- 2000 U.S. Census in RDF (rdfabout.com)
2001-spanish-census-to-rdf -- 2001 Spanish Census to RDF
32000-naples-florida-businesses-kml -- 32000 Naples Florida Businesses in KML format
aaoe-87 -- Airborne Antarctic Ozone Experiment (AAOE-87)
acawiki -- AcaWiki
Error: 403

[** For (lots) more information run with --debug **]
DEBUG:dpm.cli:Exception:
Traceback (most recent call last):
  File "/home/dgraziotin/Projects/dpm/dpm/cli/base.py", line 172, in main
    self.run(options, args)
  File "/home/dgraziotin/Projects/dpm/dpm/cli/standard.py", line 90, in run
    for pkg in index.search(query):
  File "/home/dgraziotin/Projects/dpm/dpm/index/ckan.py", line 52, in search
    yield self.get(pkg_name)
  File "/home/dgraziotin/Projects/dpm/dpm/index/ckan.py", line 67, in get
    self.ckan.package_entity_get(name)
  File "/usr/local/lib/python2.7/dist-packages/ckanclient-0.9-py2.7.egg/ckanclient/__init__.py", line 381, in package_entity_get
    self.open_url(url, headers=headers)
  File "/usr/local/lib/python2.7/dist-packages/ckanclient-0.9-py2.7.egg/ckanclient/__init__.py", line 344, in open_url
    raise CkanApiNotAuthorizedError(self.last_status)
CkanApiNotAuthorizedError: 403

I tried this one with and without my API key, same results.

The same happens with the lib (same result with dpm.lib.search("ckan://",None))

In [4]: dpm.lib.search("ckan://","")
Out[4]: 
list of 5  objects (damn you, github markup)

CkanApiNotAuthorizedError is suppressed in the library for the moment

rufuspollock commented 12 years ago

WORKSFORME (dpm search ckan:// keeps sending over datasets even without an API key).

dgraziotin commented 12 years ago

Now it is working for me, too.