{"id":23346979,"url":"https://github.com/robintw/sqlalchemy-units-example","last_synced_at":"2025-04-10T03:44:54.168Z","repository":{"id":137660962,"uuid":"297437981","full_name":"robintw/sqlalchemy-units-example","owner":"robintw","description":"Example code from 'Pint + SQLAlchemy = Unit consistency and enforcement in your database' poster at PyData Global 2020","archived":false,"fork":false,"pushed_at":"2020-09-22T08:20:15.000Z","size":6,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T15:57:20.065Z","etag":null,"topics":["pint","sqlalchemy","units"],"latest_commit_sha":null,"homepage":"","language":"Python","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/robintw.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2020-09-21T19:16:16.000Z","updated_at":"2024-07-15T17:51:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"2d034438-3180-4667-abe6-4ca509db7d90","html_url":"https://github.com/robintw/sqlalchemy-units-example","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"3b384d59efa4c73c4f28cfba1d29506fa8adc2fa"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robintw%2Fsqlalchemy-units-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robintw%2Fsqlalchemy-units-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robintw%2Fsqlalchemy-units-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robintw%2Fsqlalchemy-units-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robintw","download_url":"https://codeload.github.com/robintw/sqlalchemy-units-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154976,"owners_count":21056541,"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","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":["pint","sqlalchemy","units"],"created_at":"2024-12-21T07:17:21.988Z","updated_at":"2025-04-10T03:44:54.145Z","avatar_url":"https://github.com/robintw.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pint + SQLAlchemy example code\n\nThis repo contains the example code that goes with the _Pint + SQLAlchemy = Unit consistency and enforcement in your database_ poster at PyData Global 2020.\n\nTo use:\n\n1. Install the dependencies with `pip install -r requirements.txt`.\n\n2. Look at [model_basic.py](model_basic.py) and [demo_basic.py](demo_basic.py) which show standard SQLAlchemy code to define a simple model and use it to insert a couple of rows into a database table. Nothing in these files is novel - this is standard SQLAlchemy usage. Running `demo_basic.py` will print out a bit of information about the rows inserted.\n\n3. Look at [model_units.py](model_units.py) to see how the model has been changed to check and enforce units, and then [demo_units.py](demo_units.py) to see how to use the new model. Running `demo_units.py` will show the values at various stages, showing that unit conversion and enforcement has happened. Uncomment some of the commented lines in `demo_units.py` to see what happens when you try and give a value with incorrect units.\n\nPlease feel free to contact me on robin@rtwilson.com with any questions - I will endeavour to get back to you as soon as I can.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobintw%2Fsqlalchemy-units-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobintw%2Fsqlalchemy-units-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobintw%2Fsqlalchemy-units-example/lists"}