{"id":32578334,"url":"https://github.com/hugomvale/fortran-in-python","last_synced_at":"2025-10-29T14:56:18.685Z","repository":{"id":172520854,"uuid":"628398508","full_name":"HugoMVale/fortran-in-python","owner":"HugoMVale","description":"Examples of how to build/call Fortran modules in Python","archived":false,"fork":false,"pushed_at":"2023-06-14T21:36:51.000Z","size":38,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-28T21:43:27.307Z","etag":null,"topics":["ctypes","f2py","fortran","interoperability","python"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HugoMVale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-04-15T20:29:48.000Z","updated_at":"2024-01-25T15:22:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed24af3e-47f4-448c-9e55-054ebe8efb8d","html_url":"https://github.com/HugoMVale/fortran-in-python","commit_stats":{"total_commits":29,"total_committers":1,"mean_commits":29.0,"dds":0.0,"last_synced_commit":"da4c5efa39512f67e7d52201b7f308a490c98989"},"previous_names":["hugomvale/fortran-in-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/HugoMVale/fortran-in-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoMVale%2Ffortran-in-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoMVale%2Ffortran-in-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoMVale%2Ffortran-in-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoMVale%2Ffortran-in-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HugoMVale","download_url":"https://codeload.github.com/HugoMVale/fortran-in-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HugoMVale%2Ffortran-in-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281642036,"owners_count":26536358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-29T02:00:06.901Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ctypes","f2py","fortran","interoperability","python"],"created_at":"2025-10-29T14:56:16.363Z","updated_at":"2025-10-29T14:56:18.681Z","avatar_url":"https://github.com/HugoMVale.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Description\n\nA few examples to illustrate the main steps required to build and call Fortran code from Python with the following tools:\n\n| Tool | Pros | Cons |\n| ---  |:---: |:---: |\n| [ctypes](https://docs.python.org/3/library/ctypes.html) | \u003cli\u003eAllows for tailor-made wrappers.\u003c/li\u003e \u003cli\u003eC-API as byproduct.\u003c/li\u003e | \u003cli\u003eC-bindings and Python-bindings must be written for all data types and procedures (besides the manual effort, some aspects are not intuitive at all).\u003c/li\u003e |\n| [f2py](https://numpy.org/doc/stable/f2py/index.html) | \u003cli\u003eLittle/no manual work.\u003c/li\u003e \u003cli\u003eFortran procedures are automatically given a Pythonic signature.\u003c/li\u003e \u003cli\u003eArray dimensions become optional arguments.\u003c/li\u003e | \u003cli\u003eNo support for derived data types, abstract interfaces, etc.\u003c/li\u003e \u003cli\u003eNo possibility for wrapper customization.\u003c/li\u003e |\n| [f90wrap](https://github.com/jameskermode/f90wrap) | \u003cli\u003eSupport for derived data types, abstract interfaces, etc.\u003c/li\u003e \u003cli\u003eCan parse Doxygen (but not FORD) docstrings.\u003c/li\u003e | \u003cli\u003eProcedure signatures remain unchanged (Fortranic, not Pythonic).\u003c/li\u003e \u003cli\u003eProcedures with callbacks are excluded (bug?).\u003c/li\u003e \u003cli\u003eSupport seems limited (just an impression).\u003c/li\u003e |\n| [gfort2py](https://github.com/rjfarmer/gfort2py)| \u003cli\u003eto do!\u003c/li\u003e | \u003cli\u003eto do!\u003c/li\u003e|\n\nA rather comprehensive list of tools to invoke Fortran code from Python can be found [here](https://github.com/Beliavsky/Fortran-Tools#interoperability).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugomvale%2Ffortran-in-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhugomvale%2Ffortran-in-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhugomvale%2Ffortran-in-python/lists"}