Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/massivefermion/blah
fake data generation for gleam
https://github.com/massivefermion/blah
Last synced: 17 days ago
JSON representation
fake data generation for gleam
- Host: GitHub
- URL: https://github.com/massivefermion/blah
- Owner: massivefermion
- License: apache-2.0
- Created: 2022-10-02T10:18:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-12T17:02:56.000Z (30 days ago)
- Last Synced: 2024-11-12T18:19:01.285Z (30 days ago)
- Language: Gleam
- Homepage: https://hex.pm/packages/blah
- Size: 2.32 MB
- Stars: 15
- Watchers: 3
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-gleam - blah - [📚](https://hexdocs.pm/blah/) - fake data generation for gleam (Packages / Randomness)
README
![blah](https://raw.githubusercontent.com/massivefermion/blah/main/banner.png)
[![Package Version](https://img.shields.io/hexpm/v/blah)](https://hex.pm/packages/blah)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/blah/)# blah
fake data generation for gleam
## 🎲 Installation
```sh
gleam add blah
```## 🎲 Usage
```gleam
import blah/name
import blah/time
import blah/other
import blah/internet
import birl
import birl/duration
import bison/object_idpub type Person {
Person(
id: object_id.ObjectId,
name: String,
username: String,
birthday: birl.Time,
age: Int,
)
}pub fn generate_fake_person() {
let assert Ok(id) = object_id.from_string(other.mongo_object_id())
let name = name.first_name()
let birthday = time.past(duration.years(18), duration.years(32))
let assert #(age, duration.Year) =
duration.blur(birl.difference(birl.now(), birthday))Person(
id: id,
name: name,
username: internet.username(name),
birthday: birthday,
age: age,
)
}
```