Skip to main content

A Python interface to OPL.

Project description

Welcome to the IBM® OPL connector for Python. Licensed under the Apache License v2.0.

With this library, you can quickly and easily add the power of optimization to your Python application. You can model your problems by using the OPL language and IDE, and integrate it in Python via Python/pandas/sql alchemy inputs/outputs.

Solving with CPLEX requires that IBM® ILOG CPLEX Optimization Studio V12.8.0 and up is installed on your machine.

Install the library

pip install doopl

Get the examples

Get your IBM® ILOG CPLEX Optimization Studio edition

  • You can get a free Community Edition of CPLEX Optimization Studio, with limited solving capabilities in term of problem size.

  • Faculty members, research professionals at accredited institutions can get access to an unlimited version of CPLEX through the IBM® Academic Initiative.

License

This library is delivered under the Apache License Version 2.0, January 2004 (see LICENSE.txt).

Starting point

The API is very compact and simple. You must have the OPL binaries in your PATH/LD_LIBRARY_PATH or DYLD_LIBRARY_PATH, depending on your platform. They are located in <cplex_studio_dir>/opl/bin/<platform> where:

  • cplex_studio_dir is the installation directory of CPLEX 12.8

  • platform is your plaform (OPL nomenclature, that is x64_win64, x86-64_linux or x86-64_osx)

Here is small sumup of the capabilities:

  • Inputs can be tuple lists, panda’s dataframe, sql alchemy fetch statements.

  • Generate, solve and get output tuplesets as panda’s dataframe

  • Get the CPLEX problem statistics and quality metrics for the solution

  • Convert all integer variables to floating point variables and vice-versa.

  • Run the conflict/relaxation mechanism.

  • Call the ‘RunSeed’ diagnosis for CPLEX/CPO based problems.

Each of these features are demonstrated with simple examples.

Here is a small example to start working with the API:

from doopl.factory import *

# Create an OPL model from a .mod file
with create_opl_model(model="file.mod") as opl:
    # tuple can be a list of tuples, a pandas dataframe...
    opl.set_input("TupleSet1", tuples)

    # Generate the problem and solve it.
    opl.run()

    # Get the names of post processing tables
    print("Table names are: "+ str(opl.output_table_names))

    # Get all the post processing tables as dataframes.
    for name, table in iteritems(opl.report):
        print("Table : " + name)
        for t in table.itertuples(index=False):
            print(t)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

doopl-12.10.0.26-cp37-cp37m-win_amd64.whl (25.0 MB view details)

Uploaded CPython 3.7m Windows x86-64

doopl-12.10.0.26-cp37-cp37m-manylinux1_x86_64.whl (293.9 kB view details)

Uploaded CPython 3.7m

doopl-12.10.0.26-cp37-cp37m-macosx_10_6_x86_64.whl (302.4 kB view details)

Uploaded CPython 3.7m macOS 10.6+ x86-64

doopl-12.10.0.26-cp36-cp36m-win_amd64.whl (25.0 MB view details)

Uploaded CPython 3.6m Windows x86-64

doopl-12.10.0.26-cp36-cp36m-manylinux1_x86_64.whl (293.9 kB view details)

Uploaded CPython 3.6m

doopl-12.10.0.26-cp36-cp36m-macosx_10_6_x86_64.whl (302.4 kB view details)

Uploaded CPython 3.6m macOS 10.6+ x86-64

doopl-12.10.0.26-cp35-cp35m-win_amd64.whl (25.0 MB view details)

Uploaded CPython 3.5m Windows x86-64

doopl-12.10.0.26-cp35-cp35m-manylinux1_x86_64.whl (293.9 kB view details)

Uploaded CPython 3.5m

doopl-12.10.0.26-cp35-cp35m-macosx_10_6_x86_64.whl (302.4 kB view details)

Uploaded CPython 3.5m macOS 10.6+ x86-64

doopl-12.10.0.26-cp27-cp27mu-manylinux1_x86_64.whl (295.7 kB view details)

Uploaded CPython 2.7mu

doopl-12.10.0.26-cp27-cp27m-win_amd64.whl (25.0 MB view details)

Uploaded CPython 2.7m Windows x86-64

doopl-12.10.0.26-cp27-cp27m-manylinux1_x86_64.whl (295.7 kB view details)

Uploaded CPython 2.7m

doopl-12.10.0.26-cp27-cp27m-macosx_10_6_x86_64.whl (303.5 kB view details)

Uploaded CPython 2.7m macOS 10.6+ x86-64

File details

Details for the file doopl-12.10.0.26-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 25.0 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 0d0f486092740b14ab392c5faf2fdb509799e794ddb51a9b6e8da8c6b264666a
MD5 8391591296526e0ffb99a33ef0c01017
BLAKE2b-256 48a24319f58d5448a4d8d8105eff99485fe168bd0c7fddb53b62c168a6fb407a

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp37-cp37m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 293.9 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 1c80eb5d9ce425b0055106f75f6cb31f614a07cb996c29a501832812ea5cb818
MD5 1331ef19bd80fbd6538c243fb7c96cde
BLAKE2b-256 a0601bb7da12592c890435fe1408545677ce713b1521e4126078addb4cad7af4

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp37-cp37m-macosx_10_6_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp37-cp37m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 302.4 kB
  • Tags: CPython 3.7m, macOS 10.6+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp37-cp37m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 e3940aff566cdf0f1da306d4f6c47d67c1b80954ffd09287fe4c60daa69fa462
MD5 8ad0856281ce4e9ef4653c9dc58e69eb
BLAKE2b-256 deca7b0c2be5681a17fc912cd2da3a319c953decde4d70745ddefd32cecdf7e0

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 25.0 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 98d4aa40569d6b6b750f9bdad1d4b36c36840172f14ad2ed786f6cb9b9b92c06
MD5 9e83a48ea994b66e280ade0d3aca2911
BLAKE2b-256 9cc15147fa7b6b9b86c4d9f4bfa9bfc445aa3d65d83b83f4848220fc683a9163

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp36-cp36m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 293.9 kB
  • Tags: CPython 3.6m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 90b0d036eac41d570dd9e999c81219db7dbf202e71517174bfa07824b93512dd
MD5 346bfeae1dbe75acb0c0118c25696db0
BLAKE2b-256 9fb1abd907d8de8ac5f145deb4d9e591de469f9c09dfd5c2ec4069e5cf48e033

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp36-cp36m-macosx_10_6_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp36-cp36m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 302.4 kB
  • Tags: CPython 3.6m, macOS 10.6+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp36-cp36m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 583fbe96792918d48d05ec6a6402c62b76a26986187f7ba98942c8b20cd39b46
MD5 5a31335cfe28d9964c190ef4572e8212
BLAKE2b-256 1282d2d0500eaa08ace119e042332a96f89d16fa47f9eb920373d740394d7dfd

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp35-cp35m-win_amd64.whl
  • Upload date:
  • Size: 25.0 MB
  • Tags: CPython 3.5m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 ae5438a658d8dc6f01af31e92ac508842f9b0a97d85f12f318c883c34d3365f1
MD5 de52796dafe7ab7910908bab037ab482
BLAKE2b-256 12e15d0f410a8bb20afde9378d77fc2d547e4b68d6b4c6b22128b9d65b5e8aae

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp35-cp35m-manylinux1_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp35-cp35m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 293.9 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp35-cp35m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 ea387add3660d20fa64b93e61f07e3c75e530bf414aa3f4b9fdd79284fd40b6d
MD5 7abc467acb5ba125c44182580d8a60f0
BLAKE2b-256 6e471822b38f21d66afd4049fd856d23ab547002728a70792c55d562a384ff2d

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp35-cp35m-macosx_10_6_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp35-cp35m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 302.4 kB
  • Tags: CPython 3.5m, macOS 10.6+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp35-cp35m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 153c7630e7315c66616415833f5e0b946e996242311963e50a29dead5594cac2
MD5 e8ee86f3a6a8c24acd9149458ede7862
BLAKE2b-256 bf0dc6460d70117b0a25f3d9430a98a64a13fe170ce667f348d2fa1ab34bfc64

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp27-cp27mu-manylinux1_x86_64.whl
  • Upload date:
  • Size: 295.7 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bd14493c748f249cce325eaa7ce63314a517c516ab920ba851cfc72c57893a6a
MD5 62447244d7b43e7513982381b13ecefb
BLAKE2b-256 f753e135d2a2bea412d161ea19a63959a13c569ee323ecd96cea2abc03e4beac

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp27-cp27m-win_amd64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp27-cp27m-win_amd64.whl
  • Upload date:
  • Size: 25.0 MB
  • Tags: CPython 2.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp27-cp27m-win_amd64.whl
Algorithm Hash digest
SHA256 14a01a1039cdd49ffb58e4b671ddcd9c417305e57330078a7aacb5b4008e96ac
MD5 fb7444d7531c8c2d7c55783c2ac03241
BLAKE2b-256 cad7682eaa674e7fbc1b57360516262f66c44bb2e237b26b6d911e9b6611ca65

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp27-cp27m-manylinux1_x86_64.whl
  • Upload date:
  • Size: 295.7 kB
  • Tags: CPython 2.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 9e03144a4f36354b42e9bd1f0698d6c99891ce996b4f62432828f37c5416ccfa
MD5 9f47e5896005fd9bf2f15c3460b6195c
BLAKE2b-256 53db744d91fd4c5cf5c0a8366d9c8c94d0fb328f64eb48e0be82bba990352cc8

See more details on using hashes here.

File details

Details for the file doopl-12.10.0.26-cp27-cp27m-macosx_10_6_x86_64.whl.

File metadata

  • Download URL: doopl-12.10.0.26-cp27-cp27m-macosx_10_6_x86_64.whl
  • Upload date:
  • Size: 303.5 kB
  • Tags: CPython 2.7m, macOS 10.6+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.13

File hashes

Hashes for doopl-12.10.0.26-cp27-cp27m-macosx_10_6_x86_64.whl
Algorithm Hash digest
SHA256 998fe1d082b7274502be22c0d83b894507bd407f0e2132da71c8a9b61f40d772
MD5 ac57dee95d2264abb1a25ebe5b026d74
BLAKE2b-256 a137263b7f4bfd9cebd14f1616f32602077f2934941e65f9284a66ffa028d362

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page