{"id":16273183,"url":"https://github.com/jakubnowicki/fixtures","last_synced_at":"2025-03-19T23:31:27.028Z","repository":{"id":43843411,"uuid":"286135417","full_name":"jakubnowicki/fixtuRes","owner":"jakubnowicki","description":"Generate mock data from yaml configuration.","archived":false,"fork":false,"pushed_at":"2023-01-26T14:36:50.000Z","size":548,"stargazers_count":16,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-02-28T21:49:28.780Z","etag":null,"topics":["fixtures","mock-data","mock-data-generator","r","test-data-generator","yaml-configuration"],"latest_commit_sha":null,"homepage":"https://jakubnowicki.github.io/fixtuRes/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakubnowicki.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}},"created_at":"2020-08-08T23:35:51.000Z","updated_at":"2024-07-09T17:34:26.000Z","dependencies_parsed_at":"2023-02-14T18:16:11.948Z","dependency_job_id":null,"html_url":"https://github.com/jakubnowicki/fixtuRes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubnowicki%2FfixtuRes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubnowicki%2FfixtuRes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubnowicki%2FfixtuRes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubnowicki%2FfixtuRes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakubnowicki","download_url":"https://codeload.github.com/jakubnowicki/fixtuRes/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244031029,"owners_count":20386534,"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":["fixtures","mock-data","mock-data-generator","r","test-data-generator","yaml-configuration"],"created_at":"2024-10-10T18:23:01.166Z","updated_at":"2025-03-19T23:31:26.659Z","avatar_url":"https://github.com/jakubnowicki.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fixtuRes\n\n\u003c!-- badges: start --\u003e\n![R-CMD-check](https://github.com/jakubnowicki/fixtuRes/workflows/R-CMD-check/badge.svg)\n[![version](https://www.r-pkg.org/badges/version/fixtuRes)](https://CRAN.R-project.org/package=fixtuRes)\n[![cranlogs](https://cranlogs.r-pkg.org/badges/fixtuRes)](https://CRAN.R-project.org/package=fixtuRes)\n[![total](https://cranlogs.r-pkg.org/badges/grand-total/fixtuRes)](https://CRAN.R-project.org/package=fixtuRes)\n\n\u003c!-- badges: end --\u003e\n\nGenerate mock data in R using YAML configuration.\n\n## Installation\n\nYou can install a stable release from CRAN repository:\n\n```r\ninstall.packages(\"fixtuRes\")\n```\n\nYou can install the latest version with `remotes`:\n\n```r\nremotes::install_github(\"jakubnowicki/fixtuRes@develop\")\n```\n\n## Usage\n\n`fixtuRes` package provides a set of tools that allow generating random mock data for testing or to use during development. Main one, R6 class named `MockDataGenerator` is a data generator fed with a configuration\nprovided in a `yaml` file. You can also use lower level functions designed to generate data frames, vectors or single values.\n\n### MockDataGenerator\n\nLet's say, that you need a data frame with 5 columns. First one should be called \"id\" and contain a random integer from 100 to 999. Second, \"code\",\nshould be a string of three capital letters. Third one, \"metric\", is a\nrandom numeric value in -10, 10 range. Fourth, called \"type\", can be\none of \"TEST\", \"PROD\", \"QUA\". Finally, the fifth one is a boolean called\n\"pass\". It should be set to TRUE if metric is above 3, otherwise it should\nbe set to FALSE. To create a data frame that follows those rules you will\nneed a configuration (you can find prepared file [here](https://github.com/jakubnowicki/fixtuRes/blob/master/examples/basic_example.yaml)):\n\n```yaml\nmy_data_frame:\n  columns:\n    id:\n      type: integer\n      min: 100\n      max: 999\n      unique: TRUE\n    code:\n      type: string\n      pattern: \"[A-Z]\"\n      length: 3\n    metric:\n      type: numeric\n      min: -10\n      max: 10\n    type:\n      type: set\n      set: [\"TEST\", \"PROD\", \"QUA\"]\n    pass:\n      type: calculated\n      formula: \"metric \u003e 3\"\n```\n\nNow you can pass this configuration to a new `MockDataGenerator` object:\n\n```r\nmy_mock_generator \u003c- fixtuRes::MockDataGenerator$new(\"path-to-my-configuration.yml\")\n```\n\nAnd just create a data frame you have just designed:\n\n```r\nmy_mock_generator$get_data(\"my_data_frame\")\n```\n\n\u003cimg src=\"man/figures/mock_data.png\" /\u003e\n\nFor a detailed description of configuration check [this document](https://jakubnowicki.github.io/fixtuRes/articles/configuration.html).\n\nLow level functions are described in R package documentation.\n\n## Showcase\n\nYou can check `fixtuRes` in action in [Fake Data Generator](https://jakubnowicki.shinyapps.io/fake-data-generator/).\nIt enables live preview of your YAML configuration, downloading YAML itself\nand generated dataset.\n\n\u003cimg src=\"man/figures/Fake_Data_Generator.png\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubnowicki%2Ffixtures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakubnowicki%2Ffixtures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubnowicki%2Ffixtures/lists"}