GithubHelp home page GithubHelp logo

theunkn0wn1 / themealdb-rs Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 44 KB

Rust bindings to `themealdb`'s json API

License: BSD 3-Clause "New" or "Revised" License

Rust 100.00%
themealdb-api rust-crate rust-library async-await

themealdb-rs's Introduction

mealdb-rs

This rust crate provides a reqwest-based async interface to themealdb.com.

Usage

Currently, this crate only supports the json API v1 endpoints.

To use this crate, instantiate an instance of the API wrapper.

use mealdb::preamble::*;

#[tokio::main]
pub async fn main() {
    println!("hello, world!");

    // Create handle to the API
    let api = mealdb::V1::new("https://www.themealdb.com", "<YOUR API KEY HERE>");
    // ...
    }

this V1 api wrapper exposes the supported methods of themealdb's API.

For example, getting all the meals with a title containing chicken:

    // Searching for meals that contain a keyword
    println!("finding all meals with `chicken` in the name...");
    let meals = api
        .search_meal_by_name("chicken")
        .await
        .expect("query failed.")
        .expect("no results.");
    meals
        .iter()
        .for_each(|meal| println!("meal name :: {:?} meal id :: {}", meal.name, meal.id));

themealdb-rs's People

Contributors

theunkn0wn1 avatar

Watchers

 avatar  avatar

themealdb-rs's Issues

V0.1.0 tracking

There are some outstanding features that need to be implemented prior to a release

Basic endpoints:

  • Search meal by name
  • List all meals by first letter
  • Lookup full meal details by id
  • Lookup a single random meal
  • List all meal categories
  • List all Categories (NOT to be confused with List all meal categories, this endpoint returns something else.)
  • List all areas
  • List all Ingredients
  • Filter by main ingredient
  • Filter by Category
  • Filter by Area
  • #2

CI:

  • #4
  • test suite

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.