{"id":26400840,"url":"https://github.com/fulfilio/python-magento","last_synced_at":"2025-08-04T08:36:42.777Z","repository":{"id":46769757,"uuid":"43593175","full_name":"fulfilio/python-magento","owner":"fulfilio","description":"Python API to access magento API","archived":false,"fork":false,"pushed_at":"2021-09-27T06:21:34.000Z","size":93,"stargazers_count":48,"open_issues_count":12,"forks_count":61,"subscribers_count":12,"default_branch":"develop","last_synced_at":"2025-03-10T06:37:53.567Z","etag":null,"topics":["api","magento"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fulfilio.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-03T08:45:49.000Z","updated_at":"2025-02-20T15:15:54.000Z","dependencies_parsed_at":"2022-09-26T18:11:57.946Z","dependency_job_id":null,"html_url":"https://github.com/fulfilio/python-magento","commit_stats":null,"previous_names":["fulfilio/magento"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulfilio%2Fpython-magento","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulfilio%2Fpython-magento/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulfilio%2Fpython-magento/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fulfilio%2Fpython-magento/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fulfilio","download_url":"https://codeload.github.com/fulfilio/python-magento/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243910677,"owners_count":20367546,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","magento"],"created_at":"2025-03-17T14:37:50.021Z","updated_at":"2025-03-17T14:37:57.882Z","avatar_url":"https://github.com/fulfilio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Magento Python API\n==================\n\nPython library to connect to Magento Webservices.\n\nUsage\n-----\n\n.. code-block:: python\n\n    import magento\n\n    url = 'http://domain.com/'\n    apiuser = 'user'\n    apipass = 'password'\n\n    # Create an instance of API\n    client = magento.API(url, apiuser, apipass)\n\n    # A filter expression as dictionary. \n    order_filter = {'created_at':{'from':'2011-09-15 00:00:00'}}\n    products = client.product.list(order_filter)\n\n    # Get a list of product types\n    product_types = client.product_types.list()\n        \n    # Get a specific product\n    sku = 'prod1'\n    product = client.product.info(sku)\n\n    # Add comment to an order\n    order_increment_id = '100000001 '\n    status = 'canceled'\n    client.order.addcomment(order_increment_id, status)\n\n\nAll available APIs\n-------------------\n\n* Cart (`client.cart`)\n* CartCoupon (`client.cart_coupon`)\n* CartCustomer (`client.cart_customer`)\n* CartPayment (`client.cart_payment`)\n* CartProduct (`client.cart_product`)\n* CartShipping (`client.cart_shipping`)\n* Category (`client.category`)\n* CategoryAttribute (`client.category_attribute`)\n* Country (`client.country`)\n* CreditMemo (`client.credit_memo`)\n* Customer (`client.customer`)\n* CustomerAddress (`client.customer_address`)\n* CustomerGroup (`client.customer_group`)\n* Inventory (`client.inventory`)\n* Invoice (`client.invoice`)\n* Magento (`client.magento`)\n* Order (`client.order`)\n* Product (`client.product`)\n* ProductAttribute (`client.product_attribute`)\n* ProductAttributeSet (`client.product_attribute_set`)\n* ProductConfigurable (`client.product_configurable`)\n* ProductImages (`client.product_images`)\n* ProductLinks (`client.product_links`)\n* ProductTierPrice (`client.product_tier_price`)\n* ProductTypes (`client.product_types`)\n* Region (`client.region`)\n* Shipment (`client.shipment`)\n* Store (`client.store`)\n\nOld deprecated example\n----------------------\n\nThe API was originally written with the requirement to call APIs\nindividually with all the credentials. This led to very verbose code and a\nlot of repitition. While the behavior has not been deprecated, it is\nrecommended to write all new code with the pattern shown in the above\nexample.\n\n.. code-block:: python\n\n    import magento\n\n    url = 'http://domain.com/'\n    apiuser = 'user'\n    apipass = 'password'\n\n    with magento.Order(url, apiuser, apipass) as order_api:\n        order_increment_id = '100000001 '\n        status = 'canceled'\n        order_api.addcomment(order_increment_id, status)\n\n    with magento.Store(url, apiuser, apipass) as store_api:\n        store_id = '1'\n        store_view_info = store_api.info(store_id)\n        store_views = store_api.list()\n\n     with magento.Magento(url, apiuser, apipass) as magento_api:\n        magento_info = magento_api.info()\n\n\nCalling custom classes from your own API extensions\n---------------------------------------------------\n\nYou can ddirectly invoke the underlying `call` method\nto make calls directly.\n\n.. code-block:: python\n\n    result = client.call('custom_model.list', [])\n\n\nAlternatively, you can also build sub classes of API to have\na more pythonic structure. The subclasses are automatically\nregistered with API when classes are created. \n\nTo ensure that they are registered before you create the first API\ninstance, always have all your imports on the top of your magento module.\n\n.. code-block:: python\n\n    class CustomModel(API):\n        def list(self):\n            return self.call('custom_model.list', [])\n\nwhich would be automatically registered as `custom_model` by the API\nmetaclass. So you can now use\n\n.. code-block:: python\n\n    import magento\n    from my_custom_module import CustomModel\n\n    url = 'http://domain.com/'\n    apiuser = 'user'\n    apipass = 'password'\n\n    # Create an instance of API\n    client = magento.API(url, apiuser, apipass)\n    \n    client.custom_model.list()\n\n\nLicense\n-------\n\nBSD 3-Clause\n\nSee LICENSE for more details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffulfilio%2Fpython-magento","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffulfilio%2Fpython-magento","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffulfilio%2Fpython-magento/lists"}