{"id":42952,"date":"2026-10-04T17:36:22","date_gmt":"2026-10-04T15:36:22","guid":{"rendered":"https:\/\/smartdatamodels.org\/?p=42952"},"modified":"2026-10-04T17:35:39","modified_gmt":"2026-10-04T15:35:39","slug":"new-pysmartdatamodels-version-0-8-0-11-more-reliable-sql-schema-generation","status":"publish","type":"post","link":"https:\/\/smartdatamodels.org\/index.php\/new-pysmartdatamodels-version-0-8-0-11-more-reliable-sql-schema-generation\/","title":{"rendered":"New pysmartdatamodels Version 0.8.0.11: More Reliable SQL Schema Generation"},"content":{"rendered":"<p>We are happy to announce a new release of our Python package, <code>pysmartdatamodels<\/code>, version 0.8.0.11, focused on making the SQL schema generation function more robust, fixing how the package exposes its functions, and keeping our GitHub source and published package in sync.<\/p>\n<h3>What\u2019s New in This Version?<\/h3>\n<h4><b>More Reliable SQL Schema Generation<\/b><\/h4>\n<p>The <code>generate_sql_schema()<\/code> function, which turns a data model\u2019s <code>model.yaml<\/code> into a ready-to-use PostgreSQL <code>CREATE TABLE<\/code> statement, received three fixes:<\/p>\n<ul>\n<li>Column names are now properly quoted, so attribute names that are reserved words or mixed case no longer produce invalid SQL.<\/li>\n<li>Properties using <code>anyOf<\/code> are now supported, in addition to <code>oneOf<\/code>.<\/li>\n<li>The function no longer emits a duplicate <code>id<\/code> column in the generated schema.<\/li>\n<\/ul>\n<p>Example:<\/p>\n<pre lang=\"python3\">from pysmartdatamodels import pysmartdatamodels as sdm\r\n\r\nsql = sdm.generate_sql_schema(\"https:\/\/raw.githubusercontent.com\/smart-data-models\/dataModel.Weather\/master\/WeatherForecast\/model.yaml\")\r\nprint(sql)<\/pre>\n<h4><b>More Usable Imports<\/b><\/h4>\n<p>You can now import the package\u2019s main functions directly from the top level, instead of always going through the submodule:<\/p>\n<pre lang=\"python3\">from pysmartdatamodels import generate_sql_schema, load_all_datamodels<\/pre>\n<p>The documented usage pattern below continues to work exactly as before:<\/p>\n<pre lang=\"python3\">from pysmartdatamodels import pysmartdatamodels as sdm<\/pre>\n<h4><b>Repository Housekeeping<\/b><\/h4>\n<p>The source code published on <a href=\"https:\/\/github.com\/smart-data-models\/data-models\/tree\/master\/pysmartdatamodels\" target=\"_blank\" rel=\"noopener\">GitHub<\/a> and the package published on PyPI had drifted apart over the last few releases. With this version, both are back in sync, so what you see in the repository is exactly what you get when you <code>pip install<\/code> the package.<\/p>\n<h3>Get the Latest Version<\/h3>\n<p>Update your installation with:<\/p>\n<pre lang=\"bash\">pip install --upgrade pysmartdatamodels<\/pre>\n<p><b>\u27a1\ufe0f <a href=\"https:\/\/pypi.org\/project\/pysmartdatamodels\/0.8.0.11\/\" target=\"_blank\" rel=\"noopener\">Get the package on PyPI<\/a><\/b><\/p>\n<h3>Our Commitment to Open and Interoperable Data<\/h3>\n<p>We are committed to making data interoperability easier for everyone. Thanks to everyone in the community who reports issues and helps us keep improving pysmartdatamodels!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are happy to announce a new release of our Python package, pysmartdatamodels, version 0.8.0.11, focused on making the SQL schema generation function more robust, fixing how the package exposes its functions, and keeping our GitHub source and published package in sync. What\u2019s New in This Version? More Reliable SQL&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/smartdatamodels.org\/index.php\/new-pysmartdatamodels-version-0-8-0-11-more-reliable-sql-schema-generation\/\">More&#8230;<\/a><\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[105,107,109,113,115,119,117,88,143,111,125,182,201],"tags":[],"class_list":["post-42952","post","type-post","status-publish","format-standard","hentry","category-cross-sector","category-smart-cities","category-smart-energy-domain","category-smart-environment","category-smart-manufacturing","category-smart-robotics","category-smart-water","category-smart-sensoring","category-smartaeronautics","category-smart-agrifood","category-smartdestinations","category-smarthealth","category-smartlogistics"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":10131,"url":"https:\/\/smartdatamodels.org\/index.php\/new-pysmartdatamodels-package-0-6-3-release\/","url_meta":{"origin":42952,"position":0},"title":"New pysmartdatamodels package 0.6.3 Release","author":"maestro","date":"02\/11\/2023","format":false,"excerpt":"We are thrilled to announce the latest update to pysmartdatamodels Python package, version 0.6.3, featuring a new function: generate_sql_schema()This addition enabling seamless generation of SQL schemas with just a few lines of code! Introducing\u00a0 generate_sql_schemqa() Function: With the new function, generate_sql_schemqa()\u00a0 pysmartdatamodels simplifies the process of creating SQL schemas for\u2026","rel":"","context":"In &quot;Smart Cities domain&quot;","block_context":{"text":"Smart Cities domain","link":"https:\/\/smartdatamodels.org\/index.php\/category\/smart-cities\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10291,"url":"https:\/\/smartdatamodels.org\/index.php\/new-version-of-pysmartdatamodels-package-0-6-4-with-adaptations-to-data-spaces\/","url_meta":{"origin":42952,"position":1},"title":"New version of pysmartdatamodels package 0.6.4 with adaptations to Data Spaces","author":"maestro","date":"26\/02\/2024","format":false,"excerpt":"There is a new version of the python package pysmartdatamodels to use it you have just to type pip install pysmartdatamodels in your system Besides the update in the list of data models it includes two new functions - look_for_data_model that allows approximate searches for a data model based on\u2026","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2024\/02\/pysmartdatamodels_0.6.4.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":9334,"url":"https:\/\/smartdatamodels.org\/index.php\/new-version-of-the-python-package-pysmartdatamodels-0-6-0\/","url_meta":{"origin":42952,"position":2},"title":"New Version of the Python Package pysmartdatamodels 0.6.0","author":"maestro","date":"01\/08\/2023","format":false,"excerpt":"There is a new version of the python package for pysmartdatamodels 0.6.0. This python package includes all the data models and several functions to use them in your developments. Changelog: - Four new functions New functions to generate fake example files given the schema payload of the data model in\u2026","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"pysmartdatamodels 0.6.0","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-01-at-09.34.53-300x162.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-01-at-09.34.53-300x162.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-01-at-09.34.53-300x162.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":9905,"url":"https:\/\/smartdatamodels.org\/index.php\/new-version-of-the-python-package-pysmartdatamodels-0-6-1\/","url_meta":{"origin":42952,"position":3},"title":"New Version of the Python Package pysmartdatamodels 0.6.1","author":"maestro","date":"09\/10\/2023","format":false,"excerpt":"There is a new version of the python package for pysmartdatamodels 0.6.1. This python package includes all the data models and several functions to use them in your developments. Changelog: - Two updated functions New extension for function update_broker() to allow updating nonexistent attribute into broker Function validate_data_model_schema(), with wider\u2026","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2023\/10\/Screenshot-2023-10-09-at-13.59.19-1024x685.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2023\/10\/Screenshot-2023-10-09-at-13.59.19-1024x685.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2023\/10\/Screenshot-2023-10-09-at-13.59.19-1024x685.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2023\/10\/Screenshot-2023-10-09-at-13.59.19-1024x685.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":10091,"url":"https:\/\/smartdatamodels.org\/index.php\/new-service-export-you-data-models-to-sql-schema\/","url_meta":{"origin":42952,"position":4},"title":"New service: Export you data models to SQL schema","author":"maestro","date":"30\/10\/2023","format":false,"excerpt":"We provide a service to Generate a PostgreSQL schema SQL script from the model.yaml representation of a Smart Data Model. You can access this service under this link following Tools > SQL service. You need to provide as input the standard GitHub link to the model.yaml file or the raw\u2026","rel":"","context":"In &quot;Smart Cities domain&quot;","block_context":{"text":"Smart Cities domain","link":"https:\/\/smartdatamodels.org\/index.php\/category\/smart-cities\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2023\/10\/Screen-Shot-2023-10-30-at-17.14.41-300x201.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":10356,"url":"https:\/\/smartdatamodels.org\/index.php\/new-version-of-pysmartdatamodels-python-package-0-7-1\/","url_meta":{"origin":42952,"position":5},"title":"New version of pysmartdatamodels python package 0.7.1","author":"maestro","date":"07\/05\/2024","format":false,"excerpt":"The changes in this new version are: - Including new function validate_dcat_ap_distribution_sdm - Updating the comments of most of the functions - Some code improvements by jilin.he@fiware.org - Included a new directory with templates for the creation of a data model. Not used yet but next version they will be\u2026","rel":"","context":"In &quot;Cross Sector&quot;","block_context":{"text":"Cross Sector","link":"https:\/\/smartdatamodels.org\/index.php\/category\/cross-sector\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/smartdatamodels.org\/wp-content\/uploads\/2024\/05\/pysmartdatamodels_0.7.1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/posts\/42952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/comments?post=42952"}],"version-history":[{"count":3,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/posts\/42952\/revisions"}],"predecessor-version":[{"id":42955,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/posts\/42952\/revisions\/42955"}],"wp:attachment":[{"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/media?parent=42952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/categories?post=42952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/smartdatamodels.org\/index.php\/wp-json\/wp\/v2\/tags?post=42952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}