Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install fimport

How to install fimport

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install fimport
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
0.2 Available View build log
0.1 Available View build log
Linux (64-bit)
0.2 Available View build log
0.1 Available View build log
0.2 Failed View build log
 
License
Apache
Dependencies
Imports
Lastest release
version 0.2 on Mar 2nd, 2013

Python import hook for importing Fortran modules.

Usage:

import fimport
fimport.install(reload_support=True)

import somefortrancode # <- builds and imports somefortrancode.f90

But why in the world would you want that? One reason is interactive use, where being able to reload modules is often very convenient.

This code is based on Cython's pyximport module.

Note

Reloading modules doesn't work currently on Python 3. You'll have to do instead

some_module = imp.reload(some_module)

Build customization

A custom numpy.distutils.core.Extension instance and setup() args (Distribution) for for the build can be defined by a <modulename>.fbld file, such as:

import os
from numpy.distutils.core import Extension

def make_ext(modname, ffilename):
    cwd = os.path.dirname(__file__)
    return Extension(name=modname,
                     sources=[ffilename, 'other_file.f90'],
                     f2py_options=['only:', 'some_subroutine', ':'],
                     libraries=['lapack', 'blas'],
                     library_dirs=[cwd],
                     include_dirs=['/myinclude', cwd])

def make_setup_args():
    return dict(script_args=["--fcompiler=gnu"])

Extra dependencies can be listed in a <modulename>.fdep:

other_file.f90
some_include.inc
examplemodule.fbld

Subscribe to package updates

Last updated Mar 2nd, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.