Skip to main content

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

Project description

https://badge.fury.io/py/oct2py.png/ https://pypip.in/d/oct2py/badge.png https://coveralls.io/repos/blink1073/oct2py/badge.png?branch=master

Oct2py is a means to seemlessly 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 with arbitrary nesting.

  • Supports sparse matrices.

  • Builds methods on the fly linked to Octave commands (e.g. zeros above).

  • Nargout is automatically inferred by the number of return variables.

  • Thread-safety: each Oct2Py object uses an independent Octave session.

  • Can be used as a context manager.

  • Supports unicode characters.

Installation

You must have GNU Octave installed and in your PATH. On Windows, the easiest way to get Octave is to use an installer from sourceforge.. On Linux, it should be available from your package manager. Additionally, you must have the numpy and scipy libraries installed.

To install Oct2py, simply:

$ pip install oct2py

Or, if you absolutely must:

$ easy_install oct2py

Documentation

Documentation is available at http://pythonhosted.org/oct2py/.

Release History

1.1.0 (2013-11-3)

  • Full support for plotting with no changes to user code

  • Support for Nargout = 0

  • Overhaul of front end documentation

  • Improved test coverage and added badge.

  • Supports Python 2 and 3 from a single code base.

  • Fixed: Allow help(Oct2Py()) and tab completion on REPL

  • Fixed: Allow tab completion for Oct2Py().<TAB> in REPL

1.0.0 (2013-10-4)

  • Support for Python 3.3

  • Added logging to Oct2Py class with optional logger keyword

  • Added context manager

  • Added support for unicode characters

  • Improved support for cell array and sparse matrices

  • Fixed: Changes to user .m files are now refreshed during a session

  • Fixed: Remove popup console window on Windows

0.4.0 (2013-01-05)

  • Singleton elements within a cell array treated as a singleton list

  • Added testing on 64 bit architecture

  • Fixed: Incorrect Octave commands give a more sensible error message

0.3.6 (2012-10-08)

  • Default Octave working directory set to same as OS working dir

  • Fixed: Plot rending on older Octave versions

0.3.4 (2012-08-17)

  • Improved speed for larger matrices, better handling of singleton dimensions

0.3.0 (2012-06-16)

  • Added Python 3 support

  • Added support for numpy object type

0.2.1 (2011-11-25)

  • Added Sphinx documentation

0.1.4 (2011-11-15)

  • Added support for pip

0.1.0 (2011-11-11)

  • Initial Release

Project details


Release history Release notifications | RSS feed

This version

1.1.0

Download files

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

Source Distributions

oct2py-1.1.0.zip (40.1 kB view details)

Uploaded Source

oct2py-1.1.0.tar.gz (27.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

oct2py-1.1.0.win32-py3.3.exe (224.8 kB view details)

Uploaded Source

oct2py-1.1.0.win32-py3.2.exe (224.8 kB view details)

Uploaded Source

oct2py-1.1.0.win32-py2.7.exe (224.8 kB view details)

Uploaded Source

oct2py-1.1.0-py2.py3-none-any.whl (26.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file oct2py-1.1.0.zip.

File metadata

  • Download URL: oct2py-1.1.0.zip
  • Upload date:
  • Size: 40.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for oct2py-1.1.0.zip
Algorithm Hash digest
SHA256 45bf3686c5ab5b358a32415441d1b5c8882547a5da36b570953dcf94d0225d74
MD5 d4f7634dd2c63501492bf047f5229103
BLAKE2b-256 06d1a478a34f10a829148cce69481f6549d7e86a97860224c560e8330104ab3c

See more details on using hashes here.

File details

Details for the file oct2py-1.1.0.tar.gz.

File metadata

  • Download URL: oct2py-1.1.0.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for oct2py-1.1.0.tar.gz
Algorithm Hash digest
SHA256 a9fcb633ac3f7af467bcdeaa1922894e2674d581d5706155a94ddb889d786e8f
MD5 f208a4d3f16af6695603c66aeb2632da
BLAKE2b-256 255909feb017a5c4bad8960ab090aacd5021173cda608901150b722c0fc36c7d

See more details on using hashes here.

File details

Details for the file oct2py-1.1.0.win32-py3.3.exe.

File metadata

File hashes

Hashes for oct2py-1.1.0.win32-py3.3.exe
Algorithm Hash digest
SHA256 97a94b86b839c36d65ef54004d5d3c862a5cf62d9b35807a37b7989324014905
MD5 c18100843d55ef1e5b75bac304e6f668
BLAKE2b-256 7e8390ce559c2750e18200bec3694669b8a74767d47ecf036eed2b2557366006

See more details on using hashes here.

File details

Details for the file oct2py-1.1.0.win32-py3.2.exe.

File metadata

File hashes

Hashes for oct2py-1.1.0.win32-py3.2.exe
Algorithm Hash digest
SHA256 def4ca1b70feff6ab291b389a03d353ad47fd40882d5149536377737b09cf379
MD5 3fb5cb59d9759fdfed04a453e9ff60de
BLAKE2b-256 39caed41edb30819291ab6d3c9c05551f591a58793488420a32e4d9d58268ef3

See more details on using hashes here.

File details

Details for the file oct2py-1.1.0.win32-py2.7.exe.

File metadata

File hashes

Hashes for oct2py-1.1.0.win32-py2.7.exe
Algorithm Hash digest
SHA256 a807ef8639d7d69b6f6075deaa1f9c207544f06228de5cedebca1d2bdeb11e64
MD5 05d5f30fb07b7b8bd1406f7e77c665f9
BLAKE2b-256 1787ab22bf4277c8e2da13938ed2256bc6436c70c85be8a6c8cb2476b9a16043

See more details on using hashes here.

File details

Details for the file oct2py-1.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for oct2py-1.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c18b4fb2db3e1563681befafe8aa32f972764ef416d149ba6b02627652129e66
MD5 989b42bc2335dd9baf29c79b0570a220
BLAKE2b-256 e948a600ccc64d5049726956331db4ca2543db5da69b3c82458a45976827189a

See more details on using hashes here.

Supported by

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