# Models


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

------------------------------------------------------------------------

<a
href="https://github.com/abdelkareemkobo/seo_rat/blob/main/seo_rat/models.py#L54"
target="_blank" style="float:right; font-size:smaller">source</a>

### get_all_websites

``` python

def get_all_websites(
    session:Session, # Active database session
)->list:

```

*Return all websites from the database.*

------------------------------------------------------------------------

<a
href="https://github.com/abdelkareemkobo/seo_rat/blob/main/seo_rat/models.py#L60"
target="_blank" style="float:right; font-size:smaller">source</a>

### delete_website

``` python

def delete_website(
    session:Session, # Active database session
    website_id:int, # ID of the website to delete
)->None:

```

*Delete a website by ID, raises ValueError if not found.*

------------------------------------------------------------------------

<a
href="https://github.com/abdelkareemkobo/seo_rat/blob/main/seo_rat/models.py#L71"
target="_blank" style="float:right; font-size:smaller">source</a>

### add_or_update_website

``` python

def add_or_update_website(
    session:Session, # Active database session
    url:str, # Website URL (must include https://)
    name:str, # Display name for the Website
    site_type:str, # Type: 'quarto','astro',etc.
    desc:str='', # Optional description
    lang:str='en', # Language code
    content_dir:str='', # Local path to content directory
    website_id:int | None=None, # ID to update exisiting.
)->Website:

```

*Add a new website or update an exisiting one.*

------------------------------------------------------------------------

<a
href="https://github.com/abdelkareemkobo/seo_rat/blob/main/seo_rat/models.py#L118"
target="_blank" style="float:right; font-size:smaller">source</a>

### print_websites

``` python

def print_websites(
    websites:list
)->None:

```

*Print websites as a rich table.*
