Coder Social home page Coder Social logo

aussieguy0 / sdgen Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 6.0 138 KB

A random data generator to produce realistic data files for multiple file types (e.g. csv, log, json)

License: MIT License

Java 100.00%
csv-generator java log-generator random-generation

sdgen's People

Contributors

aussieguy0 avatar dependabot-preview[bot] avatar dependabot[bot] avatar jo-hunter avatar saikai avatar styler3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sdgen's Issues

Reuse generator for multiple columns

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?

Changing Delimiters of 'CSV' to Pipes " | " using your generator!

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");

}

}
`

Create Range annotation

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 DateGenerator

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.

Java 6 support

Is it possible to add Java 1.6 support (your library works wit java 1.8 only)

If I can change the generator in the filed i already assigned

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).

Configure field name for class based generation

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;

}

Add way to define field order when generating data using class

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.