Permalink
Browse files

Trying to pass to github

  • Loading branch information...
mathias mathias
mathias authored and mathias committed Feb 5, 2013
0 parents commit 7b268292b04d57a446f1be0c05cd52fcdb9d82e5
Showing with 497 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +14 −0 LICENSE
  3. +1 −0 MANIFEST
  4. +73 −0 README.md
  5. 0 meli/__init__.py
  6. +4 −0 meli/constants.py
  7. +73 −0 meli/endpoints.py
  8. +223 −0 meli/meli.py
  9. +22 −0 meli/methods.py
  10. +8 −0 meli/utils.py
  11. +47 −0 setup.py
  12. +28 −0 test.py
@@ -0,0 +1,4 @@
+
+*~
+*.pyc
+
14 LICENSE
@@ -0,0 +1,14 @@
+Copyright (c) 2013 Mathias Bustamante.
+All rights reserved.
+
+Redistribution and use in source and binary forms are permitted
+provided that the above copyright notice and this paragraph are
+duplicated in all such forms and that any documentation,
+advertising materials, and other materials related to such
+distribution and use acknowledge that the software was developed
+by the <organization>. The name of the
+University may not be used to endorse or promote products derived
+from this software without specific prior written permission.
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
@@ -0,0 +1 @@
+include README.md LICENSE
@@ -0,0 +1,73 @@
+python-meli
+=======
+
+```python-meli``` is a wrapper for MercadoLibre API, current version of the API is
+V1, this wrapper does not yet totally supports the entire API, see below for
+supported endpoints.
+
+Features
+--------
+
+* Categories and Listings:
+ - Fully supported, see [the docs](http://developers.mercadolibre.com/API-directory/)
+* Locations and Currencies
+ - Fully supported, see [the docs](http://developers.mercadolibre.com/API-directory/)
+
+Installation
+------------
+
+ (pip install | easy_install) python-meli
+
+... or, you can clone the repo and install it the old fashioned way
+
+ git clone https://mathiasbc@bitbucket.org/mathiasbc/python-meli.git
+ cd python-meli
+ sudo python setup.py install
+
+Usage
+-----
+
+Every method below returns a JSON of the the endpoint response, the following example is just to show the basic usage of this wrapper, however I recommend you to read the meli.py module to see what does every method exactle does and what parameters can be passed to them.
+
+
+###### Mercado Libre endpoints
+
+```python
+from meli.meli import MercadoLibre
+
+MELI = MercadoLibre()
+
+# Locations and Currencies =================================================
+print MELI.countries()
+print MELI.country_detail(country_id='PE')
+print MELI.state_detail(state_id='PE-ARE')
+print MELI.city_detail(city_id='TVBFQ0FSRTE0YjA5')
+print MELI.currencies()
+print MELI.currency_detail(currency_id='PEN')
+print MELI.currency_conversion(currency_id_from='PEN', currency_id_to='USD')
+
+
+# Categories and Listings ==================================================
+print MELI.sites()
+print MELI.site_detail(site_id='MPE')
+print MELI.site_domains(site_domain_url='www.mercadolibre.com.pe')
+print MELI.site_listing_types(site_id='MPE')
+print MELI.site_listing_exposures(site_id='MPE', listing_exposure_id='low')
+print MELI.site_listing_prices(site_id='MPE', price=10000, quantity=10)
+print MELI.site_categories(site_id='MPE')
+print MELI.category_detail(category_id='MPE1182')
+```
+
+
+Notes
+-----
+For the moment oauth is not supported, I'm currently working on it.
+
+
+
+Want to help?
+-------------
+Python-MELI is a usefull wrapper but I would greatly appreciate any help, you could contribute writing the Wiki or forking and then making pull request with new features. Feel free to contact me.
+
+
+(c) 2012 - Mathias Bustamante mathias@worldrat.com - Distributed under the BSD license - Made in Peru.
No changes.
@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+
+DEFAULT_API_VERSION = "v1"
+API_PARTIAL_URL = "https://%(api_version)s.api.mercadolibre.com"
@@ -0,0 +1,73 @@
+# -*- coding: utf-8 -*-
+
+# Users and Apps ==============================================================
+
+# /users/
+
+# /users/:id
+#USER_DETAIL = "/users/%(user_id)s" # Append user_id
+
+# /users/{user_id}/addresses?access_token={...}
+#USER_ADDRESSES = \
+# "/users/%(user_id)s/addresses?access_token=%(access_token)s"
+
+# /users/{user_id}/accepted_payment_methods
+#USER_ACCEPTED_PAY_METHOD = "/users/%(user_id)s/accepted_payment_methods"
+
+# /applications/{app_id}
+# /scopes
+
+
+# Categories and Listings ======================================================
+
+# /sites Sites where MELI runs
+SITES = "/sites"
+
+# /sites/{site_id}
+SITE_DETAIL = "/sites/%(site_id)s"
+
+# /site_domains/{site_domain_url} Retrieves info about the domain
+SITE_DOMAINS = "/site_domains/%(site_domain_url)s"
+
+# /sites/{site_id}/listing_types
+# Retrieves information about the listing types.
+SITE_LISTING_TYPES = "/sites/%(site_id)s/listing_types"
+
+# /sites/{site_id}/listing_exposures
+SITE_LISTING_EXPOSURES = "/sites/%(site_id)s/listing_exposures/"
+
+# /sites/{site_id}/listing_prices?price=1
+SITE_LISTING_PRICES = "/sites/%(site_id)s/listing_prices"
+
+# /sites/{site_id}/categories
+SITE_CATEGORIES = "/sites/%(site_id)s/categories"
+
+# /categories/{category_id} Information about specific category
+CATEGORY_DETAIL = "/categories/%(category_id)s"
+
+# /categories/{category_id}/attributes I could not make it work
+CATEGORY_ATTRIBUTES = ""
+
+
+# Locations and Currencies =====================================================
+
+# /countries List the countries
+COUNTRIES = "/countries"
+
+# /countries/{country_id} Info for the country
+COUNTRY_DETAIL = "/countries/%(country_id)s"
+
+# /states/{state_id} Info for a given State
+STATE_DETAIL = "/states/%(state_id)s"
+
+# /cities/{city_id} Info for the given state
+CITY_DETAIL = "/cities/%(city_id)s"
+
+# /currencies Info of the MercadoLibre currencies
+CURRENCIES = "/currencies"
+
+# /currencies/{currency_id}
+CURRENCY_DETAIL = "/currencies/%(currency_id)s"
+
+# /currency_conversions/search?from={currency_id}&to={currency_id}
+CURRENCY_CONVERSION = "/currency_conversions/search"
Oops, something went wrong.

0 comments on commit 7b26829

Please sign in to comment.