https://github.com/edsu/opensearch
A python opensearch client
https://github.com/edsu/opensearch
Last synced: about 1 year ago
JSON representation
A python opensearch client
- Host: GitHub
- URL: https://github.com/edsu/opensearch
- Owner: edsu
- License: gpl-3.0
- Created: 2009-09-18T15:43:36.000Z (over 16 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T20:19:56.000Z (about 3 years ago)
- Last Synced: 2025-03-27T20:23:06.717Z (about 1 year ago)
- Language: Python
- Homepage: http://python.org/pypi/opensearch
- Size: 129 KB
- Stars: 44
- Watchers: 3
- Forks: 14
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
opensearch
==========
opensearch is a python library for talking to opensearch servers.
Both v1.0 and v1.1 interactions are supported. You can find out more
about opensearch at [opensearch.org](http://opensearch.org).
Usage
-----
Here's the basic idea:
```python
from opensearch import Client
client = Client(description_url)
results = client.search('zx81')
for result in results:
print result.title, result.link
```
If you have a template with some non-standard query parameters like `key` in
this template:
```xml
```
you can send the parameter like so:
```python
results = client.search('zx81', key="abc123")
```
If the template happens to use a namespace prefix, as in this real example
from the OCLC Worldcat API, which uses `wcapi:wskey`:
```xml
```
You can supply `wcapi:wskey` using the underscore notation:
```python
results = client.search('zx81', wcapi__wskey="abc123")
```
Debugging
---------
If you run into trouble and would like to see what URLs are being accessed
behind the scenes, turn on logging and set the log level to DEBUG:
```python
import logging
logging.basicConfig(level=logging.DEBUG)
```
To Do
-----
- handle v1.1 that want a POST instead of a GET
- figure out if the latest feedparser can be used as a dependency
- validate required parameters
License
-------
The opensearch code itself has been released under the
[GPL](http://www.opensource.org/licenses/gpl-license.php).
One exception is that the distro bundles Mark Pilgrim's Universal Feed
Parser, which is licensed separately under the MIT license. See
opensearch/osfeedparser.py for details on Mark's license.
Author
------
Ed Summers [ehs@pobox.com](mailto:ehs@pobox.com)