Organise db files
This commit is contained in:
parent
332fb247d4
commit
b9ea237f44
3 changed files with 5 additions and 4 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -1,2 +1,3 @@
|
||||||
.venv
|
.venv/
|
||||||
__pycache__
|
__pycache__
|
||||||
|
data/
|
||||||
2
db.py
2
db.py
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue