Femtorinth is a library to interact with a sub-set of the Modrinth API.

Overview

Femtorinth

license issues stargazers Crates.io Crates.io

forthebadge

Femtorinth is a rust library to interact with a sub-set of the Modrinth api, it only includes the api calls that don't need auth (a.k.a only GET calls), it includes parsing for all the structs that exist in the v1 documentation of Modrinth's api and the structs themselves aswell, plus, helper functions that will return those structs and handle calling the Modrinth api, currently this library is using the ureq crate as it's back-end to call the Modrinth api but that's planned to change in the near future so the library can become backend agnostic (although i have no idea what the use of this library would then be).

Right now Femtorinth is still very much in infancy, it does have good enough error handling, documentation and code but i think there's still room for improvement, have a look at the Roadmap section of this readme if you're interested in contributing!

Basic example

Getting the latest sodium version + a bit of flair

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let results = femtorinth::search_mods("Sodium".into(), None, Some(1))?;
    let modres = results.hits[0].clone();
    println!("Found: {} from {}", &modres.title, &modres.author);
    println!("Description: {}", &modres.description);
    println!(
        "Downloads and follows: {} and {}",
        &modres.downloads, &modres.follows
    );
    println!(
        "Latest supported minecraft version: {}",
        &modres.latest_version
    );
    println!("Licensed under: {}", &modres.license);

    let version_list = femtorinth::version_list(modres.get_clean_id())?;
    let mod_version_data = version_list[0].clone();

    println!("Name of the newest version: {}", &mod_version_data.name);
    println!("Files for download with filenames:");
    for i in mod_version_data.files {
        println!("{}: {}", i.filename, i.url);
    }

    Ok(())
}

For more examples check out the examples/ directory on github

Why "Femtorinth"?

Femtorinth is a name that's made up of two words, Femtometre and Modrinth, Femtometre is an extremely small metric (10^-15, even smaller than pico!) and since this library only covers a subset of Modrinth's v1 API, this name would be perfect!

Roadmap

  • Have somebody more experienced look at the code and give advice on how to improve it
  • Add more examples to the project demonstrating more features
  • Make the documentation and interface easier to both read and use
  • Make the library back-end agnostic so http crates other than ureq can be used

Contributing

Thanks for your interest in contributing! please open an issue or merge request to contribute, and remember to look at the roadmap and see if you can help with the goals on there. Code contributions submitted for inclusion in the work by you, as defined in the MPL2.0 license, shall be licensed as the above without any additional terms or conditions.

License

This project is licenced under the Mozilla Public License 2.0.

You might also like...
API tool,but egui style and rusty
API tool,but egui style and rusty

WEAVER About Weaver is a simple,easy-to-use and cross-platform API tool.Inspired by hoppscotch . It uses the Rust egui GUI library. Features Get,Post

Generic and extensible egui widgets to create analog synthesizer-like UI with data-oriented API
Generic and extensible egui widgets to create analog synthesizer-like UI with data-oriented API

egui_cable A generic and extensible data-oriented widget for connecting ports by cables. I create this for the visual programming editor of Hihaheho/D

String processing with file/line/col information and the regular rust `str` API

Simple span handling for str and &[u8] This crate exposes some of the methods that exist on str or bstr. If you are missing any you need, please open

A Rust wrapper and bindings of Allegro 5 game programming library

RustAllegro A thin Rust wrapper of Allegro 5. Game loop example extern crate allegro; extern crate allegro_font; use allegro::*; use allegro_font::*;

High performance Rust ECS library
High performance Rust ECS library

Legion aims to be a feature rich high performance Entity component system (ECS) library for Rust game projects with minimal boilerplate. Getting Start

Rust library to create a Good Game Easily

ggez What is this? ggez is a Rust library to create a Good Game Easily. The current version is 0.6.0-rc0. This is a RELEASE CANDIDATE version, which m

Rust bindings for libtcod 1.6.3 (the Doryen library/roguelike toolkit)

Warning: Not Maintained This project is no longer actively developed or maintained. Please accept our apologies. Open pull requests may still get merg

A dependency-free chess engine library built to run anywhere.
A dependency-free chess engine library built to run anywhere.

♔chess-engine♚ A dependency-free chess engine library built to run anywhere. Demo | Docs | Contact Me Written in Rust 🦀 💖 Why write a Chess engine?

Scion is a tiny 2D game library built on top of wgpu, winit and legion.
Scion is a tiny 2D game library built on top of wgpu, winit and legion.

Scion is a 2D game library made in rust. Please note that this project is in its first milestones and is subject to change according to convience need

Comments
Owner
Vivian
Vivian
Morphosis is a work-in-progress set of tools to deal with Minecraft metadata, mainly for use with PolyMC.

Morphosis Morphosis is a work-in-progress set of tools to deal with Minecraft metadata, mainly for use with PolyMC. It consists of a library (metamorp

cozyGalvinism 3 May 3, 2022
Solves wordle optimally by means of set subdivision

rust-wordle-solver Solves wordle optimally by means of set subdivision Building and running You should probably use the release build, as the debug bu

Gorgi Kosev 3 Feb 22, 2022
Cross-platform GPU-accelerated viewer for the Mandelbrot set and similar (escape-time) fractals

fractal_viewer A cross-platform, GPU-accelerated viewer for the Mandelbrot Set and related fractals. Try it online! Usage Scroll wheel to zoom, click

null 5 Jan 8, 2023
Explicitly set sprite layers for sprites in Bevy games.

extol_sprite_layer lets you specify the drawing order for sprites in your Bevy game using a separate component rather than via the z-coordinate of you

Ash 5 May 2, 2023
virtualization-rs provides the API of the Apple Virtualization.framework in Rust language.

virtualization-rs Rust bindings for Virtualization.framework virtualization-rs provides the API of the Apple Virtualization.framework in Rust language

suzu 44 Dec 31, 2022
An ergonomic physics API for bevy games.

Heron An ergonomic physics API for 2d and 3d bevy games. (powered by rapier) How it looks like fn main() { App::build() .add_plugins(DefaultPlug

Jonathan Cornaz 313 Dec 16, 2022
A prototype plugin providing a simple line drawing api for bevy.

bevy_debug_lines A prototype plugin providing a simple line drawing api for bevy. See docs.rs for documentation. Expect breakage on master. Click on t

Michael Palmos 92 Dec 31, 2022
An immediate mode 2D drawing API for Bevy game engine

Bevy Canvas API prototype An unofficial immediate mode 2D drawing API for Bevy game engine. Check the documentation or the examples to know how to use

Federico Rinaldi 20 Apr 21, 2022
A wrapper around SDL2's game controller API.

fishsticks System for handling gamepad input, using SDL2's game controller API as the backend. License Fishsticks is dual-licensed under either Apache

null 7 Dec 8, 2022
Self Study on developing a game engine using wgpu as the rendering API. Learning as I go.

Fabled Engine Any issues, enhancement, features, or bugs report are always welcome in Issues. The obj branch is where frequent development and up to d

Khalid 20 Jan 5, 2023