aussieguy0 / sdgen Goto Github PK
View Code? Open in Web Editor NEWA random data generator to produce realistic data files for multiple file types (e.g. csv, log, json)
License: MIT License
A random data generator to produce realistic data files for multiple file types (e.g. csv, log, json)
License: MIT License
I'm trying to create a CSV with SDGen and faker with
<firstname>, <lastname>, <username>
But with the current implementation, I can't reuse the name() generator. firstname and lastname will be different from username.
Is there a solution to this?
This is the current state of a test build of data generation. I just want to output Pipes '|' instead of commas. Ideally, I can pull the data out of local and output it as an argument elsewhere, or at least have the output data be able to be saved an output stream.
Main point: change commas to pipes: how?
`
import com.github.javafaker.Address;
import com.github.javafaker.Faker;
import com.github.javafaker.Lorem;
import com.github.javafaker.Number;
import com.github.javafaker.Options;
import au.com.anthonybruno.Gen;
public class IndividualDataCSV {
public static void main(String[] args) {
Faker faker = Faker.instance();
Number number = faker.number();
Lorem lorem = faker.lorem(); //<String> = words()
Address address = faker.address();
Options options = faker.options();
Demographic demographic = faker.demographic();
Gen.start()
.addField("First Name", () -> faker.name().firstName())
.addField("mid", ()-> lorem.fixedString(1))
.addField("Last Name", () -> faker.name().lastName())
.addField("age", () -> number.numberBetween(18, 98))
.addField("acct_type_ind", () -> demographic.sex().charAt(0))
.generate(1000)
.asCsv()
.toFile("data.txt");
}
}
`
Documentation needs to be added to the Definition classes. They are pretty simple and are described in the Readme.
A field-level annotation that limits the random values generated for the annotated field.
For instance:
public class Address {
@Range(min=0,max=122)
private int streetNumber;
}
Only numbers between 0 and 122 (inclusive(?)) will be generated for streetNumber.
Create a generator for Date
. By default: generate dates from 1 Jan, 1900
to now
. Also have a constructor that would allow the setting of a min date and max date.
Is it possible to add Java 1.6 support (your library works wit java 1.8 only)
I'm seeking a way to generate interconnected data group.The difficult things is that i need to change generator .
I'm learning Unit Testing so that i need a csv file for testing a triangle's type in boundary test(4 types:normal,robust,and in worst-situation).
Currently when using class to generate data, the field names will be derived from the variable names from the class. There should be a way to configure the field names via another attribute in the @Generation
.
public class Person {
@Generation(value=NameGenerator.class, name="Full Name")
String name;
}
Currently, there's no way to specify the order of fields when generating a data file from a class. A way needs to added to explicitly define what position of each variable generated. Example:
public class Person {
@Index(1)
private int age;
@Index(0)
private int name;
}
The age field will come before the name field when it the data is generated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.