Questions tagged [faker]

An extension or library used in certain programming languages or frameworks (namely Ruby or Yii2) for generating fake data for debug purposes and testing.

In Ruby, Faker, a port of Data::Faker from Perl, is used to easily generate fake data: names, addresses, phone numbers, etc.

In Yii2, Faker can generate random strings (like name, address, phone number or anything), random numbers, keys or harshes as well as long sentences of fake text. It can be accessed in OOP style.

A PHP library is available for Faker that is used in some frameworks such as Laravel.

703 questions
-1
votes
1 answer

How to generate mobile phone number with Faker

I'm using Laravel 9 and I want to make a faker for my users table: public function definition() { return [ 'usr_first_name' => fake()->name(), 'usr_last_name' => fake()->name(), 'usr_user_name' =>…
japose7523
  • 29
  • 2
  • 15
-1
votes
2 answers

React props not working inside tag, but works outside

This is my index.js React App import React from "react"; import ReactDOM from "react-dom"; import { faker } from '@faker-js/faker'; const App = () => { const avatarx = faker.image.avatar(); return ( avatar
Thowzif
  • 51
  • 9
-1
votes
2 answers

How to use placeholders while inserting data in MySql database using nodejs?

let r={ email:faker.internet.email() } ; connection_var.query("insert into users set ?",r, function(err,res){ if(err) throw err; console.log(res); } ); connection_var.end(); I wrote this code to insert a fake email addr in already existing…
user16393473
-1
votes
2 answers

Array to string conversion error when running laravel 9 faker

In my laravel 9 application, I was trying to create the following faker.
Arctic Fox
  • 59
  • 9
-1
votes
1 answer

Pandas DataFrame: Grouping Rows?

Two challenges here to what I'm trying to accomplish. A DataFrame where the same company is listed for 2 consecutive rows. The first row associated with each company is related to Apple (iOS) and the second is for Android. I need to have the 'App…
B S
  • 45
  • 7
-1
votes
2 answers

Hide duplicate column cells in view

First of all, this here doesn't solve my problem at all. I tried this too. I want generate random unique fake data (first name and address) I used the following SQL request: CREATE OR REPLACE VIEW bah AS SELECT DISTINCT A.VAL AS VORNAME, B.VAL…
Munchkin
  • 857
  • 5
  • 24
  • 51
-1
votes
2 answers

I'm trying to use Faker to generate random images with Laravel

These day my seeders broke because faker is returning false instead of an image path, so i dumped into the vendor folders to understand what is happening. I discovered that the request done to the website used to generate random images…
coderz
  • 72
  • 6
-1
votes
1 answer

populate Django database my code with Faker library, when I was compiling it did not showing any error, but not populate fake data in admin page

This is my first file which is the script for populating the database: ('fake_data.py') when I run python fake_data.py it showing "populating fake_data populating complated!" This file is 'module.py But when I am running server the fake data is…
Manoj Sai
  • 3
  • 2
-1
votes
1 answer

npm faker issue in angular

In angular project I am creating two files to generate fake data. File structure as below https://i.stack.imgur.com/UBSFQ.png Writing generate.js to create data into database.json And creating command in package.json as…
Trupti
  • 1
  • 2
-1
votes
1 answer

syntax error, unexpected '$factory' (T_VARIABLE), expecting function (T_FUNCTI ON) or const (T_CONST)

currently i m using laravel 8.17.* i m trying to to add data using faker library but given error "syntax error, unexpected '$factory' (T_VARIABLE), expecting function (T_FUNCTION) or const (T_CONST)" Help me to solve this…
-1
votes
1 answer

python multiprocessing faker - seeding doesn't work

I use faker in a multiprocessing env. I insert test data to mongo db using the pymongo's bulk method. For each bulk I create fake data. That does work in a single process env but not for multiprocessing. Code logic looks like the following. from…
mandano
  • 31
  • 4
-1
votes
1 answer

How to save faker images to local folder using JavaScript?

I am learning back-end and I want to use the faker library to generate about 1000 jpg files of random user images to my local folder. Script Name: dummyImages.js const faker = require('faker'); const makeFakeImage = function() { return…
hongkongbboy
  • 300
  • 1
  • 5
  • 14
-1
votes
1 answer

How to use Faker to generate titles and real English texts

I have a table called posts in my database and each record represents a post with title, url and body. Is it possible to use Faker to generate titles and bodies in English? The body should be actual English text. I went through the docs and didn't…
Amanda Ferrari
  • 1,168
  • 5
  • 17
  • 30
-1
votes
1 answer

How to catch a wrong input that faker sent, so my automation doesn't crash?

Situation I have a main page that shows a table of persons, and an "add new person" button. When you click on it, a modal window appears with multiple inputs and selects for you to add a new person. The field "name" will validate for special…
Sol P.
  • 41
  • 6
-1
votes
3 answers

how to add double quotes while printing in json? Currently i am getting single quotes

code import json from faker import Faker import random from random import randint fake = Faker('en_US') for _ in range(1): sds = { "id": "AB-asdfaf", "body": fake.sentence(), "time": fake.ean(), "hash": fake.ean(), …
user11124889
1 2 3
46
47