Skip to main content

Python 3 implementation of Portable Format for Analytics (PFA): producer, converter, and consumer.

Project description

titus2 logo

Build Status PyPI - Python Version PyPI version Maintenance GitHub

Project Documentation - Link

Data Scientist: Why is my cutting edge model still not in production?

Scenario 1:

IT Team: We are still implementing the scoring engine in Go/Java/C++.

Scenario 2:

IT Team: We are still figuring out how to read the model.pkl file you provided.

. .

and the push to production pang continues ..

New Features!

Changes in titus2 v1.2.0

View the complete changelog here.

Titus 2 - Portable Format for Analytics (PFA) implementation for Python 3.4+

Titus 2 is a fork of the original Titus python library which resides in the (now defunct) Hadrian repository. Titus is not actively maintained by the Open Data Group and only supports Python 2, so this fork was created to actively support its development for Python 3.

Titus 2 is a complete, independent implementation of Portable Format for Analytics (PFA) in pure Python. PFA is a specification for scoring/inference engines: event-based processors that perform predictive or analytic calculations. It is a model interchange format which helps smoothen the transition from statistical model development to large-scale and/or online production. titus2 also focuses on model development, so it includes model producers and PFA manipulation tools in addition to runtime execution (scoring) engine.


Titus 2 uses a number of open source projects to work properly:

  • avro-python3 >= 1.8.2
  • numpy >= 1.15.0
  • pytz >= 2019.1
  • pyyaml >= 5.1.2
  • ply >= 3.11

The above packages are available via pip and are automatically installed during setup.


Titus requires Python 3.4+ to run. It can be installed via pip/pip3 as follows:

$ pip install titus2

or you can directly install the latest build from github repository via

$ pip install git+

After installation please run the following elementary example in python

from titus.genpy import PFAEngine

pfa = {"input": "double",
 "output": "double",
 "action": [
   {"+": ["input", 100]}
engine, = PFAEngine.fromJson(pfa)

l = [1.0, 2.0, 3.0, 4.0, 5.0]

for num in l:
    print(num, engine.action(num))

User Guide and Tutorials

See the Project Documentation for user guide and tutorials.

Current Testing Framework

  • Unit testing status available here Build Status
  • Conformance testing status available here Build Status

Issues, Questions and Feature Requests

Please raise an issue/question/request here.


Want to contribute? Great!

Please raise an issue to discuss your ideas and send a pull request.


  • Write MORE Tests for scripts/*.
  • Add scikit-learn model export to PFA tutorials.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for titus2, version 1.2.0
Filename, size File type Python version Upload date Hashes
Filename, size titus2-1.2.0-py3-none-any.whl (254.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size titus2-1.2.0.tar.gz (227.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page