Giter VIP home page Giter VIP logo

marketplace.python's Introduction

Marketplace Client Library

Mozilla is building a Marketplace to bring personalized discovery, worldwide distribution, and easy payments to the largest platform for app development: the Web.

This library helps to create Python based sites or apps to communicate with Marketplace.

You may find and collaborate your time and experience at https://github.com/mozilla/Marketplace.Python

Testing

Install test environment:

pip install -r marketplace/requirements.txt

Test:

nosetests

marketplace.python's People

Contributors

bebef1987 avatar bobsilverberg avatar diox avatar lowks avatar tarekziade avatar zalun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

marketplace.python's Issues

Marketplace.Python is not compatible with the most recent release of oauth2

Our automated tests, which make use of Marketplace.Python to create marketplace apps via the API, have started failing due to an error in the oauth2 package.

The error can be seen at https://webqa-ci.mozilla.com/view/Buildmaster/job/marketplace.stage.developer_hub.saucelabs/423/HTML_Report/

One solution to this would be to pin to an older version of oauth2, but the next previous version on PyPI is very old. In any case, something should be done to address this issue to allow for the use of the library.

Point out the server

The readme doesn't point out that by default the example will hit the dev server, not the stage server. I think it would be nice if we pointed this out, users might have to do:

export MARKETPLACE_DOMAIN=marketplace.allizom.org

If they'd like to hit stage.

Add ability to update existing webapp

I think the method should first get current data and then display them one by one and providing existing data as defaults
empty string - accept default, enter some data - override default.

Verbose mode

Some one was trying to use the MarketplaceClientExample code and got a 401 error back. The 401 errors now contain the information about the error. It would be nice if we had a verbose mode option that showed the full request and response. So we don't have to do hack's like this:

http://amckay.pastebin.mozilla.org/1853517

Optionally, if the response is not a 200, just show the response.

Manifest field required error when creating webapp.

(MarketplaceClientExample)*[master][~DIR/python]$ python main.py validate_manifest http://mozilla.github.com/MarketplaceClientExample/manifest.webapp
Validation issued, id: 45a6aa470f524f6eb72d64f1fc5bb5a3
(MarketplaceClientExample)*[master][~DIR/python]$ python main.py is_manifest_valid 45a6aa470f524f6eb72d64f1fc5bb5a3                                  
Your manifest is valid! You can now add your app to the marketplace
(MarketplaceClientExample)*[master][~DIR/python]$ python main.py create 45a6aa470f524f6eb72d64f1fc5bb5a3
{"error_message": {"manifest": ["This field is required."]}}

Client() should accept an "urlstring"

I don't understand why we are splitting the scheme, location and port here.

I need to use urlparse currently to get the values I want:

url = urlparse.urlparse(self.root)
# and then url.hostname, url.port, url.scheme

I think it's easier to create an urlstring than to parse the bits we need out of one urlstring we already have.
Maybe I'm missing some use case here ? What do you think about changing the signature of this class to accept an urlstring?

Make responses more stable

I have been using this client to automate some work I want to do with marketplace, but I'm a bit surprised to have requests objects in response of my function calls.

For instance, the requests library changed recently and when I want to have a json version of the request, I need to do response.json() rather than response.json previously.

My point is that things can break easily on thelibrary we use and that we probably shouldn't expose this on the users of our library.

For instance, I would prefer to have the results of the APIs returned directly (as a python dict), and to have exceptions from this library if we don't have the behaviour we want on the server.

What do you think? I would be happy to help you work on the APIs we would like to have for this library.

Create success message does not seem to be JSON

When creating an app (via the command line), response.content seems to be a string, not a dict.

$ python main.py create 45a6aa470f524f6eb72d64f1fc5bb5a3                                  
Traceback (most recent call last):
  File "main.py", line 31, in <module>
    result = commands[args.method](auth, *args.attrs)
  File "/Users/fred/dev/MarketplaceClientExample/python/app/commands.py", line 38, in create
    'id: %d, slug: %s') % (response.content['id'],
TypeError: string indices must be integers, not str

No setup.py

Although its an example, there's useful stuff in that lib we could re-use. It would be much easier if that lib was re-usable and a setup.py, then I could install it.

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.