From 4c84afd991d0eaef57c21037a9c3d02409367b42 Mon Sep 17 00:00:00 2001 From: yh202109 Date: Tue, 30 Jul 2024 19:41:55 -0400 Subject: [PATCH] v0.2.22 --- docs/index.md | 4 ++++ docs/statlab_corr_spearman_rho.rst | 17 +++++++++++++++++ docs/statlab_corr_tau.rst | 17 +++++++++++++++++ docs/statlab_kappa.rst | 18 ++++++++++++++++++ docs/statlab_kappa2.rst | 17 +++++++++++++++++ mtbp3/stdcdisc/lib.py | 29 +++++++++++++++++++++++++++++ 6 files changed, 102 insertions(+) create mode 100644 docs/statlab_corr_spearman_rho.rst create mode 100644 docs/statlab_corr_tau.rst create mode 100644 docs/statlab_kappa.rst create mode 100644 docs/statlab_kappa2.rst diff --git a/docs/index.md b/docs/index.md index bdb98d8a..5a31424f 100755 --- a/docs/index.md +++ b/docs/index.md @@ -17,6 +17,10 @@ example_emt4.ipynb std_iso_pdf.ipynb std_iso_idmp.ipynb std_cdisc.ipynb +statlab_kappa.rst +statlab_kappa2.rst +statlab_corr_tau.rst +statlab_corr_spearman_rho.rst changelog.md contributing.md diff --git a/docs/statlab_corr_spearman_rho.rst b/docs/statlab_corr_spearman_rho.rst new file mode 100644 index 00000000..f78fdc6d --- /dev/null +++ b/docs/statlab_corr_spearman_rho.rst @@ -0,0 +1,17 @@ +.. + # Copyright (C) 2023-2024 Y Hsu + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public license as published by + # the Free software Foundation, either version 3 of the License, or + # any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details + # + # You should have received a copy of the GNU General Public license + # along with this program. If not, see + +Please visit the new page here: https://yh202109.github.io/mtbp3Lab/statlab_corr_spearman_rho.html diff --git a/docs/statlab_corr_tau.rst b/docs/statlab_corr_tau.rst new file mode 100644 index 00000000..73d35ce1 --- /dev/null +++ b/docs/statlab_corr_tau.rst @@ -0,0 +1,17 @@ +.. + # Copyright (C) 2023-2024 Y Hsu + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public license as published by + # the Free software Foundation, either version 3 of the License, or + # any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details + # + # You should have received a copy of the GNU General Public license + # along with this program. If not, see + +plese visit the new page here: https://yh202109.github.io/mtbp3Lab/statlab_corr_tau.html diff --git a/docs/statlab_kappa.rst b/docs/statlab_kappa.rst new file mode 100644 index 00000000..30b71b78 --- /dev/null +++ b/docs/statlab_kappa.rst @@ -0,0 +1,18 @@ +.. + # Copyright (C) 2023-2024 Y Hsu + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public license as published by + # the Free software Foundation, either version 3 of the License, or + # any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details + # + # You should have received a copy of the GNU General Public license + # along with this program. If not, see + + +Please visit the new page here: https://yh202109.github.io/mtbp3Lab/statlab_kappa.html diff --git a/docs/statlab_kappa2.rst b/docs/statlab_kappa2.rst new file mode 100644 index 00000000..a9bc41e7 --- /dev/null +++ b/docs/statlab_kappa2.rst @@ -0,0 +1,17 @@ +.. + # Copyright (C) 2023-2024 Y Hsu + # + # This program is free software: you can redistribute it and/or modify + # it under the terms of the GNU General Public license as published by + # the Free software Foundation, either version 3 of the License, or + # any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details + # + # You should have received a copy of the GNU General Public license + # along with this program. If not, see + +Please visit the new page here: https://yh202109.github.io/mtbp3Lab/statlab_kappa2.html diff --git a/mtbp3/stdcdisc/lib.py b/mtbp3/stdcdisc/lib.py index 48840c1e..5c0318d1 100644 --- a/mtbp3/stdcdisc/lib.py +++ b/mtbp3/stdcdisc/lib.py @@ -205,5 +205,34 @@ def get_ct_codelists_df(self, title="", max_level = 3): return + def get_standards(self): + """ + Retrieves a list of available standards from the CDISC library. + + This method sends a GET request to the CDISC library API to retrieve a list of available standards. + It returns a list of standard names. + + Returns: + list: A list of available standards. + """ + ep = "/mdr/products" + req = requests.get( + self.baseURL + ep, + headers={'api-key': self.api_key, 'Accept': 'application/json'} + ) + req.close() + + if req.status_code == 200: + data = req.json() + # standards = [standard['name'] for standard in data['_links']['standards']] + # return standards + return data + else: + raise ValueError("Invalid status code: " + str(req.status_code) + " - " + req.reason) + if __name__ == "__main__": + # Example usage of get_standards method + lib = accessLib("/Users/yh2020/cdisc.txt") # Replace with the actual path to the input file + standards = lib.get_standards() + print(standards) pass \ No newline at end of file