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(TM), 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.1 (2013-11-14)

  • Added support for wheels.

  • Fixed: Put docs back in the manifest.

  • Fixed: Oct2py will install when there is no Octave available.

1.1.0 (2013-10-27)

  • 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

Project details


Release history Release notifications | RSS feed

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.1.zip (122.5 kB view details)

Uploaded Source

oct2py-1.1.1.tar.gz (110.2 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.1.win32-py3.3.exe (224.9 kB view details)

Uploaded Source

oct2py-1.1.1.win32-py3.2.exe (224.9 kB view details)

Uploaded Source

oct2py-1.1.1.win32-py2.7.exe (224.9 kB view details)

Uploaded Source

oct2py-1.1.1-py2.py3-none-any.whl (27.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file oct2py-1.1.1.zip.

File metadata

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

File hashes

Hashes for oct2py-1.1.1.zip
Algorithm Hash digest
SHA256 e7d802e032acbf0802eac575637742cf69703068b09c96d95135b1b8befc2e08
MD5 059f55b91c048175008ac82bc00c6479
BLAKE2b-256 7d3980a564117d0ec549073659a77692fcb381c3585c703b4bf02d52b97a31fb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for oct2py-1.1.1.tar.gz
Algorithm Hash digest
SHA256 fcf544778507824aed0f5ed326960bf32da70fbc4cb3dfbfed90557c95504419
MD5 bd3b934977c0b37426379b702a26b00f
BLAKE2b-256 1f661ed64da0e596568fbfb238c31b5be539ad503ab48fd1fdb14d994e035b50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oct2py-1.1.1.win32-py3.3.exe
Algorithm Hash digest
SHA256 00b576236b3df1429a05b4065957aa7a8b1babda3231731e48046cec40ffd2d6
MD5 869da7775018ece539b1e0dfdee26e44
BLAKE2b-256 fe702615746a52345abc86af08d12042ac9f193bde2bd4b44e27963a6ea8f856

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oct2py-1.1.1.win32-py3.2.exe
Algorithm Hash digest
SHA256 6eedddf212d61fd222a92b5bd16ddc2ae703cd2815af650e239b3aca5789f335
MD5 2350fdb0b62b209981e45ee9e9a31a5f
BLAKE2b-256 705f422f9591fad5f7641c9f4c8088ba4cdd2e00c06350bb8f25ca9d7b3ea41a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oct2py-1.1.1.win32-py2.7.exe
Algorithm Hash digest
SHA256 dafbdebd4839d8d1b6e6c325ad647248b1ab515ac61b982c4249c0e35453b732
MD5 a1e73814ab2ec8538a3889abe528e4ca
BLAKE2b-256 85861d16438fcdf3c1c1eff9d7ebfc1bc4ebb188e6d671c573595c8e18376529

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for oct2py-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 191237d42c636d3588dbc54cb7f873fd394c8cd7a6029818cde498a0bf4f4705
MD5 d6e12c77668de51c1efd0f8670f046d5
BLAKE2b-256 7a5b07e7b4df302e9a2bfefd431c5a6a653ecf539574a06185cbbecc87cf056c

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