Organise db files

This commit is contained in:
jableader 2024-01-14 10:44:53 +11:00
parent 332fb247d4
commit b9ea237f44
3 changed files with 5 additions and 4 deletions

3
.gitignore vendored
View file

@ -1,2 +1,3 @@
.venv .venv/
__pycache__ __pycache__
data/

2
db.py
View file

@ -1,7 +1,7 @@
import aiosqlite import aiosqlite
async def connect() -> aiosqlite.Connection: async def connect() -> aiosqlite.Connection:
return await aiosqlite.connect('your_database.db') return await aiosqlite.connect('./data/your_database.db')
async def create(): async def create():
import products.db as product_db import products.db as product_db

View file

@ -51,7 +51,7 @@ async def scrape_recipe(url: str) -> dict:
def _dump_json_data_to_log(data: dict) -> str: def _dump_json_data_to_log(data: dict) -> str:
import os, re import os, re
dir = './dump' dir = './data/dump'
if not os.path.exists(dir): if not os.path.exists(dir):
os.makedirs(dir) os.makedirs(dir)