{"id":16572068,"url":"https://github.com/eddelbuettel/rcppquantuccia","last_synced_at":"2025-10-24T20:19:17.814Z","repository":{"id":56934436,"uuid":"86912746","full_name":"eddelbuettel/rcppquantuccia","owner":"eddelbuettel","description":"R Bindings for QuantLib Calendering","archived":false,"fork":false,"pushed_at":"2025-06-08T13:47:22.000Z","size":2445,"stargazers_count":13,"open_issues_count":2,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-12T21:27:30.064Z","etag":null,"topics":["cpp11","cran","quantlib","r-package"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eddelbuettel.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":null,"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-04-01T12:44:53.000Z","updated_at":"2025-06-18T13:16:37.000Z","dependencies_parsed_at":"2024-06-11T17:04:08.909Z","dependency_job_id":"19e61228-3222-4a75-9529-03b2791bc7c5","html_url":"https://github.com/eddelbuettel/rcppquantuccia","commit_stats":{"total_commits":85,"total_committers":1,"mean_commits":85.0,"dds":0.0,"last_synced_commit":"fe89941fda2de20862ceb730b21fdc723656a414"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eddelbuettel/rcppquantuccia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppquantuccia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppquantuccia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppquantuccia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppquantuccia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eddelbuettel","download_url":"https://codeload.github.com/eddelbuettel/rcppquantuccia/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddelbuettel%2Frcppquantuccia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280858918,"owners_count":26403439,"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","status":"online","status_checked_at":"2025-10-24T02:00:06.418Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cpp11","cran","quantlib","r-package"],"created_at":"2024-10-11T21:26:13.171Z","updated_at":"2025-10-24T20:19:17.785Z","avatar_url":"https://github.com/eddelbuettel.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"## RcppQuantuccia: Rcpp bindings for QuantLib Calendering\n\n[![CI](https://github.com/eddelbuettel/rcppquantuccia/workflows/ci/badge.svg)](https://github.com/eddelbuettel/rcppquantuccia/actions?query=workflow%3Aci)\n[![License](https://eddelbuettel.github.io/badges/GPL2+.svg)](http://www.gnu.org/licenses/gpl-2.0.html)\n[![CRAN](https://www.r-pkg.org/badges/version/RcppQuantuccia)](https://cran.r-project.org/package=RcppQuantuccia)\n[![Dependencies](https://tinyverse.netlify.app/badge/RcppQuantuccia)](https://cran.r-project.org/package=RcppQuantuccia)\n[![Downloads](https://cranlogs.r-pkg.org/badges/RcppQuantuccia?color=brightgreen)](https://www.r-pkg.org/pkg/RcppQuantuccia)\n[![Last Commit](https://img.shields.io/github/last-commit/eddelbuettel/rcppquantuccia)](https://github.com/eddelbuettel/rcppquantuccia)\n\n### Status\n\nAccess to current calendaring functions from QuantLib in an easy-to-build smaller package.\n\nAs of release 0.1.0, all code is current to the current QuantLib release 1.24 (modulo a [small patch set](https://github.com/eddelbuettel/rcppquantuccia/blob/master/local/changes_from_quantlib_1.24.diff)). All of\nthe upstream, _i.e._ QuantLib, calendars are implemented as are the key access functions.\n\nHowever, as [Quantuccia](https://github.com/pcaspers/Quantuccia) upstream is stale, we now *continue all future work in the [qlcal](https://github.com/qlcal) organization on GitHub and its [qlcal-r](https://github.com/qlcal/qlcal-r) repo* with the [qlcal R package](https://cran.r-project.org/package=qlcal) now also on CRAN.  So this repository here will likely **not** see any future work.\n\n### Brief History\n\nThis package started as an integration of the (somewhat experimental)\n[Quantuccia](https://github.com/pcaspers/Quantuccia) package (see next section) to R by means of Rcpp.\n\nBut [Quantuccia](https://github.com/pcaspers/Quantuccia) did not continue beyond its initial proof\nof concept. As of release 0.0.5, we have now refocused it on an _even smaller subset_ of\n[QuantLib](https://github.com/lballabio/quantlib): just the calendaring.  So code for pricers, math,\nmodels, schedules, ... that was in [Quantuccia](https://github.com/pcaspers/Quantuccia) has been\nremoved.\n\nBut the calendaring, along with all its support code, is now current with the current\n[QuantLib](https://github.com/lballabio/quantlib) release which, as of this writing, is 1.24.\n\n### So what is Quantuccia?\n\n[Quantuccia](https://github.com/pcaspers/Quantuccia) is the _\"little sister\"_ of\n[QuantLib](https://github.com/lballabio/quantlib): A header-only subset of which aims to provide the\nessential parts of [QuantLib](https://github.com/lballabio/quantlib) while being easier to deploy\nrequiring only [Boost](https://www.boost.org) headers besides itself.  (Note that\n[Quantuccia](https://github.com/pcaspers/Quantuccia) appears to no longer being developed in its\nupstream repo.  However, the idea of only relying on Boost headers is brilliant and carried on here.)\n\nBeing header-only makes providing [Quantuccia](https://github.com/pcaspers/Quantuccia) for\n[R](https://www.r-project.org) a breeze as we can rely on the\n[Rcpp](http://dirk.eddelbuettel.com/code/rcpp.html) and\n[BH](http://dirk.eddelbuettel.com/code/bh.html) packages.  Nothing else is required, and as these\npackages are available on all relevant platforms, deploying RcppQuantuccia is straightforward.\n\n### Example\n\nHere we examine holiday lists for given calendars, specified by country and possibly exchange:\n\n```r\nR\u003e library(RcppQuantuccia)\nR\u003e fromD \u003c- as.Date(\"2017-01-01\")\nR\u003e toD \u003c- as.Date(\"2017-12-31\")\nR\u003e getHolidays(fromD, toD)        # default calender ie TARGET\n[1] \"2017-04-14\" \"2017-04-17\" \"2017-05-01\" \"2017-12-25\" \"2017-12-26\"\nR\u003e setCalendar(\"UnitedStates\")\nR\u003e getHolidays(fromD, toD)        # US aka US::Settlement\n[1] \"2017-01-02\" \"2017-01-16\" \"2017-02-20\" \"2017-05-29\" \"2017-07-04\" \"2017-09-04\"\n[7] \"2017-10-09\" \"2017-11-10\" \"2017-11-23\" \"2017-12-25\"\nR\u003e setCalendar(\"UnitedStates::NYSE\")\nR\u003e getHolidays(fromD, toD)        # US New York Stock Exchange\n[1] \"2017-01-02\" \"2017-01-16\" \"2017-02-20\" \"2017-04-14\" \"2017-05-29\" \"2017-07-04\"\n[7] \"2017-09-04\" \"2017-11-23\" \"2017-12-25\"\nR\u003e\n```\n\nThis shows the difference between the default US settlement calendar and the NYSE calendar\nwhich we selected explicitly.\n\nAs all calendars are now supported (and are listed in a convenience vector `calendars`):\n\n```r\n\u003e library(RcppQuantuccia)\n\u003e calendars\n [1] \"TARGET\"                         \"UnitedStates\"\n [3] \"UnitedStates/LiborImpact\"       \"UnitedStates/NYSE\"\n [5] \"UnitedStates/GovernmentBond\"    \"UnitedStates/NERC\"\n [7] \"UnitedStates/FederalReserve\"    \"Argentina\"\n [9] \"Australia\"                      \"Austria\"\n[11] \"Austria/Exchange\"               \"Bespoke\"\n[13] \"Botswana\"                       \"Brazil\"\n[15] \"Brazil/Exchange\"                \"Canada\"\n[17] \"Canada/TSX\"                     \"Chile\"\n[19] \"China\"                          \"China/IB\"\n[21] \"CzechRepublic\"                  \"Denmark\"\n[23] \"Finland\"                        \"France\"\n[25] \"France/Exchange\"                \"Germany\"\n[27] \"Germany/FrankfurtStockExchange\" \"Germany/Xetra\"\n[29] \"Germany/Eurex\"                  \"Germany/Euwax\"\n[31] \"HongKong\"                       \"Hungary\"\n[33] \"Iceland\"                        \"India\"\n[35] \"Indonesia\"                      \"Israel\"\n[37] \"Italy\"                          \"Italy/Exchange\"\n[39] \"Japan\"                          \"Mexico\"\n[41] \"NewZealand\"                     \"Norway\"\n[43] \"Null\"                           \"Poland\"\n[45] \"Romania\"                        \"Russia\"\n[47] \"SaudiArabia\"                    \"Singapore\"\n[49] \"Slovakia\"                       \"SouthAfrica\"\n[51] \"SouthKorea\"                     \"SouthKorea/KRX\"\n[53] \"Sweden\"                         \"Switzerland\"\n[55] \"Taiwan\"                         \"Thailand\"\n[57] \"Turkey\"                         \"Ukraine\"\n[59] \"UnitedKingdom\"                  \"UnitedKingdom/Exchange\"\n[61] \"UnitedKingdom/Metals\"           \"WeekendsOnly\"\n\u003e\n\n We can then for example quickly count number of holiday per calendar (by computing the length of the returned\nvector of holidays) and show a shortened print, all in a handful of lines continuing from above\n\n```r\n\u003e getHols \u003c- function(cal) {    # simple helper function\n+    setCalendar(cal)\n+    getHolidays(as.Date(\"2022-01-01\"), as.Date(\"2022-12-31\"))\n+ }\n\u003e D \u003c- data.table(calendar=calendars)\n\u003e D[ , `:=`(n = length(getHols(calendar)),\n+           holidays = paste(format(getHols(calendar),\"%d %b\"), collapse=\",\")),\n+    by = calendar ]\n\u003e D\n\u003e D\n                       calendar  n                                                                     holidays\n 1:                      TARGET  3                                                         15 Apr,18 Apr,26 Dec\n 2:                UnitedStates 10        17 Jan,21 Feb,30 May,20 Jun,04 Jul,05 Sep,10 Oct,11 Nov,24 Nov,26 Dec\n 3:    UnitedStates/LiborImpact 10        17 Jan,21 Feb,30 May,20 Jun,04 Jul,05 Sep,10 Oct,11 Nov,24 Nov,26 Dec\n 4:           UnitedStates/NYSE  9               17 Jan,21 Feb,15 Apr,30 May,20 Jun,04 Jul,05 Sep,24 Nov,26 Dec\n 5: UnitedStates/GovernmentBond 11 17 Jan,21 Feb,15 Apr,30 May,20 Jun,04 Jul,05 Sep,10 Oct,11 Nov,24 Nov,26 Dec\n---\n58:                     Ukraine 10        03 Jan,07 Jan,08 Mar,25 Apr,02 May,09 May,13 Jun,28 Jun,24 Aug,14 Oct\n59:               UnitedKingdom  9               03 Jan,15 Apr,18 Apr,02 May,02 Jun,03 Jun,29 Aug,26 Dec,27 Dec\n60:      UnitedKingdom/Exchange  9               03 Jan,15 Apr,18 Apr,02 May,02 Jun,03 Jun,29 Aug,26 Dec,27 Dec\n61:        UnitedKingdom/Metals  9               03 Jan,15 Apr,18 Apr,02 May,02 Jun,03 Jun,29 Aug,26 Dec,27 Dec\n62:                WeekendsOnly  0\n\u003e\n```\n\nHere we set the year to 2022 as it includes the added US holiday of Juneteenth.\n\nWe can also access the calendar 'name' from the underlying (QuantLib Calendar) object:\n\n```r\n\u003e D[, name := { setCalendar(calendar); getName() }, by=calendar][, .(calendar,name)]\n                       calendar                      name\n 1:                      TARGET                    TARGET\n 2:                UnitedStates             US settlement\n 3:    UnitedStates/LiborImpact      US with Libor impact\n 4:           UnitedStates/NYSE   New York stock exchange\n 5: UnitedStates/GovernmentBond US government bond market\n---\n58:                     Ukraine  Ukrainian stock exchange\n59:               UnitedKingdom             UK settlement\n60:      UnitedKingdom/Exchange     London stock exchange\n61:        UnitedKingdom/Metals    London metals exchange\n62:                WeekendsOnly             weekends only\n\u003e\n```\n\n\n### A Smaller Subset\n\nAs of version 0.0.3, we exclude the 7.6 mb header file `sobolrsg.hpp`, and well as references to it\nincluding the model subdirectory using the Sobol-based Brownian Market Models.  This shrinks the\nresulting shared library from around 26 mb (!!) to 0.64 mb, and the (compressed) source tarball from\n1.6 mb to 0.24 mb.\n\nAs of version 0.0.5, the focus is _strictly_ on calendaring.\n\nAs of version 0.1.0, QuantLib files are included 'as is' (no longer converted to header-only as Quantuccia did)\nwith a small ([documented in a diff](https://github.com/eddelbuettel/rcppquantuccia/blob/master/local/changes_from_quantlib_1.24.diff)) set of changes essentially commenting\nout headers we no longer need and removed from some of the utilities directories, and turning off pragma instructions\nwe are not allowed to use at CRAN.\n\n### Installation\n\nThe package can be installed from [CRAN](https://cran.r-project.org) via\n\n```r\ninstall.packages(\"RcppQuantuccia\")\n```\n\nor if you prefer non-release development version these can be installed from GitHub via e.g.\n\n```r\nremotes::install_github(\"eddelbuettel/rcppquantuccia\")\n```\n\nor maybe just checkout the repository locally.\n\nIt only requires `Rcpp` and `BH` both of which are available whereever `R` itself runs.\n\n### Authors\n\nDirk Eddelbuettel for the package and integration\n\nThe authors and contributors of QuantLib for the underlying calendaring code\n\n### License\n\nGPL (\u003e= 2)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddelbuettel%2Frcppquantuccia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddelbuettel%2Frcppquantuccia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddelbuettel%2Frcppquantuccia/lists"}