Python Success Stories (2024)

Nexedi is a leader in high-end enterprise services, providing solutions forEnterprise Resource Planning (ERP), Customer Relationship Management (CRM),and eCommerce. Nexedi has built its business on Open Source, and has designedand released an ERP/CRM framework called ERP5 under the GPL Free Softwarelicense.

ERP5 is in production in the apparel industry and government agencies withmulti-gigabyte databases that track millions of warehouse stock movements.ERP5 is written entirely in Python and leverages the Zope Enterprise Objectsframework to provide high performance and availability on clusters ofinexpensive PCs.

The ERP5 project started in 2002 when Coramy, an apparel industry leader inEurope, decided to migrate its in-house ERP solution to a new open sourcemodel. The choice of open source for Coramy ERP was a strategic move to reducesoftware maintenance costs and to allow Coramy to retain complete control overits custom developments, something that would have been impossible withstandard proprietary ERP solutions.

Nexedi was created as an independent company in charge ofdeveloping, implementing, and disseminating the ERP5 technology. Nexedi wasgiven a budget of 80,000 EUR to develop a generic ERP framework publishedunder GPL license and customize it for Coramy's specific needs.

Working with this small budget, ERP5's developers needed to look to innovativeapproaches and code reuse to cut development costs. At the most abstractlevel, ERP5 is based on five generic classes used by all modules: Resource,Node, Movement, Item, and Path. This model, known as the ERP5 UniversalBusiness Model, makes it possible to reuse code by abstracting away from thespecific domain and encapsulating the generic relationships and actions commonto many business processes. As a result, modules as different as Payroll andInvoice can share almost of all their code.

Python Success Stories (1)

In this example of the ERP5 Universal Business Model, Movement allows thetransfer of a quantity of resource from one node to another, Path allowsplanning of resource sourcing, and Item provides Resource traceability.Zoom in

The ERP5 abstract model architecture requires a well-designed object languagethat supports high level abstraction. Selecting an appropriate implementationlanguage became strategic to the project's success. The project also requiredcomplete multi-platform OS abstraction, a rich library for Web applications, arapid GUI development toolkit, support for internationalization, widecommunity support, and proven maturity. The short list of candidates quicklybecame: Java or Python. Or, more precisely, Java+Jakarta or Python+Zope.

Two key factors led to the choice of Python. First, was the need to makeextensive use of metaprogramming. Second, for simplicity's sake, ERP5 neededto be implemented in a single language from core architecture to scripting.

Metaprogramming is a technique that allows the programmer to redefine thesemantics of the implementation language at runtime. It can be used to endowextremely abstract implementations with domain-specific behaviors that aremodeled in properties or tables, rather than hand-coded. In ERP5, thispowerful technique allows 95% of the class methods to be generatedautomatically from lists of properties that define each unique custom ERPimplementation. This has reduced maintenance costs by an order of magnitude:The typical ERP5 system contains 100,000 lines of code, rather than the1,000,000 lines of code required in similar projects based on traditionalprogramming techniques.

Python supports efficient metaprogramming through powerful introspectionfeatures that allow programs to inspect and modify code at runtime. Java'sintrospection are by contrast quite poor and inflexible. Metaprogramming inJava requires writing preprocessors, which would have added prohibitively tothe cost and complexity of implementing the ERP5 system.

Another advantage that Python had over Java was that it could be used at alllevels of the system, from core implementation to scripting. Most ERP systems,while written in one language, use another scripting language to allowflexible configuration at run time by ERP administrators. Python is equallywell suited both for scripting and core development, reducing complexity andincreasing the flexibility of the system. Using Python allowed code initiallywritten as scripts to be incorporated afterward into core components, and viceversa, wherever this made sense. With Java, it would have been necessary toprovide a separate scripting environment based on a different language, suchas Jython or ECMAScript, and reusing scripting code in core components wouldhave been much more difficult.

In addition to leveraging these high-level language capabilities, the ERP5project also needed to base on an existing turn-key application server withsupport for transparent object persistence, transactions, and workflow. Thiswould allow the project to focus its limited resources on application design,rather than on application server design.

Zope, a Python-based application server, fulfilled this need. In 2002, Zopewas already a mature application server environment while Jakarta was stillrather immature. Zope provided clustering, object storage, object publication,transactions, security, workflows, and a web-based management interface, allin a turn-key package. Zope and Python, unlike Java, also provided thelicensing needed for complete freedom in distributing code on LiveCD, in RPMpackages, and so forth.

In some applications needed in ERP, such as in Point-of-Sales (POS), anautonomous client/server GUI application provides better results than a pureWeb-based solution. For these cases, the ERP5 project team selected PyQt,which supports the rapid development of multi-platform client/serverapplications with native look and feel. Autonomous applications written inPyQt could interoperate with Zope through the XML-RPC and SOAPimplementations available for Python.

In January 2003, the initial ERP5 modules went into production at the Coramyfactory and design center.

The ERP5 architecture relies completely on Zope for data storage, transactionsand workflow management. The user interface is based on an extended version ofMartijn Faassen's Formulator component. ERP5 itself is implemented as a setof Zope components. Overall, thanks to massive code reuse and fast coding,ERP5's initial development was completed in less than one year. The choice ofPython and Zope proved to be a good one.

Part of this success was due to Nexedi's ZSQLCatalog component whichleverages Zope's object database to implement an innovative approach forquerying objects and data mining.

ZSQLCatalog solves several major problems often encountered in Enterpriseapplications: locks, slow reports, and inconsistent transactions. MostEnterprise applications use tables in a relational database to store data. InERP5 data is stored instead in Zope's object database. Zope eliminates theneed for storage adapters or attribute mappings by providing transparentpersistence of Python objects. Zope also speeds up object access: Reading theZope object database is 10 to 100 times faster than retrieving a row from thefastest relational databases available on the market today. Finally, unlikerelational databases, transactions in a Zope object database can last minuteswithout causing deadlocks.

One limitation encountered in Zope was that it does not provide an efficienttool for querying the millions of objects that are needed in an ERP solution.To solve this, Nexedi's ZSQLCatalog maps between attributes or methods ofobjects and relational columns, tables, and databases. This mapping is notintended to store actual object attributes into relational tables, but ratheronly those attributes relevant to facilitating fast queries. In this way, therelational database is used as an index into the Zope object database.

Python Success Stories (2)

To provide support for fast queries of the object database, ZSQLCatalogcopies select attributes (dots) and relations (lines) from the object databaseinto tables of a relational database. Zoom in

ZSQLCatalog can be viewed as a kind of Relational Online Analytical Processing(ROLAP) component for object databases, and it provides a nice interface forextracting reports from the object database into OpenOffice or Microsoft Excelspreadsheets.

ZSQLCatalog was very successful in this project: a Zope database with morethan 2,000,000 objects can be queried with statistical methods in a fewmilliseconds.

Coramy's requirements for ERP5 included the need to deploy applications in itsfactories in Tunisia. This posed some additional challenges, since internetconnectivity between Africa and Europe is not always perfect and can be veryexpensive. Given Coramy's modest budget for network connectivity, the projecthad to provide a solution for synchronizing two ERP5 servers over slow andunreliable transcontinental internet connectivity.

To do this, Nexedi implemented the SyncML protocol in Zope, using email orhttp as the transport layer. Early prototypes were developed in a few weeks,using Python's rich library for network protocols and XML parsing.

Turning those prototypes into an industrial-strength solution turned out to bea bit more complex, due to the many possible failure cases the code had tohandle. Nexedi used Python's unit testing framework to write extensive testsof the SyncML implementation. These tests could test every part of the SyncMLcomponent, especially those that would be difficult to test in the field, andreport any problems back to the developer. Once this was done, the ERP5SyncMLcomponent became reliable. In the process of testing, some minor bugs occurringin complex situations were found in the Python libraries. Because Python isopen source, the ERP5 developers could find and fix the bugs quickly andcontribute the fixes back to the Python community.

ERP5SyncML is now being used not only by ERP5 but was also adopted bythe Nuxeo CPS, a Content Management System, as a way tosynchronize documents between French government agencies.

Some aspects of an ERP system's database query functionality requiremathematics that go beyond the capabilities of the relational query model. Forexample, ERP5 uses linear programming to determine resource capacities.Although Python includes excellent numerical frameworks, C or FORTRANimplementation of complex scientific algorithms is usually much moreefficient.

Nexedi found the GNU Linear Programming Kit (GLPK) to be a good startingpoint for ERP5's linear programming needs. GPLK is written in C, andinterfacing it to Python was achieved in only a couple of hours usingthe SWIG glue libraries. Nexedi now distributes a Python GLPK module,python-glpk, which provides the power of linear programming in Python.

The ERP5 abstract model has been found to reduce development costs by an orderof magnitude when compared to traditional ERP architectures, and it hasperformed well in large mission-critical Enterprise applications. ERP5'slargest system runs on a cluster of eight CPUs. It serves fifty simultaneoususers, each of them with eight parallel sessions, and it handles more than2,000,000 Python objects. Its ZSQLCatalog relational index holds more than10,000,000 rows.

Python and Zope were key to this success. Python provided a powerful objectlanguage and a rich set of libraries which allowed quick development of cleanand compact code. Zope provided a mature application server and objectdatabase.

Nexedi is sometimes asked: Why not Java and J2EE? While it would be possibleto create a similar system with Java and J2EE, development costs would be muchhigher. Jakarta and ObjectWeb have both matured but are still poorlyintegrated when compared with Zope, and require a much more complexdevelopment style. Java's poor introspection features are also still a seriouslimitation for efficient metaprogramming, for using Java itself as a scriptinglanguage, or for flexible object persistence. Using Java is simply notconsistent with today's trend of cost cutting in Enterprise development. Ifthe choice were made again today, Nexedi would still opt for Python and Zope.

In June 2004, ERP5 was nominated for "best enterprise project" by DecisionInformatique professional magazine. Nexedi is now working to simplify theERP5 setup and configuration process, in order to ease its adoption by a wideraudience of open source developers.

Dr. Jean-Paul Smets is CEO of Nexedi. Nexedi develops ERP5, a high end ERP /CRM / eCommerce solution based on Zope application server and published underOpen Source / Free Software licenses. Nexedi provides complete enterpriseconsulting, software development and professional training services for ERP5.Nexedi clients include the apparel industry, consumer electronics industry,telecommunication companies, and government agencies.

Python Success Stories (2024)
Top Articles
Latest Posts
Article information

Author: Kieth Sipes

Last Updated:

Views: 5730

Rating: 4.7 / 5 (47 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Kieth Sipes

Birthday: 2001-04-14

Address: Suite 492 62479 Champlin Loop, South Catrice, MS 57271

Phone: +9663362133320

Job: District Sales Analyst

Hobby: Digital arts, Dance, Ghost hunting, Worldbuilding, Kayaking, Table tennis, 3D printing

Introduction: My name is Kieth Sipes, I am a zany, rich, courageous, powerful, faithful, jolly, excited person who loves writing and wants to share my knowledge and understanding with you.