diff --git a/src/shopify/__init__.py b/src/shopify/__init__.py index b98432d..c83761d 100644 --- a/src/shopify/__init__.py +++ b/src/shopify/__init__.py @@ -38,6 +38,7 @@ from . import cart from . import order from . import product +from . import shop from . import smart_collection from . import webhook @@ -45,5 +46,6 @@ from .cart import CartAPI from .order import OrderAPI from .product import ProductAPI +from .shop import ShopAPI from .smart_collection import SmartCollectionAPI from .webhook import WebhookAPI diff --git a/src/shopify/base.py b/src/shopify/base.py index a232441..d93f39d 100644 --- a/src/shopify/base.py +++ b/src/shopify/base.py @@ -45,6 +45,7 @@ from . import cart from . import order from . import product +from . import shop from . import smart_collection from . import webhook @@ -70,6 +71,7 @@ class API( appier.API, cart.CartAPI, + shop.ShopAPI, order.OrderAPI, product.ProductAPI, smart_collection.SmartCollectionAPI, diff --git a/src/shopify/shop.py b/src/shopify/shop.py new file mode 100644 index 0000000..5334205 --- /dev/null +++ b/src/shopify/shop.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Hive Shopify API +# Copyright (c) 2008-2020 Hive Solutions Lda. +# +# This file is part of Hive Shopify API. +# +# Hive Shopify API is free software: you can redistribute it and/or modify +# it under the terms of the Apache License as published by the Apache +# Foundation, either version 2.0 of the License, or (at your option) any +# later version. +# +# Hive Shopify API is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# Apache License for more details. +# +# You should have received a copy of the Apache License along with +# Hive Shopify API. If not, see . + +__author__ = "João Magalhães " +""" The author(s) of the module """ + +__version__ = "1.0.0" +""" The version of the module """ + +__revision__ = "$LastChangedRevision$" +""" The revision number of the module """ + +__date__ = "$LastChangedDate$" +""" The last change date of the module """ + +__copyright__ = "Copyright (c) 2008-2020 Hive Solutions Lda." +""" The copyright for the module """ + +__license__ = "Apache License, Version 2.0" +""" The license for the module """ + +class ShopAPI(object): + + def get_shop(self, *args, **kwargs): + url = self.base_url + "admin/shop.json" + contents = self.get(url, **kwargs) + return contents["shop"]