{"id":13636520,"url":"https://github.com/simonrw/rust-fitsio","last_synced_at":"2025-08-20T09:30:40.251Z","repository":{"id":40625780,"uuid":"59253345","full_name":"simonrw/rust-fitsio","owner":"simonrw","description":"FFI wrapper around cfitsio in Rust","archived":false,"fork":false,"pushed_at":"2024-04-12T20:16:28.000Z","size":9591,"stargazers_count":34,"open_issues_count":29,"forks_count":10,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-14T06:47:10.960Z","etag":null,"topics":["astronomy","cfitsio","ffi-wrapper","rust"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonrw.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2016-05-20T00:50:11.000Z","updated_at":"2024-04-17T21:33:45.541Z","dependencies_parsed_at":"2023-11-18T09:24:56.464Z","dependency_job_id":"288ac683-aeec-47c6-9a9b-36386477af59","html_url":"https://github.com/simonrw/rust-fitsio","commit_stats":{"total_commits":920,"total_committers":10,"mean_commits":92.0,"dds":0.03260869565217395,"last_synced_commit":"4ac21d70f79d22300105342629a92093ff9b5904"},"previous_names":["mindriot101/rust-fitsio"],"tags_count":57,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonrw%2Frust-fitsio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonrw%2Frust-fitsio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonrw%2Frust-fitsio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonrw%2Frust-fitsio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonrw","download_url":"https://codeload.github.com/simonrw/rust-fitsio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230408171,"owners_count":18220974,"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","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":["astronomy","cfitsio","ffi-wrapper","rust"],"created_at":"2024-08-02T00:01:02.241Z","updated_at":"2025-08-20T09:30:40.239Z","avatar_url":"https://github.com/simonrw.png","language":"C","funding_links":[],"categories":["Libraries"],"sub_categories":["Astronomy"],"readme":"# rust-fitsio\n\nFFI wrapper around cfitsio in Rust\n\n[![Join the chat at https://gitter.im/simonrw/rust-fitsio](https://badges.gitter.im/simonrw/rust-fitsio.svg)](https://gitter.im/rust-fitsio/Lobby?utm_source=share-link\u0026utm_medium=link\u0026utm_campaign=share-link)\n[![Build Status](https://travis-ci.org/simonrw/rust-fitsio.svg?branch=master)](https://travis-ci.org/simonrw/rust-fitsio)\n[![Coverage Status](https://coveralls.io/repos/github/simonrw/rust-fitsio/badge.svg?branch=main)](https://coveralls.io/github/simonrw/rust-fitsio?branch=main)\n\n## Platform support\n\n| Platform      | Support level |\n| ------------- | ------------- |\n| Linux arm     | Tier 1        |\n| Linux x86_64  | Tier 1        |\n| macos x86_64  | Tier 1        |\n| Linux arm64   | Tier 2        |\n| Linux i386    | Tier 2        |\n| macos arm64   | Tier 2        |\n| Windows msys2 | Tier 3        |\n| Windows msvc  | -             |\n\nWhere the tiers refer to:\n\n- Tier 1: guaranteed to work, tested in CI\n- Tier 2: should work but not tested by CI\n- Tier 3: may work, and not tested by CI\n\n## MSRV\n\nThe minimal version of rust we support is 1.58.0.\n\n## Installation\n\n`fitsio` supports versions of `cfitsio \u003e= 3.37`.\n\n`cfitsio` must be compiled with `reentrant` support (making it\nthread-safe) if it is to be compiled with the `--enable-reentrant` flag\npassed to `configure`. This affects developers of this library as the\ntests by default are run in parallel.\n\nFor example on a mac with homebrew, install `cfitsio` with:\n\n```sh\nbrew install cfitsio --with-reentrant\n```\n\nAlternatively, it is possible to automatically have `cargo` automatically\ncompile `cfitsio` from source. To do this, you are required to have a C\ncompiler, autotools (to run the `configure` script) and make (to run the\n`Makefile`). This functionality is made available with the `fitsio-src` feature:\n\n```sh\ncargo build --features fitsio-src\n```\n\nFor the time being, it's best to stick to the development version from\ngithub. The code is tested before being pushed and is relatively\nstable. Add this to your `Cargo.toml` file:\n\n```toml,no_sync\n[dependencies]\nfitsio = { git = \"https://github.com/simonrw/rust-fitsio\" }\n```\n\nIf you want the latest release from `crates.io` then add the following:\n\n```toml\n[dependencies]\nfitsio = \"*\"\n```\n\nOr pin a specific version:\n\n```toml\n[dependencies]\nfitsio = \"0.21.7\"\n```\n\nThis repository contains `fitsio-sys-bindgen` which generates the C\nwrapper using `bindgen` at build time. This requires clang to build, and\nas this is likely to not be available in general, I do not recommend\nusing it. It is contained here but is not actively developed, and\nuntested. Use at your own peril. To opt in to building with `bindgen`,\ncompile as:\n\n```sh\ncargo build --no-default-features --features bindgen\n```\n\nor use from your `Cargo.toml` as such:\n\n```toml\n[dependencies]\nfitsio = \"0.21.7\"\n```\n\n## Documentation\n\n`fitsio` [![`fitsio` documentation](https://docs.rs/fitsio/badge.svg)](https://docs.rs/fitsio/)\u003cbr /\u003e\n`fitsio-sys` [![`fitsio-sys` documentation](https://docs.rs/fitsio-sys/badge.svg)](https://docs.rs/fitsio-sys)\u003cbr /\u003e\n`fitsio-sys-bindgen` [![`fitsio-sys-bindgen` documentation](https://docs.rs/fitsio-sys-bindgen/badge.svg)](https://docs.rs/fitsio-sys-bindgen)\u003cbr /\u003e\n\n## Feature support\n\nSupported features of the underlying `cfitsio` library that _are_ available in `fitsio` are detailed in [this tracking issue](https://github.com/simonrw/rust-fitsio/issues/15). If a particular function is not implemented in `fitsio`, then the underlying `fitsfile` pointer can be accessed through an unsafe API.\n\n## Examples\n\nOpen a fits file\n\n```rust\nlet f = fitsio::FitsFile::open(\"test.fits\");\n```\n\nAccessing the underlying `fitsfile` object\n\n```rust\nfn main() {\n    let filename = \"../testdata/full_example.fits\";\n    let fptr = fitsio::FitsFile::open(filename).unwrap();\n\n    /* Find out the number of HDUs in the file */\n    let mut num_hdus = 0;\n    let mut status = 0;\n\n    unsafe {\n        let fitsfile = fptr.as_raw();\n\n        /* Use the unsafe fitsio-sys low level library to call a function that is possibly not\n       implemented in this crate */\n        fitsio_sys::ffthdu(fitsfile, \u0026mut num_hdus, \u0026mut status);\n    }\n    assert_eq!(num_hdus, 2);\n}\n```\n\n## Development\n\nSee [./CONTRIBUTING.md](./CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonrw%2Frust-fitsio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonrw%2Frust-fitsio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonrw%2Frust-fitsio/lists"}