Skip to main content

Python to GNU Octave bridge --> run m-files from python.

Project description

https://badge.fury.io/py/oct2py.png/ https://codecov.io/github/blink1073/oct2py/coverage.svg?branch=master

Oct2Py allows you to seamlessly call M-files and Octave functions from Python. It manages the Octave session for you, sharing data behind the scenes using MAT files. Usage is as simple as:

>>> oc = oct2py.Oct2Py()
>>> x = oc.zeros(3,3)
>>> print(x, x.dtype)
[[ 0.  0.  0.]
 [ 0.  0.  0.]
 [ 0.  0.  0.]] float64
...

If you want to run legacy m-files, do not have MATLAB®, and do not fully trust a code translator, this is your library.

Features

  • Supports all Octave datatypes and most Python datatypes and Numpy dtypes.
  • Provides OctaveMagic for IPython, including inline plotting in notebooks.
  • Supports cell arrays and structs/struct arrays with arbitrary nesting.
  • Supports sparse matrices.
  • Builds methods on the fly linked to Octave commands (e.g. zeros above).
  • Thread-safety: each Oct2Py object uses an independent Octave session.
  • Can be used as a context manager.
  • Supports Unicode characters.
  • Supports logging of session commands.
  • Optional timeout command parameter to prevent runaway Octave sessions.

Installation

You must have GNU Octave installed and in your PATH. You must have the Numpy and Scipy libraries for Python installed. See the installation instructions for more details.

Once the dependencies have been installed, run:

$ pip install oct2py

If using conda, it is available on conda-forge:

$ conda install -c conda-forge oct2py

Documentation

Documentation is available online.

For version information, see the Revision History.

Project details


Release history Release notifications

This version
History Node

4.0.6

History Node

4.0.5

History Node

4.0.4

History Node

4.0.3

History Node

4.0.2

History Node

4.0.1

History Node

4.0.0

History Node

4.0rc1

History Node

3.9.2

History Node

3.9.1

History Node

3.9.0

History Node

3.8.1

History Node

3.8.0

History Node

3.7.0

History Node

3.6.5

History Node

3.6.4

History Node

3.6.3

History Node

3.6.2

History Node

3.6.1

History Node

3.6.0

History Node

3.5.10

History Node

3.5.9

History Node

3.5.8

History Node

3.5.7

History Node

3.5.6

History Node

3.5.5

History Node

3.5.4

History Node

3.5.3

History Node

3.5.2

History Node

3.5.1

History Node

3.5.0

History Node

3.4.1

History Node

3.4.0

History Node

3.3.3

History Node

3.3.2

History Node

3.3.1

History Node

3.3.0

History Node

3.2.0

History Node

3.1.0

History Node

3.0.0

History Node

2.4.2

History Node

2.4.0

History Node

2.3.0

History Node

2.2.0

History Node

2.1.0

History Node

2.0.0

History Node

1.6.0

History Node

1.5.0

History Node

1.4.0

History Node

1.3.0

History Node

1.2.0

History Node

1.1.1

History Node

1.1.0

History Node

1.0.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
oct2py-4.0.6-py2.py3-none-any.whl (42.9 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Apr 8, 2017
oct2py-4.0.6.tar.gz (431.7 kB) Copy SHA256 hash SHA256 Source None Apr 8, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page