Git Product home page Git Product logo

pyops's Introduction

pyops: OpenSearch made pythonically easy

OpenSearch python client.

Examples:

>>> import pyops
>>> client = pyops.Client(description_xml_url="https://example.org")

# simple search
>>> raw_results = client.search()

# authenticated search
>>> raw_results = client.search(auth=('username', 'password'))

# advanced search
>>> raw_results = client.search(params={"{eop:instrument?}": {"value": "SAR"}})

# results filtering
>>> raw_results = client.search()
>>> entry_fields = client.get_available_fields()
>>>  filtered_results = client.filter_entries([{
>>>     "tag": "{http://www.w3.org/2005/Atom}id",
>>>     "name": "id"
>>> }, {
>>>     "tag": "{http://www.w3.org/2005/Atom}title",
>>>     "name": "title"
>>> }, {
>>>     "tag": "{http://www.w3.org/2005/Atom}summary",
>>>     "name": "summary"
>>> }, {
>>>     "tag": "{http://www.w3.org/2005/Atom}published",
>>>     "name": "published"
>>> }, {
>>>     "tag": "{http://www.w3.org/2005/Atom}updated",
>>>     "name": "updated"
>>> }, {
>>>     "tag": "{http://www.w3.org/2005/Atom}link",
>>>     "name": "link",
>>>     "rel": "enclosure"
>>> }])

TODO

  • APIs (search, ...)
  • json search
  • documentation

[HOW TO] DEPLOY

Update pyops.__version__.py

# create packages
python3 setup.py sdist bdist_wheel
# upload on test.pypi
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
# test install
python3 -m pip install --index-url https://test.pypi.org/simple/ pyops
# upload on pypi
twine upload dist/*

CHANGELOG

  • v0.0.2 (2019-07-16):
    • Added: authentication management
    • Bugfix: removed unused parameters from search (added regex)
    • Tests: added test_authentication (description_xml_url and authentication params not committed)
    • Issue #1: included tests in packaging

pyops's People

Stargazers

 avatar Samuel Foucher avatar Jeffrey Mezic avatar

Watchers

Sergio Ferraresi avatar

Forkers

sfoucher eofarm

pyops's Issues

get_available_fields() return empty list

Hello,

It seems with the Opensearch API I'm trying to use, your module is not working.
If you're interrested in, you can reproduce the issue with the following snippet:

import pyops
client = pyops.Client(description_xml_url="https://mundiwebservices.com/acdc/catalog/proxy/search/Sentinel1/opensearch/description.xml")
fields = client.get_available_fields()
print(fields)

Regards, Adam.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.