{"id":13400589,"url":"https://github.com/cynkra/dm","last_synced_at":"2025-05-14T13:05:09.676Z","repository":{"id":36960468,"uuid":"194857927","full_name":"cynkra/dm","owner":"cynkra","description":"Working with relational data models in R","archived":false,"fork":false,"pushed_at":"2025-05-03T05:54:56.000Z","size":57768,"stargazers_count":513,"open_issues_count":224,"forks_count":49,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-05-09T18:08:31.154Z","etag":null,"topics":["data-model","data-warehousing","datawarehousing","dbi","dbplyr","r","relational-databases"],"latest_commit_sha":null,"homepage":"https://dm.cynkra.com","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/cynkra.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null}},"created_at":"2019-07-02T12:22:06.000Z","updated_at":"2025-04-15T15:26:25.000Z","dependencies_parsed_at":"2023-10-16T23:34:07.424Z","dependency_job_id":"b1a8d147-6487-4236-82df-75c413dcdc18","html_url":"https://github.com/cynkra/dm","commit_stats":{"total_commits":6733,"total_committers":48,"mean_commits":"140.27083333333334","dds":0.630476756275063,"last_synced_commit":"6e52a837d5c3cf4f3d8daa881786a4a417fdeaa9"},"previous_names":[],"tags_count":289,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Fdm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Fdm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Fdm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cynkra%2Fdm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cynkra","download_url":"https://codeload.github.com/cynkra/dm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149875,"owners_count":22022851,"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":["data-model","data-warehousing","datawarehousing","dbi","dbplyr","r","relational-databases"],"created_at":"2024-07-30T19:00:53.640Z","updated_at":"2025-05-14T13:05:09.549Z","avatar_url":"https://github.com/cynkra.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput:\n  github_document:\n    html_preview: false\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include = FALSE}\nlibrary(tidyverse)\nlibrary(dm)\n\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\nknit_print.grViz \u003c- function(x, ..., options) {\n  svg \u003c- DiagrammeRsvg::export_svg(x)\n  svg \u003c- sub('[\u003c]polygon fill=\"#ffffff\"[^/]+/[\u003e]\\n', \"\", svg)\n  path \u003c- paste0(options$fig.path, options$label, \".svg\")\n  writeLines(svg, path)\n\n  knitr::asis_output(paste0('\u003cimg src=\"', path, '\" /\u003e'))\n}\nvctrs::s3_register(\"knitr::knit_print\", \"grViz\")\n\nclean_output \u003c- function(x, options) {\n  index \u003c- x\n  index \u003c- gsub(\"─\", \"-\", index)\n  index \u003c- strsplit(paste(index, collapse = \"\\n\"), \"\\n---\\n\")[[1]][[2]]\n  writeLines(index, \"index.md\")\n\n  x \u003c- fansi::strip_sgr(x)\n  x\n}\n\noptions(cli.num_colors = 256)\n\nlocal({\n  hook_source \u003c- knitr::knit_hooks$get(\"document\")\n  knitr::knit_hooks$set(document = clean_output)\n})\n\n# For initial rendering, can be removed\nusethis::use_build_ignore(\"index.md\")\n```\n\n# [dm](https://dm.cynkra.com/)\n\n\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html)\n[![R build status](https://github.com/cynkra/dm/workflows/rcc/badge.svg)](https://github.com/cynkra/dm/actions)\n[![Codecov test coverage](https://codecov.io/gh/cynkra/dm/branch/main/graph/badge.svg)](https://app.codecov.io/gh/cynkra/dm?branch=main)\n[![CRAN status](https://www.r-pkg.org/badges/version/dm)](https://CRAN.R-project.org/package=dm)\n[![Launch rstudio.cloud](https://img.shields.io/badge/rstudio-cloud-blue.svg)](https://rstudio.cloud/project/523482)\n\u003c!-- badges: end --\u003e\n\n\u003e Are you using multiple data frames or database tables in R? Organize them with dm.\n\u003e\n\u003e - Use it for data analysis today.\n\u003e - Build data models tomorrow.\n\u003e - Deploy the data models to your organization's Relational Database Management System (RDBMS) the day after.\n\n\n## Overview\n\ndm bridges the gap in the data pipeline between individual data frames and relational databases.\nIt's a grammar of joined tables that provides a consistent set of verbs for consuming, creating, and deploying relational data models.\nFor individual researchers, it broadens the scope of datasets they can work with and how they work with them.\nFor organizations, it enables teams to quickly and efficiently create and share large, complex datasets.\n\ndm objects encapsulate relational data models constructed from local data frames or lazy tables connected to an RDBMS.\ndm objects support the full suite of dplyr data manipulation verbs along with additional methods for constructing and verifying relational data models, including key selection, key creation, and rigorous constraint checking.\nOnce a data model is complete, dm provides methods for deploying it to an RDBMS.\nThis allows it to scale from datasets that fit in memory to databases with billions of rows.\n\n## Features\n\ndm makes it easy to bring an existing relational data model into your R session.\nAs the dm object behaves like a named list of tables it requires little change to incorporate it within existing workflows.\nThe dm interface and behavior is modeled after dplyr, so you may already be familiar with many of its verbs.\ndm also offers:\n\n- visualization to help you understand relationships between entities represented by the tables\n- simpler joins that \"know\" how tables are related, including a \"flatten\" operation that automatically follows keys and performs column name disambiguation\n- consistency and constraint checks to help you understand (and fix) the limitations of your data\n\nThat's just the tip of the iceberg.\nSee [Getting started](https://dm.cynkra.com/articles/dm.html) to hit the ground running and explore all the features.\n\n\n## Installation\n\nThe latest stable version of the {dm} package can be obtained from [CRAN](https://CRAN.R-project.org/package=dm) with the command\n\n```r\ninstall.packages(\"dm\")\n```\n\nThe latest development version of {dm} can be installed from R-universe:\n\n```r\n# Enable repository from cynkra\noptions(\n  repos = c(\n    cynkra = \"https://cynkra.r-universe.dev\",\n    CRAN = \"https://cloud.r-project.org\"\n  )\n)\n# Download and install dm in R\ninstall.packages('dm')\n```\n\nor from GitHub:\n\n```r\n# install.packages(\"devtools\")\ndevtools::install_github(\"cynkra/dm\")\n```\n\n## Usage\n\nCreate a dm object (see [Getting started](https://dm.cynkra.com/articles/dm.html) for details).\n\n```{r}\nlibrary(dm)\ndm \u003c- dm_nycflights13(table_description = TRUE)\ndm\n```\n\ndm is a named list of tables:\n\n```{r}\nnames(dm)\nnrow(dm$airports)\ndm$flights %\u003e%\n  count(origin)\n```\n\nVisualize relationships at any time:\n\n```{r draw, screenshot.force = FALSE}\ndm %\u003e%\n  dm_draw()\n```\n\nSimple joins:\n\n```{r}\ndm %\u003e%\n  dm_flatten_to_tbl(flights)\n```\n\nCheck consistency:\n\n```{r}\ndm %\u003e%\n  dm_examine_constraints()\n```\n\nLearn more in the [Getting started](https://dm.cynkra.com/articles/dm.html) article.\n\n## Getting help\n\nIf you encounter a clear bug, please file an issue with a minimal reproducible example on [GitHub](https://github.com/cynkra/dm/issues).\nFor questions and other discussion, please use [community.rstudio.com](https://forum.posit.co/).\n\n\n---\n\nLicense: MIT © cynkra GmbH.\n\nFunded by:\n\n[![energie360°](man/figures/energie-72.png)](https://www.energie360.ch/de/)\n\u003cspan style=\"padding-right:50px\"\u003e\n\u003c/span\u003e\n[![cynkra](man/figures/cynkra-72.png)](https://www.cynkra.com/)\n\n---\n\nPlease note that the 'dm' project is released with a [Contributor Code of Conduct](https://dm.cynkra.com/CODE_OF_CONDUCT.html).\nBy contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcynkra%2Fdm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcynkra%2Fdm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcynkra%2Fdm/lists"}