sirp-dsi-converter


Namesirp-dsi-converter JSON
Version 1.2.0b0 PyPI version JSON
download
home_pageNone
SummaryA converter between D-SI and SI Reference Point unit formats
upload_time2025-01-23 14:27:24
maintainerNone
docs_urlNone
authorDiego Nahuel Coppa, Daniel Hutzschenreuter, Maximilian Gruber
requires_python>=3.9
licenseMIT License Copyright (c) 2024 Diego Nahuel Coppa (INTI), Daniel Hutzschenreuter (PTB), Maximilian Gruber (PTB) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords metrology unit conversion
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SIRP-D-SI Converter Service

This software ensures the reliability of the <a href="https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/blob/master/wiki/doc/UnitSystem.md">D-SI Syntax</a> by testing its internal syntax consistencies and by providing metadata within the <a href="https://si-digital-framework.org/SI/unitExpr?lang=en">SI Reference Point</a> (SIRP), which relates to prefixes, units, and exponents.

The software accepts Base or Compound Units in D-SI unit syntax and provides several pieces of information about the input:

* Its consistency according to the D-SI Syntax.

* Its transformation into Prefixes, Units and Exponents SIRP Syntax. 

* Its representation as a Permanent Identifier according to SIRP.

* Its representation as an RDF structure according to SIRP. 

* Its Metadata from the SIRP framework.

## Code Files

Several D-SI Compound Units are being shown as examples to demonstrate the functionality of the software.

### transformation.py: 

This file handles the validation and transformation logic.

### app.py:

This file serves as the flask interface.

### test.py:

This file serves as an example of how the classes from the transformation.py can be used inside any other software

### Classes

There are four main classes that can be accessed externally:

* class verboseDsiCompoundUnitValidation
  
The function messageResponse(compoundunit) within the class provides detailed information regarding the validation of the D-SI Compound Unit. If the input Compound Unit is valid, the information detailed above. If it is invalid, the class returns different messages depending on whether the Compound Unit is a valid D-SI unit or not. Additionally, it offers suggestions for correcting the input Compound Unit.

* class jsonDsiCompoundUnitValidation

The function messageResponse([string]) within the class provides detailed information regarding the validation of the D-SI Compound Unit. If the input Compound Unit is valid, the information detailed above. If it is invalid, the class returns different messages depending on whether the Compound Unit is a valid D-SI unit or not. Additionally, it offers suggestions for correcting the input Compound Unit.

* class compoundUnitValidation

The funtion validation([string]) within the class performs the validation and stores the results in variables that can be accessed externally.

* class dsiValidator

This is used to interact from the power shell.

## Example Usage 

### Prerequisites for everything except the web server:

This is an example of how to list things you need to use the software and how to install them.
* python
  ```
  pip install rdflib
  pip install re
  pip install sys
  pip install pprint
  ```
### dsiValidator
* python
 ```
 python trasformation.py -h
 #shows the help
 ```
* python
 ```
 python trasformation.py -json \metre
 #inputs the DSI unit after the '-json' and returns information about the unit in json format
 ```
* python
 ```
 python trasformation.py -v \metre
 #inputs the DSI unit after the '-v' and returns information about the unit in a verbose way
 ```

### test.py

 ```
 #input:
 info=compoundUnitValidation('\\metre')
 info.validation()
 #variables that can be accessed:
 print(f"The {info.input_compound_unit} validation is: {info.valid_dsi_unit}")
 print(f"The unit has an SIRP correspondance: {info.output_sirp_correspondance}")
 print(f"The system has a message: {info.output_human_message}")
 print(f"The SIRP PID Unit is: {info.output_pid}")
 print(f"The SIRP Unit is: {info.output_compound_unit}")
 ```
        
## Terminology

* D-SI Prefix: (e.g. \milli, \kilo, etc.)

* D-SI Unit: (e.g. \gram, \candela, \metre, etc.)

* D-SI Exponent: (e.g. \tothe{5}, etc.)

* SIRP Prefix: (e.g. milli, kilo, etc.)

* SIRP Unit: (e.g. gram, candela, metre, etc.)

* SIRP Symbol: (e.g. m, s, kg)

* SIRP Exponent: (e.g. -1, 2, 5, etc.)

* SIRP Compound Unit Symbol: (e.g. m-1, m·s-2, kg)

* SIRP Compound Unit PID: (e.g. https://si-digital-framework.org/SI/units/millisecond-1)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sirp-dsi-converter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Maximilian Gruber <maximilian.gruber@ptb.de>",
    "keywords": "metrology, unit conversion",
    "author": "Diego Nahuel Coppa, Daniel Hutzschenreuter, Maximilian Gruber",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/46/c9/aa21b07b862bc4176df7a88cc55dd88d719446c147b0940dc4ede8f4ecf7/sirp_dsi_converter-1.2.0b0.tar.gz",
    "platform": null,
    "description": "# SIRP-D-SI Converter Service\r\n\r\nThis software ensures the reliability of the <a href=\"https://gitlab1.ptb.de/d-ptb/d-si/xsd-d-si/-/blob/master/wiki/doc/UnitSystem.md\">D-SI Syntax</a> by testing its internal syntax consistencies and by providing metadata within the <a href=\"https://si-digital-framework.org/SI/unitExpr?lang=en\">SI Reference Point</a> (SIRP), which relates to prefixes, units, and exponents.\r\n\r\nThe software accepts Base or Compound Units in D-SI unit syntax and provides several pieces of information about the input:\r\n\r\n* Its consistency according to the D-SI Syntax.\r\n\r\n* Its transformation into Prefixes, Units and Exponents SIRP Syntax. \r\n\r\n* Its representation as a Permanent Identifier according to SIRP.\r\n\r\n* Its representation as an RDF structure according to SIRP. \r\n\r\n* Its Metadata from the SIRP framework.\r\n\r\n## Code Files\r\n\r\nSeveral D-SI Compound Units are being shown as examples to demonstrate the functionality of the software.\r\n\r\n### transformation.py: \r\n\r\nThis file handles the validation and transformation logic.\r\n\r\n### app.py:\r\n\r\nThis file serves as the flask interface.\r\n\r\n### test.py:\r\n\r\nThis file serves as an example of how the classes from the transformation.py can be used inside any other software\r\n\r\n### Classes\r\n\r\nThere are four main classes that can be accessed externally:\r\n\r\n* class verboseDsiCompoundUnitValidation\r\n  \r\nThe function messageResponse(compoundunit) within the class provides detailed information regarding the validation of the D-SI Compound Unit. If the input Compound Unit is valid, the information detailed above. If it is invalid, the class returns different messages depending on whether the Compound Unit is a valid D-SI unit or not. Additionally, it offers suggestions for correcting the input Compound Unit.\r\n\r\n* class jsonDsiCompoundUnitValidation\r\n\r\nThe function messageResponse([string]) within the class provides detailed information regarding the validation of the D-SI Compound Unit. If the input Compound Unit is valid, the information detailed above. If it is invalid, the class returns different messages depending on whether the Compound Unit is a valid D-SI unit or not. Additionally, it offers suggestions for correcting the input Compound Unit.\r\n\r\n* class compoundUnitValidation\r\n\r\nThe funtion validation([string]) within the class performs the validation and stores the results in variables that can be accessed externally.\r\n\r\n* class dsiValidator\r\n\r\nThis is used to interact from the power shell.\r\n\r\n## Example Usage \r\n\r\n### Prerequisites for everything except the web server:\r\n\r\nThis is an example of how to list things you need to use the software and how to install them.\r\n* python\r\n  ```\r\n  pip install rdflib\r\n  pip install re\r\n  pip install sys\r\n  pip install pprint\r\n  ```\r\n### dsiValidator\r\n* python\r\n ```\r\n python trasformation.py -h\r\n #shows the help\r\n ```\r\n* python\r\n ```\r\n python trasformation.py -json \\metre\r\n #inputs the DSI unit after the '-json' and returns information about the unit in json format\r\n ```\r\n* python\r\n ```\r\n python trasformation.py -v \\metre\r\n #inputs the DSI unit after the '-v' and returns information about the unit in a verbose way\r\n ```\r\n\r\n### test.py\r\n\r\n ```\r\n #input:\r\n info=compoundUnitValidation('\\\\metre')\r\n info.validation()\r\n #variables that can be accessed:\r\n print(f\"The {info.input_compound_unit} validation is: {info.valid_dsi_unit}\")\r\n print(f\"The unit has an SIRP correspondance: {info.output_sirp_correspondance}\")\r\n print(f\"The system has a message: {info.output_human_message}\")\r\n print(f\"The SIRP PID Unit is: {info.output_pid}\")\r\n print(f\"The SIRP Unit is: {info.output_compound_unit}\")\r\n ```\r\n        \r\n## Terminology\r\n\r\n* D-SI Prefix: (e.g. \\milli, \\kilo, etc.)\r\n\r\n* D-SI Unit: (e.g. \\gram, \\candela, \\metre, etc.)\r\n\r\n* D-SI Exponent: (e.g. \\tothe{5}, etc.)\r\n\r\n* SIRP Prefix: (e.g. milli, kilo, etc.)\r\n\r\n* SIRP Unit: (e.g. gram, candela, metre, etc.)\r\n\r\n* SIRP Symbol: (e.g. m, s, kg)\r\n\r\n* SIRP Exponent: (e.g. -1, 2, 5, etc.)\r\n\r\n* SIRP Compound Unit Symbol: (e.g. m-1, m\u00b7s-2, kg)\r\n\r\n* SIRP Compound Unit PID: (e.g. https://si-digital-framework.org/SI/units/millisecond-1)\r\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2024 Diego Nahuel Coppa (INTI), Daniel Hutzschenreuter (PTB), Maximilian Gruber (PTB)  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
    "summary": "A converter between D-SI and SI Reference Point unit formats",
    "version": "1.2.0b0",
    "project_urls": {
        "Bug Reports": "https://github.com/PTB-M4D/SIRP-D-SI-Converter-Service/issues",
        "Homepage": "https://github.com/PTB-M4D/SIRP-D-SI-Converter-Service/",
        "Source": "https://github.com/PTB-M4D/SIRP-D-SI-Converter-Service/"
    },
    "split_keywords": [
        "metrology",
        " unit conversion"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c0fb165ca1677b9482b5db3d2a913074f61fb69715222e2b43ecf3441350eb97",
                "md5": "b2bbea5d4c668d36ef000fac8006c033",
                "sha256": "db3244ad5df5151291127ac406236759e05f3b540eae1570b43a6ec30e38d16f"
            },
            "downloads": -1,
            "filename": "sirp_dsi_converter-1.2.0b0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b2bbea5d4c668d36ef000fac8006c033",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 448813,
            "upload_time": "2025-01-23T14:27:20",
            "upload_time_iso_8601": "2025-01-23T14:27:20.787784Z",
            "url": "https://files.pythonhosted.org/packages/c0/fb/165ca1677b9482b5db3d2a913074f61fb69715222e2b43ecf3441350eb97/sirp_dsi_converter-1.2.0b0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "46c9aa21b07b862bc4176df7a88cc55dd88d719446c147b0940dc4ede8f4ecf7",
                "md5": "aee9deedea7bf0daca5981fa954f1a0d",
                "sha256": "e88451f474dae9bb972e2db56fbe25f78d7ea97297c6f17997a9109d8850c870"
            },
            "downloads": -1,
            "filename": "sirp_dsi_converter-1.2.0b0.tar.gz",
            "has_sig": false,
            "md5_digest": "aee9deedea7bf0daca5981fa954f1a0d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 440863,
            "upload_time": "2025-01-23T14:27:24",
            "upload_time_iso_8601": "2025-01-23T14:27:24.146082Z",
            "url": "https://files.pythonhosted.org/packages/46/c9/aa21b07b862bc4176df7a88cc55dd88d719446c147b0940dc4ede8f4ecf7/sirp_dsi_converter-1.2.0b0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-23 14:27:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "PTB-M4D",
    "github_project": "SIRP-D-SI-Converter-Service",
    "github_not_found": true,
    "lcname": "sirp-dsi-converter"
}
        
Elapsed time: 1.22916s