Commits

Gregory Petukhov committed 556e5ae

Update README

Comments (0)

Files changed (3)

 
 Package pypi-tools contains now only one script called ``pypi``.
 It is command line utility for searching in Python Package Index.
-For further help please install pypi-tools and run ``pypi -h`` command.
+
+Usage
+=====
+
+Let's find something. What about some django gravatar application?
+
+    $ pypi django avatar
+    $ 
+
+Hmm, nothing. Ok, maybe just gravatar? :)
+
+    $ pypi gravatar
+    django-gravatar                - Gravatar Support in a Django Reusable Application
+    gravatar                       - Gravatar generator. Includes all API parameters included in their documentation.
+    tw.gravatar                    - inserts gravatar images
+    tw.gravatar                    - inserts gravatar images
+
+Cool. It found something. Duplicated tw.gravatar line looks like a bug :)
+
+Let's see what is tw.gravatar.
+
+    $ pypi -s tw.gravatar
+     name:                tw.gravatar
+     summary:             inserts gravatar images
+     version:             0.1a0dev-20100727
+     author:              Nicolas Laurance
+     author_email:        nicolas[dot]laurance<at>gmail.com
+     keywords:            toscawidgets.widgets,gravatar
+     classifiers:         Development Status :: 3 - Alpha
+                          Environment :: Web Environment
+                          Environment :: Web Environment :: ToscaWidgets
+                          Framework :: TurboGears :: Widgets
+    ...
+
+Ooops, it is not django application.
+
+``pypi`` command understand complex search queries. You can see the list of search
+operators in ``pypi -h`` output.
+
+Here is example of searching all crap I have uploaded on the Python Package Index:
+
+    lorien@big:/web/pypi-tools$ ./pypi --author_email lorien@lorien.name
+    django-account                 - Django application for registration and authentication
+    django-bookmarker              - Social bookmark linsk
+    django-common                  - A number of useful django shortcuts and helpers
+    ...
             value = getattr(kwargs, key)
             if value:
                 query[key] = value
+        mode = 'and'
         if args:
             query['name'] = query.get('name', '') + ' '.join(args)
+            query['summary'] = query.get('summary', '') + ' '.join(args)
+            mode = 'or'
         if not query:
             parser.print_usage()
             sys.exit()
-        resp = client.search(query)
+        resp = client.search(query, mode)
         for item in resp:
             print '%-30s - %s' % (item['name'], item['summary'])
 
                 return 100
         for key, value in sorted(data.items(), key=key_func):
             if value is not None and not key.startswith('_') and value != 'UNKNOWN':
+                if key == 'description':
+                    # Ignore, becouse it is too big sometims
+                    continue
                 if isinstance(value, bool):
                     value =  'yes' if value else 'no'
                 if isinstance(value, int):
 from setuptools import setup
 
 PACKAGE = 'pypi-tools'
-VERSION = '0.0.1'
+VERSION = '0.0.2'
 
 setup(
     name = 'pypi-tools',