Skip to content
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
/ trifolium Public archive

๐Ÿ€ Trefle API Wrapper for Elixir, built for ease of use, with some cool helper methods to easily handle pagination.

License

Notifications You must be signed in to change notification settings

rafaeelaudibert/trifolium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Trifolium ๐Ÿ€

Trifolium Version 1.0.1 Trefle Version 1.6.0

โš ๏ธ Unfortunately, Trefle API is over/down for now.

From their README.md: We didn't got the time or the means to keep the Trefle API online any longer, so after spending months figuring out a solution, we decided to stop there. It has been a great adventure, and we are forever grateful for your support and feedback ๐Ÿ™


Trefle API Wrapper for Elixir, built for ease of use, with some cool helper methods to easily handle pagination. Currently supports Trefle on v1.6.0.

Installation ๐Ÿ’ป

The package can be installed by adding trifolium to your list of dependencies in mix.exs:

def deps do
  [
    {:trifolium, "~> 0.1.0"}
  ]
end

The docs can be found on HexDocs.

Usage โŒจ๏ธ

defmodule YourApp.Trefle
  alias Trifolium.Endpoints.Plants

  def get_plant(id) do
    Plants.find(id)
  end

  def search_umid_plants(query) do
    Plants.search(q: query, filter: %{umidity: "20, 50"})
    # You could use umidity as an array and we would parse it
  end
end

For pagination you can use:

defmodule YourApp.Trefle
  alias Trifolium.Endpoints.Plants

  def get_two_plants_pages(page) do
    page_1 = Plants.all(page: page)
    next_page = Trifolium.Navigation.next(page_1)

    {page_1, next_page}
  end
end

For every available method, please check our documentation on HexDocs.

Disclaimer โš ๏ธ

This library is not affiliated in any way to the original Trefle project, and we do not provide warranty of any kind that it will continue working with the latest Trefle version, as they could introduce breaking changes. For further information, please visit our LICENSE.

Author ๐Ÿง™โ€โ™‚๏ธ

About

๐Ÿ€ Trefle API Wrapper for Elixir, built for ease of use, with some cool helper methods to easily handle pagination.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages