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...
Simple fake AWS Cognito User Pool API server for development.

Fakey Cognito 🏡 Homepage Simple fake AWS Cognito API server for development. ✅ Implemented features AdminXxx on User Pools API. Get Started # run wit

High level rust abstractions for the libretro API

libretro-rs Design Philosophy The approach to this crate can best be summarized as wanting to expose all functionality, even if not idiomatically. The

C API to SpringQL (for embedded mode)

SpringQL C Client This repository is a C client for SpringQL and provides it provides: springql.h: C header file. libspringql_client.{so,dylib}: Share

⚡️ Fast MagicString port driven by Rust and N-API

magic-string-rs 100% API compatible (port) MagicString by Rich-Harris implementation for Node and modern browsers, also, for rust, of course. Installa

Stream-based FSEvents API bindings.

fsevent-stream Stream-based FSEvents API bindings. Features Support directory-granular and file-granular events. Retrieve related file inode with kFSE

ncnn Rust API.

rust-ncnn ncnn Rust API. Prequisition Rust Env $ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh CMake = 3.12 Rust cmake needs --paral

weggli-native a "native" C API for Google's weggli

weggli-native a "native" C API for Google's weggli

Manage self-hosted Supabase instances with an easy to use API & Web Portal (soon)

SupaManager A project by Harry Bairstow; Manage self-hosted Supabase instances with an easy to use API & Web Portal (soon) ⚠️ Note: The project is in

Rust crate for creating filters with DirectX shaders. Includes Scale, Color conversion using DirectX api.

DxFilter Scale and ColorConversion done with DirectX filters. You can also create your own filters with the provided api. Crate contains various tools

Comments
Owner
null
A lean, minimal, and stable set of types for color interoperation between crates in Rust.

This library provides a lean, minimal, and stable set of types for color interoperation between crates in Rust. Its goal is to serve the same function that mint provides for (linear algebra) math types.

Gray Olson 16 Sep 21, 2022
Rusty Armor Builds - Monster Hunter Rise Armor Set Creation Tool

RAB Rusty Armor Builds - Monster Hunter Rise Armor Set Creation Tool Armor files used by RAB

null 28 Oct 3, 2022
A set of utilities to better enable polymorphic behavior in Rust

Polymorph A set of utilities to better enable polymorphic behavior in Rust. Introduction Rust is a wonderful language, with a strong emphasis on fast,

null 3 Mar 17, 2022
A set of bison skeleton files that can be used to generate a Bison grammar that is written in Rust.

rust-bison-skeleton A set of bison skeleton files that can be used to generate a Bison grammar that is written in Rust. Technically it's more like a B

Ilya Bylich 12 Dec 14, 2022
Output the individual word-count statistics from a set of files

Output the individual word-count statistics from a set of files, or generate a curated word list

Johnny Tidemand Vestergaard 1 Apr 3, 2022
Stdto provides a set of functional traits for conversion between various data representations.

Stdto stdto provides a set of functional traits for conversion between various data representations. | Examples | Docs | Latest Note | stdto = "0.13.0

Doha Lee 5 Dec 21, 2022
Convert Juniper configurations to 'set-style'

JCC: Juniper Config Converter Convert Juniper configurations. Takes a Juniper configuration as displayed using show configuration and transforms it to

null 4 Sep 1, 2023
Rust library for interacting with the VTube Studio API

vtubestudio-rs A library for interacting with the VTube Studio API. Basic usage This example creates a Client using the provided builder, which: conne

null 6 Dec 4, 2022
This article is about the unsound api which I found in owning_ref. Owning_ref is a library that has 11 million all-time downloads and 60 reverse dependencies.

Unsoundness in owning_ref This article is about the unsound api which I found in owning_ref. Owning_ref is a library that has 11 million all-time down

Noam Ta Shma 20 Aug 3, 2022
A simple omegle API written in Rust

omegalul-rs omegalul-rs is a work-in-progress opensource library for building Omegle clients. Features Current Features Fetching random server from om

NV6 5 Jun 21, 2022