Libraries for E-commerce and Payments in Popular Python

In this Python article, let's learn about E-commerce: Libraries for E-commerce and Payments in Popular Python

Table of contents:

  • alipay - Unofficial Alipay API for Python.
  • Cartridge - A shopping cart app built using the Mezzanine.
  • django-oscar - An open-source e-commerce framework for Django.
  • django-shop - A Django based shop system.
  • forex-python - Foreign exchange rates, Bitcoin price index and currency conversion.
  • merchant - A Django app to accept payments from various payment processors.
  • money - Money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange.
  • python-currencies - Display money format and its filthy currencies.
  • saleor - An e-commerce storefront for Django.
  • shoop - An open source E-Commerce platform based on Django.

What is e-commerce in Python?

Saleor is an open-source e-commerce platform built with Python, GraphQL, Django and React. Its goal is to deliver dynamic, speedy and personalized shopping solutions and help you create beautiful online stores.

Frameworks and libraries for e-commerce and payments

  1. Alipay

An Unofficial Alipay API for Python, It Contain these API:

  • Generate direct payment url
  • Generate partner trade payment url
  • Generate standard mixed payment url
  • Generate batch trans pay url
  • Generate send goods confirm url
  • Generate forex trade url
  • Generate QR code url
  • Verify notify
  • Single Trade Query
  • Generate Refund With Pwd URL


pip install alipay



>>> from alipay import Alipay
>>> alipay = Alipay(pid='your_alipay_pid', key='your_alipay_key', seller_email='your_seller_mail')

Or you can use seller_id instead of seller_email:

>>> alipay = Alipay(pid='your_alipay_pid', key='your_alipay_key', seller_id='your_seller_id')

Generate direct payment url



>>> alipay.create_direct_pay_by_user_url(out_trade_no='your_order_id', subject='your_order_subject', total_fee='100.0', return_url='your_order
_return_url', notify_url='your_order_notify_url')

View on GitHub

2.  cartridge

Cartridge is a shopping cart application built using the Django framework. It is BSD licensed, and designed to provide a clean and simple base for developing e-commerce websites. It purposely does not include every conceivable feature of an e-commerce website; instead, Cartridge focuses on providing core features common to most e-commerce websites.

This specific focus stems from the idea that every e-commerce website is different, is tailored to the particular business and products at hand, and should therefore be as easy to customize as possible. Cartridge achieves this goal with a code-base that is as simple as possible and implements only the core features of an e-commerce website.

Cartridge extends the Mezzanine content management platform. A live demo of Cartridge can be found by visiting the Mezzanine live demo.


Cartridge is designed as a plugin for the Mezzanine content management platform, and therefore requires Mezzanine to be installed. The integration of the two applications should occur automatically by following the installation instructions below.


The easiest method is to install directly from PyPI using pip by running the command below, which will also install the required dependencies mentioned above:

$ pip install -U cartridge

Otherwise, you can download Cartridge and install it directly from source:

$ python install

Once installed, the command mezzanine-project can be used to create a new Mezzanine project, with Cartridge installed, in similar fashion to

$ mezzanine-project -a cartridge project_name
$ cd project_name
$ python createdb --noinput
$ python runserver

Here we specify the -a switch for the mezzanine-project command, which tells it to use an alternative package (cartridge) for the project template to use. Both Mezzanine and Cartridge contain a project template package containing the and modules for an initial project. If you'd like to add Cartridge to an existing Mezzanine or Django project, you'll need to manually configure these yourself. See the FAQ section of the Mezzanine documentation for more information.


The createdb command is a shortcut for using Django's migrate command, which will also install some demo content, such as a contact form, image gallery, and more. If you'd like to omit this step, use the --nodata option with createdb.

You should then be able to browse to and log in using the default account (username: admin, password: default). If you'd like to specify a different username and password during set up, simply exclude the --noinput option included above when running createdb.

View on GitHub

3.  django-oscar

Oscar is an e-commerce framework for Django designed for building domain-driven sites. It is structured such that any part of the core functionality can be customised to suit the needs of your project. This allows a wide range of e-commerce requirements to be handled, from large-scale B2C sites to complex B2B sites rich in domain-specific business logic.

View on GitHub

4.  django-SHOP

Django-SHOP aims to be a the easy, fun and fast e-commerce counterpart to django-CMS.

Build the database model out of the product's properties – not vice versa

Most e-commerce systems are shipped with a predefined database model for products. But products can vary a lot, and it simply is impossible to create a model which fits for all of them. This is esspecially true for products with a hierarchy of variants. In many popular e-commerce platforms, you either have far too many attributes per product, and/or the really required attributes are missing.

In django-SHOP implementations, the product models reflect their pysical properties making it possible to create complete and deep hierarchies of variations, but without having to fiddle with unneeded properties. It furthermore avoids the need for an Entity Attribute Value Model, which is considered a database anti-pattern, because it produces far too many table joins, when filtering by property.

Don't build pages using hard-coded templates – compose them

With the advent of frameworks, such as Angular, React, Vue and Aurelia, building web-applications shifted from a page-centric to a component-based approach.

In django-SHOP, you are in full control over the page's layout, since all components are encapsulated and independent from each other. This means that instead of adopting the Catalog, Cart, Checkout and Order pages, use the django-CMS plugin system to compose everything required for those pages.

View on GitHub

5.  forex-python

Forex Python is a Free Foreign exchange rates and currency conversion.

Features of Forex Python:

  • List all currency rates.
  • BitCoin price for all currencies.
  • Converting amount to BitCoins.
  • Get historical rates for any day since 1999.
  • Conversion rate for one currency(ex; USD to INR).
  • Convert amount from one currency to other.('USD 10$' to INR).
  • Currency symbols.
  • Currency names.

BitCoin Price Source:

Bitcoin prices calculated every minute. For more information visit [CoinDesk](


Install using python package

pip install forex-python

        Or directly cloning the repo:

python install

Usage Examples:

Initialize class

>>> from forex_python.converter import CurrencyRates
>>> c = CurrencyRates()

list all latest currency rates for "USD"

>>> c.get_rates('USD')
{u'IDR': 13625.0, u'BGN': 1.7433, u'ILS': 3.8794, u'GBP': 0.68641, u'DKK': 6.6289, u'CAD': 1.3106, u'JPY': 110.36, u'HUF': 282.36, u'RON': 4.0162, u'MYR': 4.081, u'SEK': 8.3419, u'SGD': 1.3815, u'HKD': 7.7673, u'AUD': 1.3833, u'CHF': 0.99144, u'KRW': 1187.3, u'CNY': 6.5475, u'TRY': 2.9839, u'HRK': 6.6731, u'NZD': 1.4777, u'THB': 35.73, u'EUR': 0.89135, u'NOK': 8.3212, u'RUB': 66.774, u'INR': 67.473, u'MXN': 18.41, u'CZK': 24.089, u'BRL': 3.5473, u'PLN': 3.94, u'PHP': 46.775, u'ZAR': 15.747}

Get conversion rate from USD to INR

>>> c.get_rate('USD', 'INR')

View on GitHub

6.  Django-Merchant

Django-Merchant is a django application that enables you to use multiple payment processors from a single API.


Following gateways are supported:

  • Paypal
  • Eway
  • Braintree Payments (Server to Server)
  • Stripe
  • Paylane
  • WePay
  • Beanstream
  • Chargebee
  • Global Iris

Off-Site Processing

  • Paypal
  • RBS WorldPay
  • Amazon FPS
  • Braintree Payments (Transparent Redirect)
  • Stripe.js
  • eWAY
  • Direct Post Method
  • Global Iris RealMPI

View on GitHub

7.  Money

Money class with optional CLDR-backed locale-aware formatting and an extensible currency exchange solution.


Install the latest release with:

pip install money

For locale-aware formatting, also install the latest version of Babel (2.2 or 2.3 required):

pip install babel


>>> from money import Money
>>> m = Money(amount='2.22', currency='EUR')
>>> m
EUR 2.22

amount can be any valid value in decimal.Decimal(value) and currency should be a three-letter currency code. Money objects are immutable by convention and hashable. Once created, you can use read-only properties amount (decimal.Decimal) and currency (str) to access its internal components:

>>> m = Money(2, 'USD')
>>> m.amount
>>> m.currency

Money emulates a numeric type and you can apply most arithmetic and comparison operators between money objects, as well as addition, subtraction, and division with integers (int) and decimal numbers (decimal.Decimal):

>>> m = Money('2.22', 'EUR')
>>> m / 2
EUR 1.11
>>> m + Money('7.77', 'EUR')
EUR 9.99

View on GitHub

8.  Python Currencies

Display money format and its filthy currencies, for all money lovers out there.


currencies is available on PyPi

So easily install it by pip

`$ pip install currencies

Or by easy_install

$ easy_install currencies

Another way is by cloning currencies's git repo

$ git clone git://

Then install it by running:

$ python install


Displaying money format:

>>> from currencies import Currency
>>> currency = Currency('USD')
>>> currency.get_money_format(13)
>>> '$13'
>>> currency.get_money_format(13.99)
>>> '$13.99'
>>> currency.get_money_format('13,2313,33')
>>> '$13,2313,33'
>>> # Displaying with currency as well
>>> currency.get_money_with_currency_format(13)
>>> '$13 USD'
>>> currency.get_money_with_currency_format(13.99)
>>> '$13.99 USD'
>>> currency.get_money_with_currency_format('13,2313,33')
>>> '$13,2313,33 USD'

View on GitHub

9.  Saleor

A modular, high performance, headless e-commerce platform built with Python, GraphQL, Django, and React.

What makes Saleor special?

Saleor is a rapidly-growing open source e-commerce platform that has served high-volume companies from branches like publishing and apparel since 2012. Based on Python and Django, the latest major update introduces a modular front end powered by a GraphQL API and written with React and TypeScript.


  • Headless / API first: Build mobile apps, custom storefronts, POS, automation, etc
  • Extensible: Build anything with webhooks, apps, metadata, and attributes
  • GraphQL API: Get many resources in a single request and more
  • Multichannel: Per channel control of pricing, currencies, stock, product, and more
  • Enterprise ready: Secure, scalable, and stable. Battle-tested by big brands
  • CMS: Content is king, that's why we have a kingdom built-in
  • Dashboard: User friendly, fast, and productive. (Decoupled project repo )
  • Global by design Multi-currency, multi-language, multi-warehouse, tutti multi!
  • Orders: A comprehensive system for orders, dispatch, and refunds
  • Cart: Advanced payment and tax options, with full control over discounts and promotions
  • Payments: Flexible API architecture allows integration of any payment method
  • SEO: Packed with features that get stores to a wider audience
  • Cloud: Optimized for deployments using Docker


See the Saleor docs for step-by-step installation and deployment instructions.

Note: The main branch is the development version of Saleor and it may be unstable. To use the latest stable version, download it from the Releases page or switch to a release tag.

View on GitHub

Frequently asked questions about E-commerce python

  • Can I make eCommerce website with Python?

The system is implemented using Python's web framework Django. To develop an e-commerce website, it is necessary to study and understand many technologies. Scope: The scope of the project will be limited to some functions of the e-commerce website.

  • Is Django used for eCommerce?

Django is perfect for e-commerce startups, as it's a good fit for small websites and can scale perfectly with business growth. You can rely on Django to handle hundreds/thousands of visitors at a time. It's built with independent components you can unplug or replace depending on your needs at any specific time.

  • Which programming language is best for eCommerce?

JavaScript. Thanks to its dynamic capability and versatility, JavaScript has become the most popular and best programming language for eCommerce sites. The main peculiarity of this language is that it's supported by most web browsers. JavaScript can be used for both back end and front end eCommerce development

Related videos:

How to Build an E-commerce Website with Django and Python

⭐️ Course Contents ⭐️
⌨️ (0:00:00) Setup and project configuration
⌨️ (0:16:55) Adding items to a cart
⌨️ (0:54:09) Improving the UI
⌨️ (1:10:34) Creating an order summary
⌨️ (1:38:03) The checkout process
⌨️ (2:10:46) Handling payments with Stripe
⌨️ (2:37:33) Discount codes
⌨️ (3:07:41) Managing refunds
⌨️ (3:31:31) Default addresses
⌨️ (4:12:30) Saving credit card information

Related posts:

#python #ecommerce 

What is GEEK

Buddha Community

Libraries for E-commerce and Payments in Popular Python
Ray  Patel

Ray Patel


Lambda, Map, Filter functions in python

Welcome to my Blog, In this article, we will learn python lambda function, Map function, and filter function.

Lambda function in python: Lambda is a one line anonymous function and lambda takes any number of arguments but can only have one expression and python lambda syntax is

Syntax: x = lambda arguments : expression

Now i will show you some python lambda function examples:

#python #anonymous function python #filter function in python #lambda #lambda python 3 #map python #python filter #python filter lambda #python lambda #python lambda examples #python map

Top E-Commerce App Development Company in USA

Looking to develop an eCommerce app for your business? We at, AppClues Infotech provide the best eCommerce mobile app development services for Android and iOS users. Get in touch with our eCommerce experts to take your e-commerce business to the next level.

For more info:
Call: +1-978-309-9910

#e-commerce app development company in usa #hire e-commerce app developers in usa #custom e-commerce app development #create an e-commerce app #cost to build e-commerce app #m-commerce app development company in usa

Top E-Commerce Mobile App Developers in USA

Looking to develop an E-Commerce app for your business or start-up? We at, AppClues Infotech have the best team of E-Commerce mobile app developers in USA for iOS & Android users. Get in touch with our E-Commerce experts to take your E-Commerce business to the next level.

E-Commerce App Development Services
• Ecommerce Technology Consulting
• Custom E-Commerce App Development
• E-Commerce Wallet Development
• E-Commerce Plugin Integration
• E-Commerce App UI/UX Designing
• B2B & B2C E-Commerce App Solutions

For more info:
Call: +1-978-309-9910

#e-commerce app development company in usa #hire e-commerce app developers in usa #custom e-commerce app development #create an e-commerce app #cost to build e-commerce app #m-commerce app development company in usa

Shardul Bhatt

Shardul Bhatt


Why use Python for Software Development

No programming language is pretty much as diverse as Python. It enables building cutting edge applications effortlessly. Developers are as yet investigating the full capability of end-to-end Python development services in various areas. 

By areas, we mean FinTech, HealthTech, InsureTech, Cybersecurity, and that's just the beginning. These are New Economy areas, and Python has the ability to serve every one of them. The vast majority of them require massive computational abilities. Python's code is dynamic and powerful - equipped for taking care of the heavy traffic and substantial algorithmic capacities. 

Programming advancement is multidimensional today. Endeavor programming requires an intelligent application with AI and ML capacities. Shopper based applications require information examination to convey a superior client experience. Netflix, Trello, and Amazon are genuine instances of such applications. Python assists with building them effortlessly. 

5 Reasons to Utilize Python for Programming Web Apps 

Python can do such numerous things that developers can't discover enough reasons to admire it. Python application development isn't restricted to web and enterprise applications. It is exceptionally adaptable and superb for a wide range of uses.

Robust frameworks 

Python is known for its tools and frameworks. There's a structure for everything. Django is helpful for building web applications, venture applications, logical applications, and mathematical processing. Flask is another web improvement framework with no conditions. 

Web2Py, CherryPy, and Falcon offer incredible capabilities to customize Python development services. A large portion of them are open-source frameworks that allow quick turn of events. 

Simple to read and compose 

Python has an improved sentence structure - one that is like the English language. New engineers for Python can undoubtedly understand where they stand in the development process. The simplicity of composing allows quick application building. 

The motivation behind building Python, as said by its maker Guido Van Rossum, was to empower even beginner engineers to comprehend the programming language. The simple coding likewise permits developers to roll out speedy improvements without getting confused by pointless subtleties. 

Utilized by the best 

Alright - Python isn't simply one more programming language. It should have something, which is the reason the business giants use it. Furthermore, that too for different purposes. Developers at Google use Python to assemble framework organization systems, parallel information pusher, code audit, testing and QA, and substantially more. Netflix utilizes Python web development services for its recommendation algorithm and media player. 

Massive community support 

Python has a steadily developing community that offers enormous help. From amateurs to specialists, there's everybody. There are a lot of instructional exercises, documentation, and guides accessible for Python web development solutions. 

Today, numerous universities start with Python, adding to the quantity of individuals in the community. Frequently, Python designers team up on various tasks and help each other with algorithmic, utilitarian, and application critical thinking. 

Progressive applications 

Python is the greatest supporter of data science, Machine Learning, and Artificial Intelligence at any enterprise software development company. Its utilization cases in cutting edge applications are the most compelling motivation for its prosperity. Python is the second most well known tool after R for data analytics.

The simplicity of getting sorted out, overseeing, and visualizing information through unique libraries makes it ideal for data based applications. TensorFlow for neural networks and OpenCV for computer vision are two of Python's most well known use cases for Machine learning applications.


Thinking about the advances in programming and innovation, Python is a YES for an assorted scope of utilizations. Game development, web application development services, GUI advancement, ML and AI improvement, Enterprise and customer applications - every one of them uses Python to its full potential. 

The disadvantages of Python web improvement arrangements are regularly disregarded by developers and organizations because of the advantages it gives. They focus on quality over speed and performance over blunders. That is the reason it's a good idea to utilize Python for building the applications of the future.

#python development services #python development company #python app development #python development #python in web development #python software development

Custom E-Commerce App Development Services Provider Company in USA

Do you want to make a custom E-Commerce mobile app for your business? We at AppClues Infotech is the best E-Commerce mobile app development company in the USA that provides a complete E-Commerce app solution with the current trending technologies & features at an affordable cost.

For more info:
Call: +1-978-309-9910

#e-commerce app development #mobile commerce app development #e-ccommerce app development company usa #e-commerce development services usa #custom e-commerce app development #e-commerce app development services