Name | vera-testframework JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | Testframework voor VERA referentiedata |
upload_time | 2024-07-12 14:11:49 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9.5 |
license | MIT License Copyright (c) 2024 Woonstad Rotterdam 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 |
vera
referentiedata
test
testframework
aedes
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# VERA Testframework
⏳ Work in progress
Maakt het makkelijk om te testen of data voldoet aan de [VERA-standaard](https://github.com/Aedes-datastandaarden/vera-referentiedata) m.b.v. het [pyspark-testframework](https://github.com/woonstadrotterdam/pyspark-testframework).
## Tutorial
**Op het moment is het _vera-testframework_ alleen compatibel met _pyspark_.**
```python
from vera_testframework.pyspark import ReferentiedataTest
from pyspark.sql import SparkSession
from testframework.dataquality import DataFrameTester
```
```python
spark = SparkSession.builder.appName("vera_testframework").getOrCreate()
```
**Hieronder wordt een voorbeeld DataFrame gemaakt m.b.t. ruimten, waarvan we gaan testen of de waardes voldoen aan de VERA-standaard.**
```python
ruimten = [
(1, "LOG", "Loggia"),
(2, "WOO", "Woonkamer"),
(3, "BAD", "Badruimte"),
(4, "BAD", "Badkamer"),
(5, None, "Kelder"),
(6, "SLA", None),
]
ruimten_df = spark.createDataFrame(ruimten, ["id", "code", "naam"])
```
**We maken gebruik van de `DataFrameTester` van het _pyspark-testframework_ om onze testresultaten in bij te houden.**
```python
testframework = DataFrameTester(
df=ruimten_df,
primary_key="id",
spark=spark,
)
```
**Door middel van de `ReferentiedataTest` kunnen we testen of een kolom voldoet aan de VERA-standaard m.b.t. Referentiedata.**
```python
testframework.test(
col="code",
test=ReferentiedataTest(
soort="RUIMTEDETAILSOORT",
attribuut="Code",
release="latest", # standaard is latest, maar kan ook een specifieke versie zijn zoals v4.1.240419
),
nullable=False, # of een waarde leeg mag zijn. Dit is aan de gebruiker
).show()
```
+---+----+-------------------+
| id|code|code__VERAStandaard|
+---+----+-------------------+
| 1| LOG| true|
| 2| WOO| true|
| 3| BAD| true|
| 4| BAD| true|
| 5|NULL| false|
| 6| SLA| true|
+---+----+-------------------+
```python
testframework.test(
col="naam",
test=ReferentiedataTest(
soort="RUIMTEDETAILSOORT",
attribuut="Naam",
),
nullable=True,
).show()
```
+---+---------+-------------------+
| id| naam|naam__VERAStandaard|
+---+---------+-------------------+
| 1| Loggia| true|
| 2|Woonkamer| true|
| 3|Badruimte| false|
| 4| Badkamer| true|
| 5| Kelder| true|
| 6| NULL| true|
+---+---------+-------------------+
**De resultaten van de testen zijn te vinden in de `.results` attribuut van de `DataFrameTester`.**
```python
testframework.results.show()
```
+---+-------------------+-------------------+
| id|code__VERAStandaard|naam__VERAStandaard|
+---+-------------------+-------------------+
| 1| true| true|
| 2| true| true|
| 3| true| false|
| 4| true| true|
| 5| false| true|
| 6| true| true|
+---+-------------------+-------------------+
**Voor meer informatie over hoe het _pyspark-testframework_ te gebruiken, raadpleeg de documentatie op [hun Github](https://github.com/woonstadrotterdam/pyspark-testframework)**
Raw data
{
"_id": null,
"home_page": null,
"name": "vera-testframework",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9.5",
"maintainer_email": null,
"keywords": "vera, referentiedata, test, testframework, aedes",
"author": null,
"author_email": "Woonstad Rotterdam <info@woonstadrotterdam.nl>, Tomer Gabay <tomer.gabay@woonstadrotterdam.nl>",
"download_url": "https://files.pythonhosted.org/packages/4e/a6/768a603ae1466b31b1ce08e9fd061d066d6ce6d7062cc1381ce3bbccfdef/vera_testframework-0.1.0.tar.gz",
"platform": null,
"description": "# VERA Testframework\n\n\u23f3 Work in progress\n\nMaakt het makkelijk om te testen of data voldoet aan de [VERA-standaard](https://github.com/Aedes-datastandaarden/vera-referentiedata) m.b.v. het [pyspark-testframework](https://github.com/woonstadrotterdam/pyspark-testframework).\n\n## Tutorial\n\n**Op het moment is het _vera-testframework_ alleen compatibel met _pyspark_.**\n\n```python\nfrom vera_testframework.pyspark import ReferentiedataTest\nfrom pyspark.sql import SparkSession\nfrom testframework.dataquality import DataFrameTester\n```\n\n```python\nspark = SparkSession.builder.appName(\"vera_testframework\").getOrCreate()\n```\n\n**Hieronder wordt een voorbeeld DataFrame gemaakt m.b.t. ruimten, waarvan we gaan testen of de waardes voldoen aan de VERA-standaard.**\n\n```python\nruimten = [\n (1, \"LOG\", \"Loggia\"),\n (2, \"WOO\", \"Woonkamer\"),\n (3, \"BAD\", \"Badruimte\"),\n (4, \"BAD\", \"Badkamer\"),\n (5, None, \"Kelder\"),\n (6, \"SLA\", None),\n]\n\nruimten_df = spark.createDataFrame(ruimten, [\"id\", \"code\", \"naam\"])\n```\n\n**We maken gebruik van de `DataFrameTester` van het _pyspark-testframework_ om onze testresultaten in bij te houden.**\n\n```python\ntestframework = DataFrameTester(\n df=ruimten_df,\n primary_key=\"id\",\n spark=spark,\n)\n```\n\n**Door middel van de `ReferentiedataTest` kunnen we testen of een kolom voldoet aan de VERA-standaard m.b.t. Referentiedata.**\n\n```python\ntestframework.test(\n col=\"code\",\n test=ReferentiedataTest(\n soort=\"RUIMTEDETAILSOORT\",\n attribuut=\"Code\",\n release=\"latest\", # standaard is latest, maar kan ook een specifieke versie zijn zoals v4.1.240419\n ),\n nullable=False, # of een waarde leeg mag zijn. Dit is aan de gebruiker\n).show()\n```\n\n +---+----+-------------------+\n | id|code|code__VERAStandaard|\n +---+----+-------------------+\n | 1| LOG| true|\n | 2| WOO| true|\n | 3| BAD| true|\n | 4| BAD| true|\n | 5|NULL| false|\n | 6| SLA| true|\n +---+----+-------------------+\n\n```python\ntestframework.test(\n col=\"naam\",\n test=ReferentiedataTest(\n soort=\"RUIMTEDETAILSOORT\",\n attribuut=\"Naam\",\n ),\n nullable=True,\n).show()\n```\n\n +---+---------+-------------------+\n | id| naam|naam__VERAStandaard|\n +---+---------+-------------------+\n | 1| Loggia| true|\n | 2|Woonkamer| true|\n | 3|Badruimte| false|\n | 4| Badkamer| true|\n | 5| Kelder| true|\n | 6| NULL| true|\n +---+---------+-------------------+\n\n**De resultaten van de testen zijn te vinden in de `.results` attribuut van de `DataFrameTester`.**\n\n```python\ntestframework.results.show()\n```\n\n +---+-------------------+-------------------+\n | id|code__VERAStandaard|naam__VERAStandaard|\n +---+-------------------+-------------------+\n | 1| true| true|\n | 2| true| true|\n | 3| true| false|\n | 4| true| true|\n | 5| false| true|\n | 6| true| true|\n +---+-------------------+-------------------+\n\n**Voor meer informatie over hoe het _pyspark-testframework_ te gebruiken, raadpleeg de documentatie op [hun Github](https://github.com/woonstadrotterdam/pyspark-testframework)**\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Woonstad Rotterdam 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": "Testframework voor VERA referentiedata",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/woonstadrotterdam/vera-testframework",
"Issues": "https://github.com/woonstadrotterdam/vera-testframework/issues"
},
"split_keywords": [
"vera",
" referentiedata",
" test",
" testframework",
" aedes"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "791b32bb01a785eccda555ce7f7991599d0e649b23ca47d2d07a0a11c26f540e",
"md5": "65c8fc3bf237a3f2b14cef8d416ad554",
"sha256": "5ef488649e43c2470e82a05275e50090ac42632d37278aeba0b88a80470deefe"
},
"downloads": -1,
"filename": "vera_testframework-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "65c8fc3bf237a3f2b14cef8d416ad554",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.5",
"size": 7032,
"upload_time": "2024-07-12T14:11:48",
"upload_time_iso_8601": "2024-07-12T14:11:48.052989Z",
"url": "https://files.pythonhosted.org/packages/79/1b/32bb01a785eccda555ce7f7991599d0e649b23ca47d2d07a0a11c26f540e/vera_testframework-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4ea6768a603ae1466b31b1ce08e9fd061d066d6ce6d7062cc1381ce3bbccfdef",
"md5": "3bb493b9ad62263fb66f5de31a8526ea",
"sha256": "232facd0a580f77a9fc9595f861fb2fcd7801ccc7b28abad00136e8884302941"
},
"downloads": -1,
"filename": "vera_testframework-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "3bb493b9ad62263fb66f5de31a8526ea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.5",
"size": 13932,
"upload_time": "2024-07-12T14:11:49",
"upload_time_iso_8601": "2024-07-12T14:11:49.606899Z",
"url": "https://files.pythonhosted.org/packages/4e/a6/768a603ae1466b31b1ce08e9fd061d066d6ce6d7062cc1381ce3bbccfdef/vera_testframework-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-12 14:11:49",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "woonstadrotterdam",
"github_project": "vera-testframework",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "vera-testframework"
}