{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "f2py:index",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "The purpose of the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "F2PY"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " --"
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Fortran to Python interface generator"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "-- utility is to provide a connection between Python and Fortran. F2PY distributed as part of "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "NumPy"
                }
              ],
              "url": "https://www.numpy.org/",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " ("
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "numpy.f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ") and once installed is also available as a standalone command line tool. Originally created by Pearu Peterson, and older changelogs are in the "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "historical reference"
                }
              ],
              "url": "https://web.archive.org/web/20140822061353/http://cens.ioc.ee/projects/f2py2e",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "F2PY facilitates creating/building native "
            },
            {
              "__type": "Link",
              "__tag": 4049,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Python C/API extension modules"
                }
              ],
              "url": "https://docs.python.org/3/extending/extending.html#extending-python-with-c-or-c",
              "title": ""
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " that make it possible"
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "to call Fortran 77/90/95 external subroutines and Fortran 90/95   module subroutines as well as C functions;"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "to access Fortran 77 "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "COMMON"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " blocks and Fortran 90/95 module data,   including allocatable arrays"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "from Python."
            }
          ]
        },
        {
          "__type": "Admonition",
          "__tag": 4056,
          "kind": "note",
          "base_type": "note",
          "children": [
            {
              "__type": "AdmonitionTitle",
              "__tag": 4055,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "note "
                }
              ]
            },
            {
              "__type": "Paragraph",
              "__tag": 4045,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "Fortran 77 is essentially feature complete, and an increasing amount of Modern Fortran is supported within F2PY. Most "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "iso_c_binding"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": " interfaces can be compiled to native extension modules automatically with "
                },
                {
                  "__type": "InlineCode",
                  "__tag": 4051,
                  "value": "f2py"
                },
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": ". Bug reports welcome!"
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "F2PY can be used either as a command line tool "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " or as a Python module "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "numpy.f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". While we try to provide the command line tool as part of the numpy setup, some platforms like Windows make it difficult to reliably put the executables on the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "PATH"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ". If the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " command is not available in your system, you may have to run it as a module     "
            }
          ]
        },
        {
          "__type": "Code",
          "__tag": 4050,
          "value": "python -m numpy.f2py",
          "execution_status": null
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "Using the "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "python -m"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " invocation is also good practice if you have multiple Python installs with NumPy in your system (outside of virtual environments) and you want to ensure you pick up a particular version of Python/F2PY."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "If you run "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " with no arguments, and the line "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "numpy Version"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " at the end matches the NumPy version printed from "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "python -m numpy.f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", then you can use the shorter version. If not, or if you cannot run "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", you should replace all calls to "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "f2py"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " mentioned in this guide with the longer version."
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "For Meson build examples, see "
            },
            {
              "__type": "CrossRef",
              "__tag": 4002,
              "value": "usage",
              "reference": {
                "__type": "LocalRef",
                "__tag": 4022,
                "kind": "docs",
                "path": "usage"
              },
              "kind": "docs"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "F2PY user guide",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:f2py-user"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "F2PY reference manual",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:f2py-reference"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "F2PY and Windows",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:windows:index"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "CrossRef",
                      "__tag": 4002,
                      "value": "1 Migrating to meson",
                      "reference": {
                        "__type": "LocalRef",
                        "__tag": 4022,
                        "kind": "docs",
                        "path": "f2py:buildtools:distutils-to-meson"
                      },
                      "kind": "exists"
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "Python"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "NumPy"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "historical reference"
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "Python C/API extension modules"
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "F2PY user guide and reference manual"
        }
      ],
      "level": 0,
      "target": "f2py"
    }
  ],
  "local_refs": []
}