Popularity
1.5
Stable
Activity
0.0
Stable
7
2
1
Monthly Downloads: 22
Programming language: Elixir
License: MIT License
Tags:
Third Party APIs
random_user alternatives and similar packages
Based on the "Third Party APIs" category.
Alternatively, view random_user alternatives based on common mentions on social networks and blogs.
-
ethereumex
Elixir JSON-RPC client for the Ethereum blockchain 0x063D3d782598744AF1252eBEaf3aA97D990Edf72 -
MongoosePush
MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS. -
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
Promo
coderabbit.ai
Do you think we are missing an alternative of random_user or a related project?
README
RandomUser
Features
- [x] Return one random user
- [x] Return multiple random users
- [x] Seeds (always returns Becky Sims)
- [x] Choose gender, nationality and other options
- [x] Format results
Installation
This package is available in Hex and can be installed as follows:
Add
random_user
to your list of dependencies inmix.exs
:def deps do [{:random_user, "~> 0.3.3"}] end
Ensure
random_user
is started before your application:def application do [applications: [:random_user]] end
Usage
One Random User
# Returns one random user
RandomUser.Random.one
# Returns a random female user
RandomUser.Random.one(%{ gender: "female" })
# Returns a random British female user
RandomUser.Random.one(%{ gender: "female", nat: "gb" })
Multiple Random Users
# Returns 50 users
RandomUser.Random.multiple(50)
# Returns 50 female users
RandomUser.Random.multiple(50, %{ gender: "female" })
# Returns 50 female users from AU and NZ
RandomUser.Random.multiple(50, %{ gender: "female", nat: "au,nz" })
Get results easily with Parser
For one random user:
res = RandomUser.Random.one |> RandomUser.Parser.results |> RandomUser.Parser.parse
res.gender
res.picture["large"]
For multiple random users:
users = RandomUser.Random.multiple(2) |> RandomUser.Parser.results
Enum.map(users, fn u ->
user = RandomUser.Parser.parse(u)
large_pic = user.picture["large"]
end)