{"id":21126998,"url":"https://github.com/pyrustic/litedao","last_synced_at":"2026-05-09T01:38:13.909Z","repository":{"id":60722510,"uuid":"379410309","full_name":"pyrustic/litedao","owner":"pyrustic","description":"Intuitive interaction with SQLite database","archived":false,"fork":false,"pushed_at":"2022-03-21T20:35:06.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T19:02:24.985Z","etag":null,"topics":["auto-init","dao","data","database","database-access","library","lightweight","pyrustic","python","sql","sqlite"],"latest_commit_sha":null,"homepage":"https://pyrustic.github.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyrustic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-22T21:57:06.000Z","updated_at":"2021-11-16T20:03:42.000Z","dependencies_parsed_at":"2022-10-03T21:02:06.251Z","dependency_job_id":null,"html_url":"https://github.com/pyrustic/litedao","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Flitedao","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Flitedao/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Flitedao/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyrustic%2Flitedao/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyrustic","download_url":"https://codeload.github.com/pyrustic/litedao/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243573166,"owners_count":20312879,"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":["auto-init","dao","data","database","database-access","library","lightweight","pyrustic","python","sql","sqlite"],"created_at":"2024-11-20T04:46:13.652Z","updated_at":"2026-05-09T01:38:08.875Z","avatar_url":"https://github.com/pyrustic.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"**This project is deprecated since the class Database exists in the library [Shared](https://github.com/pyrustic/shared)**\n\n\u003cbr\u003e\u003cbr\u003e\n\n\u003c!-- Intro Text --\u003e\n# Litedao\n\u003cb\u003e Intuitive interaction with SQLite database \u003c/b\u003e\n\nThis project is part of the [Pyrustic Ecosystem](https://pyrustic.github.io).\n\n[Installation](#installation) | [Reference](https://github.com/pyrustic/litedao/tree/master/docs/reference#readme) | [Shared](https://github.com/pyrustic/shared)\n\n\n## Overview\nHere is an example of an interaction with an SQL database:\n\n```python\nfrom litedao import Litedao\n\n\n# Database path (if this file does not exist, it will be created)\nDATABASE_PATH = \"/home/alex/litedao_test.db\"\n\n\n# SQL code to initialize the database\nINIT_SCRIPT = \"\"\"\\\nCREATE TABLE friend (username TEXT PRIMARY KEY, email TEXT NOT NULL);\nCREATE TABLE enemy (username TEXT PRIMARY KEY, email TEXT NOT NULL)\"\"\"\n\n\n# Insertion SQL code\nINSERTION_SQL = \"\"\"\\\nINSERT INTO friend (username, email)\nVALUES (?, ?), (?, ?)\"\"\"\n\n\n# Selection SQL code\nSELECTION_SQL = \"SELECT * from friend\"\n\n\ndef insert_data(litedao):\n    # inserts data in the database then returns a boolean\n    return litedao.edit(INSERTION_SQL, param=(\"alex\", \"alex@earth.invalid\",\n                                       \"rustic\", \"rustic@earth.invalid\"))\n\n\ndef select_data(litedao):\n    # returns the selection\n    return litedao.query(SELECTION_SQL)\n\n\n# litedao instance\nlitedao = Litedao(DATABASE_PATH, init_script=INIT_SCRIPT)\n\n# insert data if this database is newly created\nif litedao.is_new:\n    insert_data(litedao)\n\n\nselection = select_data(litedao)\ntables = litedao.tables()\ncolumns = litedao.columns(\"friend\")\n\nlitedao.close()  # if you forget to close Litedao, it will close itself at exit\n\nprint(selection)\n# output: (['username', 'email'], [('alex', 'alex@earth.invalid'), ('rustic', 'rustic@earth.invalid')])\n\nprint(tables)\n# output: ['friend', 'enemy']\n\nprint(columns)\n# output: [(0, 'username', 'TEXT', 0, None, 1), (1, 'email', 'TEXT', 1, None, 0)]\n\n\n```\n\nRead the [reference](https://github.com/pyrustic/litedao/tree/master/docs/reference#readme) !\n\nDo you need to store data collections with another simpler paradigm ? Check [Shared](https://github.com/pyrustic/shared) ! \n\n## Installation\n\n```bash\npip install litedao\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrustic%2Flitedao","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyrustic%2Flitedao","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyrustic%2Flitedao/lists"}