Skip to content

Palleas/Faker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Faker

This is my very first attempt at writing something that would generate fake data like firstname, lastname, email, internet domain name... It's far from finished BUT since I'm starting to dig the whole experimenting in the open thing... here we go.

It's heavily inspired by the awesome fzaninotto/Faker, I shamelessly borrowed his firstnames and lastnames for now.

Example

let g = Generator.generator()

for _ in 0..<5 {
  print(g["firstname"])
  print(g["lastname"])
  print(g["email"])
  print(g["domain"])
}
Jordan
Cox
Duncan.Owen@yahoo.com
yahoo.com

Joe
Cook
Jonathan.Hunter@supercorp.ca
gmail.com

Christian
Lewis
Thomas.Bell@yahoo.org
gmail.org

Aiden
Mitchell
Stefan.Hill@supercorp.org
supercorp.com

Harvey
Chapman
Jim.Ellis@supercorp.ca
gmail.org

Issues / Concern / Todo

  • Is the API nice enough? I like the subscript approach but subscript in Swift 2.0 can't throw so...
  • Right now the Email provider depends on the domain, the firstname and the lastname one but it's not obvious and I think there should be some kind of explicit dependency.
  • Generating things other than String, I've heard a group of Generics feeling lonely, 😢ing in a corner.

Feedback / Comments ?

I'm Palleas on twitter (and pretty much everywhere else), you can also open an issue.

🍭

About

Generating fake data with Swift

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published