{"id":19091946,"url":"https://github.com/allencellmodeling/dbormexample","last_synced_at":"2025-11-11T21:33:18.508Z","repository":{"id":91697805,"uuid":"134337821","full_name":"AllenCellModeling/DbOrmExample","owner":"AllenCellModeling","description":"Using Orator to populate a DB","archived":false,"fork":false,"pushed_at":"2018-06-01T00:50:48.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-22T07:31:41.966Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/AllenCellModeling.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-05-22T00:04:36.000Z","updated_at":"2018-06-01T00:50:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0e4ee54-8466-4316-bb57-22361a7e92aa","html_url":"https://github.com/AllenCellModeling/DbOrmExample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AllenCellModeling/DbOrmExample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2FDbOrmExample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2FDbOrmExample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2FDbOrmExample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2FDbOrmExample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AllenCellModeling","download_url":"https://codeload.github.com/AllenCellModeling/DbOrmExample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AllenCellModeling%2FDbOrmExample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283937313,"owners_count":26919456,"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","status":"online","status_checked_at":"2025-11-11T02:00:06.610Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-09T03:17:37.260Z","updated_at":"2025-11-11T21:33:18.492Z","avatar_url":"https://github.com/AllenCellModeling.png","language":"Python","readme":"# DbOrmExample\n\nThis is a simple script to load an example data file (csv) and write it into a DB. The default config is for sqlite3. \nThe intent is to use this to catch bad fields and allow the developer to put in smart validations for the models to \nmake sure the data being loaded is valid data. \n\n## Orator Documentation\n\nis available at [orator-orm.com](https://orator-orm.com/docs/0.9/)\n\n## Installation \n\nto install orator \n```commandline\n\u003e pip install orator\n```\n\nthen install db backends that you intend to use\n```commandline\n\u003e pip install psycopg2\n\u003e pip install sqlalchemy\n```\n\nno need to install sqlite it comes pre-installed with python\n\n## The database\n\nConfiguration for the database is done in orator.yml. The example in this repo uses SQLite3 to create a local \ndatabase file. The orator.yml.j2 file is a template that can be populated with the keys for a remote database. \nFor the AICS internal modeling database ask me and I'll give you a correctly populated orator.yml file.\n\n## Basics \n\nCreate the table in the database defined in the migrations folder\nFrom the command line: \n\n```\n\u003e orator migrate\n```\n(answer yes to create the table)\n\nTo run the example script to populate the table\n```\n\u003e python Csv2Db.py \n```\n\nThe 'TblGetter.py' file uses orator to pull records from the populated \ndatabase. It also gives simple a simple example of how to query the database\nfor a subset of data matching a criteria. \n```\n\u003e python TblGetter.py\n```\n\n'PanadsGetter.py' is an example of using pandas to pull all the data in the \ntable into a pandas dataframe. Since the data was checked when the database was \npopulated you don't need as much sanity checking in your application.\n\n## File Descriptions\n\nThe migrations folder contains the database config files. \nIf you're used to working with migrations this can be cool as it\nallows you to apply changes to your databases incrementally as well \nas roll back your databases to a prior status. Another useful feature \nis that you can test locally with sqlite3 as a backend before populating \ndatabases on a production system.\n\nThe models folder contains Database table representations (almost no code)\n\norator.yml is the sqlite has the sqlite database configuration information. \n\ninput_data/ contains an example input csv file. \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallencellmodeling%2Fdbormexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fallencellmodeling%2Fdbormexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fallencellmodeling%2Fdbormexample/lists"}