kitsune alternatives and similar packages
Based on the "Text and Numbers" category.
Alternatively, view kitsune alternatives based on common mentions on social networks and blogs.
-
money
Elixir library for working with Money safer, easier, and fun... Is an interpretation of the Fowler's Money pattern in fun.prog. -
nanoid
Elixir port of NanoID, a secure and URL-friendly unique ID generator. https://hex.pm/packages/nanoid -
secure_random
Convenience library for random base64 strings modeled after my love for Ruby's SecureRandom -
chinese_translation
An elixir module to translate simplified Chinese to traditional Chinese, and vice versa, based on wikipedia data -
abacus
Parses and evaluates mathematical expressions in Elixir. Inspired by math.js -
veritaserum
Sentiment analysis based on afinn-165, emojis and some enhancements. -
inet_cidr
CIDR library for Elixir that is compatible with Erlang's :inet and supports both IPv4 and IPv6 -
haikunator
Generate Heroku-like memorable random names to use in your apps or anywhere else. -
Ex_Cldr_Units
Unit formatting (volume, area, length, ...) functions for the Common Locale Data Repository (CLDR) -
mt940
MT940 (standard structured SWIFT Customer Statement message) parser for Elixir. -
convertat
An Elixir library for converting from and to arbitrary bases.
Static code analysis for 29 languages.
Do you think we are missing an alternative of kitsune or a related project?
Popular Comparisons
README
Kitsune
A kitsune is a shapeshifter, and usually when it reaches the age of 100 years, it learn the ability to take on a human form. Thus, they have to be a fox for a hundred years before it can shapeshift from a fox to a human and back again. It is also said that a kitsune can duplicate other human beings, in other words shapeshift into the look-a-likes of different people.
-- http://www.mythicalcreaturesguide.com/page/Kitsune
Kitsune is an Elixir library for transforming the representation of data inspired by Representable.
Examples
Properties
defmodule Person do
defstruct name: nil, age: nil
end
defmodule PersonRepresenter do
use Kitsune.JSON
property :name
property :age
end
person = %Person{name: "Nikki", age: 18}
PersonRepresenter.to_json(person)
#=> "{\"name\":\"Nikki\",\"age\":18}"
json = "{\"name\":\"Nikki\",\"age\":18}"
PersonRepresenter.from_json(json, Person)
#=> %Person{ name: "Nikki", age: 18 }
If your property doesn't match the name of the key in the Struct, use as
.
defmodule Song do
defstruct name: nil
end
defmodule SongRepresenter do
use Kitsune.JSON
property :title, as: :name
end
song = %Song{name: "Gin and Juice"}
SongRepresenter.to_json(song)
#=> "{\"title\":\"Gin and Juice\"}"
json = "{\"title\":\"Gin and Juice\"}"
SongRepresenter.from_json(json, Song)
#=> %Song{name: "Gin and Juice"}
Collections
You can use collections to create collections of representations inside representations.
defmodule Album do
defstruct name: nil, songs: []
end
defmodule AlbumRepresenter do
use Kitsune.JSON
property :name
collection :songs, extend: SongRepresenter, from: Song
end
album = %Album{name: "Doggystyle", songs: [song, %Song{name: "Lodi Dodi"}]}
AlbumRepresenter.to_json(album)
#=> "{\"name\":\"Doggystyle\",\"songs\":[{\"title\":\"Gin and Juice\"},{\"title\":\"Lodi Dodi\"}]}"
json = "{\"name\":\"Doggystyle\",\"songs\":[{\"title\":\"Gin and Juice\"},{\"title\":\"Lodi Dodi\"}]}"
AlbumRepresenter.from_json(json, Album)
#=> %Album{name: "Doggystyle", songs: [%Song{name: "Gin and Juice"}, %Song{name: "Lodi Dodi"}]}