{"id":18847728,"url":"https://github.com/jacobwilliams/csv-fortran","last_synced_at":"2026-02-12T05:35:15.960Z","repository":{"id":41951624,"uuid":"80391559","full_name":"jacobwilliams/csv-fortran","owner":"jacobwilliams","description":"Read and Write CSV Files Using Modern Fortran","archived":false,"fork":false,"pushed_at":"2025-05-23T17:45:05.000Z","size":915,"stargazers_count":113,"open_issues_count":11,"forks_count":48,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-04T00:43:34.699Z","etag":null,"topics":["csv","fortran","fortran-package-manager"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobwilliams.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-01-30T03:41:33.000Z","updated_at":"2025-08-15T14:01:21.000Z","dependencies_parsed_at":"2023-01-20T02:05:05.148Z","dependency_job_id":"ec2a3336-7a46-492c-985b-fbef6489aaa7","html_url":"https://github.com/jacobwilliams/csv-fortran","commit_stats":null,"previous_names":["jacobwilliams/csv-fortran","jacobwilliams/fortran-csv-module"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/jacobwilliams/csv-fortran","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fcsv-fortran","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fcsv-fortran/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fcsv-fortran/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fcsv-fortran/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobwilliams","download_url":"https://codeload.github.com/jacobwilliams/csv-fortran/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobwilliams%2Fcsv-fortran/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29359552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"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":["csv","fortran","fortran-package-manager"],"created_at":"2024-11-08T03:09:21.210Z","updated_at":"2026-02-12T05:35:15.944Z","avatar_url":"https://github.com/jacobwilliams.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"![csv-fortran](media/logo.png)\n============\n\n[![Language](https://img.shields.io/badge/-Fortran-734f96?logo=fortran\u0026logoColor=white)](https://github.com/topics/fortran)\n[![GitHub release](https://img.shields.io/github/release/jacobwilliams/csv-fortran.svg)](https://github.com/jacobwilliams/csv-fortran/releases/latest)\n[![Build Status](https://github.com/jacobwilliams/csv-fortran/actions/workflows/CI.yml/badge.svg)](https://github.com/jacobwilliams/csv-fortran/actions)\n[![codecov](https://codecov.io/gh/jacobwilliams/csv-fortran/branch/master/graph/badge.svg?token=43HK33CSMY)](https://codecov.io/gh/jacobwilliams/csv-fortran)\n[![last-commit](https://img.shields.io/github/last-commit/jacobwilliams/csv-fortran)](https://github.com/jacobwilliams/csv-fortran/commits/master)\n\n### Description\n\nA modern Fortran library for reading and writing CSV (comma-separated value) files.\n\n### Latest Release\n\n[![GitHub release](https://img.shields.io/github/release/jacobwilliams/csv-fortran.svg?style=plastic)](https://github.com/jacobwilliams/csv-fortran/releases/latest)\n\n### Documentation\n\nThe latest API documentation for the `master` branch can be found [here](https://jacobwilliams.github.io/csv-fortran/). This was generated from the source code using [FORD](https://github.com/Fortran-FOSS-Programmers/ford).\n\n\n### Getting started\n#### Get the code\n```bash\ngit clone https://github.com/jacobwilliams/csv-fortran\ncd csv-fortran\n```\n#### Dependencies\n1. Git\n2. [fpm](https://github.com/fortran-lang/fpm) or [CMake](https://cmake.org)\n3. [FORD](https://github.com/Fortran-FOSS-Programmers/ford) (optional)\n\n#### Build with [fortran-lang/fpm](https://github.com/fortran-lang/fpm)\nFortran Package Manager (fpm) is a great package manager and build system for Fortran.\nYou can build using provided `fpm.toml`:\n```bash\nfpm build\n```\nTo use `csv-fortran` within your fpm project, add the following to your `fpm.toml` file:\n```toml\n[dependencies]\ncsv-fortran = { git=\"https://github.com/jacobwilliams/csv-fortran.git\" }\n```\n\n### Examples\n\nEverything is handled by an object-oriented `csv_file` class. Here is an example for writing a file:\n\n```fortran\nprogram csv_write_test\n\nuse csv_module\nuse iso_fortran_env, only: wp =\u003e real64\n\nimplicit none\n\ntype(csv_file) :: f\nlogical :: status_ok\n\n! set optional inputs:\ncall f%initialize(verbose = .true.)\n\n! open the file\ncall f%open('test.csv',n_cols=4,status_ok=status_ok)\n\n! add header\ncall f%add(['x','y','z','t'])\ncall f%next_row()\n\n! add some data:\ncall f%add([1.0_wp,2.0_wp,3.0_wp],real_fmt='(F5.3)')\ncall f%add(.true.)\ncall f%next_row()\ncall f%add([4.0_wp,5.0_wp,6.0_wp],real_fmt='(F5.3)')\ncall f%add(.false.)\ncall f%next_row()\n\n! finished\ncall f%close(status_ok)\n\nend program csv_write_test\n```\n\nWhich produces the following file:\n```\nx,y,z,t\n1.000,2.000,3.000,T\n4.000,5.000,6.000,F\n```\n\nReal, integer, logical, or character data can be added as scalars, vectors, and matrices.\n\nWhen reading a CSV file, the data is stored internally in the class as allocatable character strings, which can be retrieved as real, integer, logical or character vectors as necessary. For example, to get the `x`, `y`, `z`, and `t` vectors from the previously-generated file:\n\n```fortran\nprogram csv_read_test\n\nuse csv_module\nuse iso_fortran_env, only: wp =\u003e real64\n\nimplicit none\n\ntype(csv_file) :: f\ncharacter(len=30),dimension(:),allocatable :: header\nreal(wp),dimension(:),allocatable :: x,y,z\nlogical,dimension(:),allocatable :: t\nlogical :: status_ok\ninteger,dimension(:),allocatable :: itypes\n\n! read the file\ncall f%read('test.csv',header_row=1,status_ok=status_ok)\n\n! get the header and type info\ncall f%get_header(header,status_ok)\ncall f%variable_types(itypes,status_ok)\n\n! get some data\ncall f%get(1,x,status_ok)\ncall f%get(2,y,status_ok)\ncall f%get(3,z,status_ok)\ncall f%get(4,t,status_ok)\n\n! destroy the file\ncall f%destroy()\n\nend program csv_read_test\n```\n\nVarious options are user-selectable for specifying the format (e.g., changing the quote or delimiter characters). You can choose to enclose strings (or all fields) in quotes or not. The library works pretty well, and there are probably additional improvements that could be made. For one thing, it doesn't properly handle the case of a string that contains the delimiter character (I'll eventually fix this). If anybody has any other improvements, fork it and send me a pull request.\n\n### License\n\nThis library is released under a [BSD-3 license](https://github.com/jacobwilliams/csv-fortran/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Fcsv-fortran","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobwilliams%2Fcsv-fortran","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobwilliams%2Fcsv-fortran/lists"}