{"id":16411756,"url":"https://github.com/ijlyttle/srlze","last_synced_at":"2025-07-16T07:39:04.215Z","repository":{"id":150080252,"uuid":"78284270","full_name":"ijlyttle/srlze","owner":"ijlyttle","description":"Serialize Lists into Text-Lists","archived":false,"fork":false,"pushed_at":"2017-01-14T12:51:31.000Z","size":109,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T13:40:04.933Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://ijlyttle.github.io/srlze/","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/ijlyttle.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2017-01-07T14:42:42.000Z","updated_at":"2017-01-14T12:51:08.000Z","dependencies_parsed_at":"2023-06-05T02:30:27.589Z","dependency_job_id":null,"html_url":"https://github.com/ijlyttle/srlze","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ijlyttle/srlze","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Fsrlze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Fsrlze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Fsrlze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Fsrlze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ijlyttle","download_url":"https://codeload.github.com/ijlyttle/srlze/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ijlyttle%2Fsrlze/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265492762,"owners_count":23776111,"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":[],"created_at":"2024-10-11T06:46:29.422Z","updated_at":"2025-07-16T07:39:04.207Z","avatar_url":"https://github.com/ijlyttle.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, echo = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/srlze)](https://cran.r-project.org/package=srlze)\n[![Travis-CI Build Status](https://travis-ci.org/ijlyttle/srlze.svg?branch=master)](https://travis-ci.org/ijlyttle/srlze)\n[![Coverage Status](https://img.shields.io/codecov/c/github/ijlyttle/srlze/master.svg)](https://codecov.io/github/ijlyttle/srlze?branch=master)\n\n# srlze\n\nSerialzing lists into text-lists can make it easier to work with web-service APIs. This package can help you work with http-query lists in the \"R world\", helping you serialize it for use in the \"remote world\". In many cases, parameters for http queries are formatted differently from R: \n\n  - logicals are expressed as `\"true\"` or `\"false\"` \n  - time durations are specified in ms (R uses difftime, or **lubridate** durations or periods)\n  - vectors are expressed using delimited strings (often delimited by commas)\n  \nThe goal of this package is to make that translation process easier.\n\n## Installation\n\nYou can install **srlze** from github with:\n\n```{r gh-installation, eval = FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"ijlyttle/srlze\")\n```\n\n## Example\n\n```{r}\nlibrary(\"httr\")\nlibrary(\"lubridate\")\nlibrary(\"srlze\")\n```\n\nLet's consider a web-serice endpoint that accepts query-parameters in the format described above. You wish to work with the query-parameters in an R-sensible way. The function `serialize_list()` is used to serialize the elements of your list into the format expected by the web-service.\n\n```{r example, message=FALSE}\nquery_params \u003c- list(\n  delay = dseconds(3),\n  print = TRUE,\n  next_steps = c(\"collate\", \"send\"),\n  number = 20\n)\n\nserialize_list(query_params)\n```\n\nThus, you can use the **httr** package to build your URL, attaching the query.\n\n```{r httr}\nurl \u003c- parse_url(\"https://useful.site.com/service\")\nurl$query \u003c- serialize_list(query_params)\n\nbuild_url(url)\n```\n\nIf you need to change the default behavior of the serializer, the `serialize_list()` function lets you set the delimiter. It also lets you set the `locale()`, which is used to specify the format for individual types (like logical and time-difference). \n\nThere are other situations where list-serialization may be useful. For example if you are writing HTML elements for use with JavaScript, you will often have to set parameters like `data-foo = \"true\"`. You can use `serialize_list()` to help you think in the R world, then write to the HTML/JavaScript world.\n\n## Code of Conduct\n\nPlease note that this project is released with a [Contributor Code of Conduct](CONDUCT.md). By participating in this project you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijlyttle%2Fsrlze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fijlyttle%2Fsrlze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fijlyttle%2Fsrlze/lists"}