{"id":13694144,"url":"https://github.com/dmgk/faker","last_synced_at":"2025-04-06T00:10:31.140Z","repository":{"id":21533098,"uuid":"24852390","full_name":"dmgk/faker","owner":"dmgk","description":"A library for generating fake data such as names, addresses, and phone numbers.","archived":false,"fork":false,"pushed_at":"2023-11-17T15:22:55.000Z","size":383,"stargazers_count":343,"open_issues_count":6,"forks_count":36,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-02T10:19:26.058Z","etag":null,"topics":["fake","go","golang","phone-number"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmgk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-10-06T15:47:05.000Z","updated_at":"2025-02-20T03:27:10.000Z","dependencies_parsed_at":"2024-06-18T12:35:19.572Z","dependency_job_id":"a03c1837-34ee-4e39-b169-ab352068f653","html_url":"https://github.com/dmgk/faker","commit_stats":{"total_commits":31,"total_committers":7,"mean_commits":4.428571428571429,"dds":"0.32258064516129037","last_synced_commit":"e267254a8ebed1418db5f157044f19296ea699f0"},"previous_names":["enodata/faker"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmgk%2Ffaker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmgk%2Ffaker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmgk%2Ffaker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmgk%2Ffaker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmgk","download_url":"https://codeload.github.com/dmgk/faker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415973,"owners_count":20935387,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fake","go","golang","phone-number"],"created_at":"2024-08-02T17:01:25.424Z","updated_at":"2025-04-06T00:10:31.120Z","avatar_url":"https://github.com/dmgk.png","language":"Go","funding_links":[],"categories":["开源类库","Open source library"],"sub_categories":["测试","Test"],"readme":"# faker\n\nFaker is a library for generating fake data such as names, addresses, and phone numbers.\n\nIt is a (mostly) API-compatible port of Ruby Faker gem (https://github.com/stympy/faker) to Go.\n\n[![GoDoc](https://godoc.org/syreclabs.com/go/faker?status.svg)](https://godoc.org/syreclabs.com/go/faker)\n![Tests](https://github.com/dmgk/faker/actions/workflows/tests.yml/badge.svg)\n\nTo install\n\n    go get -u syreclabs.com/go/faker\n\n## Usage\n\n### Address\n-------------------\n```go\nfaker.Address().City()                        // =\u003e \"North Dessie\"\nfaker.Address().StreetName()                  // =\u003e \"Buckridge Lakes\"\nfaker.Address().StreetAddress()               // =\u003e \"586 Sylvester Turnpike\"\nfaker.Address().SecondaryAddress()            // =\u003e \"Apt. 411\"\nfaker.Address().BuildingNumber()              // =\u003e \"754\"\nfaker.Address().Postcode()                    // =\u003e \"31340\"\nfaker.Address().PostcodeByState(\"IN\")         // =\u003e \"46511\"\nfaker.Address().ZipCode()                     // ZipCode is an alias for Postcode.\nfaker.Address().ZipCodeByState(\"IN\")          // ZipCodeByState is an alias for PostcodeByState.\nfaker.Address().TimeZone()                    // =\u003e \"Asia/Taipei\"\nfaker.Address().CityPrefix()                  // =\u003e \"East\"\nfaker.Address().CitySuffix()                  // =\u003e \"town\"\nfaker.Address().StreetSuffix()                // =\u003e \"Square\"\nfaker.Address().State()                       // =\u003e \"Maryland\"\nfaker.Address().StateAbbr()                   // =\u003e \"IL\"\nfaker.Address().Country()                     // =\u003e \"Uruguay\"\nfaker.Address().CountryCode()                 // =\u003e \"JP\"\nfaker.Address().Latitude()                    // =\u003e (float32) -38.811367\nfaker.Address().Longitude()                   // =\u003e (float32) 89.2171\nfaker.Address().String()                      // =\u003e \"6071 Heaney Island Suite 553, Ebbaville Texas 37307\"\n```\n\n### App\n-------------------\n```go\nfaker.App().Name()    // =\u003e \"Alphazap\"\nfaker.App().Version() // =\u003e \"2.6.0\"\nfaker.App().Author()  // =\u003e \"Dorian Shields\"\nfaker.App().String()  // =\u003e \"Tempsoft 4.51\"\n```\n\n### Avatar\n-------------------\n```go\nfaker.Avatar().Url(\"jpg\", 100, 200) // =\u003e \"http://robohash.org/NX34rZw7s0VFzgWY.jpg?size=100x200\"\nfaker.Avatar().String()             // =\u003e \"http://robohash.org/XRWjFigoImqdeDuA.png?size=300x300\"\n```\n\n### Bitcoin\n-------------------\n```go\nfaker.Bitcoin().Address() // =\u003e \"1GpEKM5UvD4XDLMirpNLoDnRVrGutogMj2\"\nfaker.Bitcoin().String()  // String is an alias for Address.\n```\n\n### Business\n-------------------\n```go\nfaker.Business().CreditCardNumber()     // =\u003e \"1234-2121-1221-1211\"\nfaker.Business().CreditCardExpiryDate() // =\u003e \"2015-11-11\"\nfaker.Business().CreditCardType()       // =\u003e \"mastercard\"\n```\n\n### Code\n-------------------\n```go\nfaker.Code().Isbn10() // =\u003e \"048931033-8\"\nfaker.Code().Isbn13() // =\u003e \"391668236072-1\"\nfaker.Code().Ean13()  // =\u003e \"7742864258656\"\nfaker.Code().Ean8()   // =\u003e \"03079010\"\nfaker.Code().Rut()    // =\u003e \"14371602-3\"\nfaker.Code().Abn()    // =\u003e \"57914951376\"\n```\n\n### Commerce\n-------------------\n```go\nfaker.Commerce().Color()       // =\u003e \"lime\"\nfaker.Commerce().Department()  // =\u003e \"Electronics, Health \u0026 Baby\"\nfaker.Commerce().ProductName() // =\u003e \"Ergonomic Granite Shoes\"\nfaker.Commerce().Price()       // =\u003e (float32) 97.79\n```\n\n### Company\n-------------------\n```go\nfaker.Company().Name()        // =\u003e \"Aufderhar LLC\"\nfaker.Company().Suffix()      // =\u003e \"Inc\"\nfaker.Company().CatchPhrase() // =\u003e \"Universal logistical artificial intelligence\"\nfaker.Company().Bs()          // =\u003e \"engage distributed applications\"\nfaker.Company().Ein()         // =\u003e \"58-6520513\"\nfaker.Company().DunsNumber()  // =\u003e \"16-708-2968\"\nfaker.Company().Logo()        // =\u003e \"http://www.biz-logo.com/examples/015.gif\"\nfaker.Company().String()      // String is an alias for Name.\n```\n\n### Date\n-------------------\n```go\n// Between returns random time in [from, to] interval, with second resolution.\nfaker.Date().Between(from, to time.Time) time.Time\n\n// Forward returns random time in [time.Now(), time.Now() + duration] interval, with second resolution.\nfaker.Date().Forward(duration time.Duration) time.Time\n\n// Backward returns random time in [time.Now() - duration, time.Now()] interval, with second resolution.\nfaker.Date().Backward(duration time.Duration) time.Time\n\n// Birthday returns random time so that age of the person born at that moment would be between minAge and maxAge years.\nfaker.Date().Birthday(minAge, maxAge int) time.Time\n```\n\n### Finance\n-------------------\n```go\n// CreditCard returns a valid (with valid check digit) card number of one of the given types.\n// If no types are passed, all types in CC_TYPES are used.\nfaker.Finance().CreditCard(faker.CC_VISA) // =\u003e \"4190418835414\"\n```\n\n### Hacker\n-------------------\n```go\nfaker.Hacker().SaySomethingSmart() // =\u003e \"If we connect the bus, we can get to the XML microchip through the digital TCP sensor!\"\nfaker.Hacker().Abbreviation()      // =\u003e \"HTTP\"\nfaker.Hacker().Adjective()         // =\u003e \"cross-platform\"\nfaker.Hacker().Noun()              // =\u003e \"interface\"\nfaker.Hacker().Verb()              // =\u003e \"bypass\"\nfaker.Hacker().IngVerb()           // =\u003e \"parsing\"\nfaker.Hacker().Phrases() []string  // =\u003e []string{\n                                   //        \"If we bypass the program, we can get to the AGP protocol through the optical SDD alarm!\",\n                                   //        \"We need to calculate the back-end XML microchip!\",\n                                   //        \"Try to generate the GB bus, maybe it will hack the neural panel!\",\n                                   //        \"You can't navigate the transmitter without synthesizing the optical SMS bus!\",\n                                   //        \"Use the optical THX application, then you can override the mobile port!\",\n                                   //        \"The CSS monitor is down, quantify the multi-byte bus so we can calculate the XSS bandwidth!\",\n                                   //        \"Connecting the card won't do anything, we need to back up the multi-byte RSS card!\",\n                                   //        \"I'll reboot the primary SMTP feed, that should monitor the XML protocol!`\",\n                                   //    }\n```\n\n### Internet\n-------------------\n```go\nfaker.Internet().Email()                // =\u003e \"maritza@farrell.org\"\nfaker.Internet().FreeEmail()            // =\u003e \"sven_rice@hotmail.com\"\nfaker.Internet().SafeEmail()            // =\u003e \"theron.nikolaus@example.net\"\nfaker.Internet().UserName()             // =\u003e \"micah_pfeffer\"\nfaker.Internet().Password(8, 14)        // =\u003e \"s5CzvVp6Ye\"\nfaker.Internet().DomainName()           // =\u003e \"rolfson.info\"\nfaker.Internet().DomainWord()           // =\u003e \"heller\"\nfaker.Internet().DomainSuffix()         // =\u003e \"net\"\nfaker.Internet().MacAddress()           // =\u003e \"15:a9:83:29:76:26\"\nfaker.Internet().IpV4Address()          // =\u003e \"121.204.82.227\"\nfaker.Internet().IpV6Address()          // =\u003e \"c697:392f:6a0e:bf6d:77e1:714a:10ab:0dbc\"\nfaker.Internet().Url()                  // =\u003e \"http://sporerhamill.net/kyla.schmitt\"\nfaker.Internet().Slug()                 // =\u003e \"officiis-commodi\"\n```\n\n### Lorem\n-------------------\n```go\nfaker.Lorem().Character()    // =\u003e \"c\"\nfaker.Lorem().Characters(17) // =\u003e \"wqFyJIrXYfVP7cL9M\"\nfaker.Lorem().Word()         // =\u003e \"veritatis\"\nfaker.Lorem().Words(3)       // =\u003e []string{\"omnis\", \"libero\", \"neque\"}\nfaker.Lorem().Sentence(3)    // =\u003e \"Necessitatibus sit autem.\"\n\n// Sentences returns a slice of \"num\" sentences, 3 to 11 words each.\nfaker.Lorem().Sentences(num int) []string\n\n// Paragraph returns a random text of \"sentences\" sentences length.\nfaker.Lorem().Paragraph(sentences int)\n\n// Paragraphs returns a slice of \"num\" paragraphs, 3 to 11 sentences each.\nfaker.Lorem().Paragraphs(num int) []string\n\n// String returns a random sentence 3 to 11 words in length.\nfaker.Lorem().String()\n```\n\n### Name\n-------------------\n```go\nfaker.Name().Name()      // =\u003e \"Natasha Hartmann\"\nfaker.Name().FirstName() // =\u003e \"Carolina\"\nfaker.Name().LastName()  // =\u003e \"Kohler\"\nfaker.Name().Prefix()    // =\u003e \"Dr.\"\nfaker.Name().Suffix()    // =\u003e \"Jr.\"\nfaker.Name().Title()     // =\u003e \"Chief Functionality Orchestrator\"\nfaker.Name().String()    // String is an alias for Name.\n```\n\n### Number\n-------------------\n```go\nfaker.Number().Number(5)          // =\u003e \"43202\"\nfaker.Number().NumberInt(3)       // =\u003e 213\nfaker.Number().NumberInt32(5)     // =\u003e 92938\nfaker.Number().NumberInt64(19)    // =\u003e 1689541633257139096\nfaker.Number().Decimal(8, 2)      // =\u003e \"879420.60\"\nfaker.Number().Digit()            // =\u003e \"7\"\nfaker.Number().Hexadecimal(4)     // =\u003e \"e7f3\"\nfaker.Number().Between(-100, 100) // =\u003e \"-47\"\nfaker.Number().Positive(100)      // =\u003e \"3\"\nfaker.Number().Negative(-100)     // =\u003e \"-16\"\n```\n\n### PhoneNumber\n-------------------\n```go\nfaker.PhoneNumber().PhoneNumber()       // =\u003e \"1-599-267-6597 x537\"\nfaker.PhoneNumber().CellPhone()         // =\u003e \"+49-131-0003060\"\nfaker.PhoneNumber().AreaCode()          // =\u003e \"903\"\nfaker.PhoneNumber().ExchangeCode()      // =\u003e \"574\"\nfaker.PhoneNumber().SubscriberNumber(4) // =\u003e \"1512\"\nfaker.PhoneNumber().String()            // String is an alias for PhoneNumber.\n```\n\n### Team\n-------------------\n```go\nfaker.Team().Name()     // =\u003e \"Colorado cats\"\nfaker.Team().Creature() // =\u003e \"cats\"\nfaker.Team().State()    // =\u003e \"Oregon\"\nfaker.Team().String()   // String is an alias for Name.\n```\n\n### Time\n-------------------\n```go\n// Between returns random time in [from, to] interval, with second resolution.\nfaker.Time().Between(from, to time.Time) time.Time\n\n// Forward returns random time in [time.Now(), time.Now() + duration] interval, with second resolution.\nfaker.Time().Forward(duration time.Duration) time.Time\n\n// Backward returns random time in [time.Now() - duration, time.Now()] interval, with second resolution.\nfaker.Time().Backward(duration time.Duration) time.Time\n\n// Birthday returns random time so that age of the person born at that moment would be between minAge and maxAge years.\nfaker.Time().Birthday(minAge, maxAge int) time.Time\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmgk%2Ffaker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmgk%2Ffaker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmgk%2Ffaker/lists"}