semvec/pypi-packages huggingface dataset:
hojo 0.3.1
Hojo: An ORM built on top of SQL Alchemy
License: MIT
Requires Python: >=3.11,<4.0

# Hojo - An Opinionated ORM on Top of SQL Alchemy
![hojo](https://github.com/rizidoro/hojo/assets/13101/369da95d-3d5c-470b-aaf3-46f133ae056d)

Hojo is a library that simplifies the usage of SQL Alchemy, providing an interface that is familiar to Django users. While it is not an exact replication of the Django ORM API, it strives to be reminiscent of it, making it easier for Django developers to work with SQL Alchemy.

**Please note that this library is currently in Alpha version and is not yet ready for production use.**

## Installation

You can install Hojo using pip:

```bash
pip install hojo
```

## Basic Usage
Here's a basic example of how to use Hojo:


```python
# file: models.py
from hojo import automap, model

@model
class Soldier:
    name: str
    weapon: str
    level: int

# Create the mappers automatically
automap()


# file: query.py

# Insert the hero into the 'soldiers' table
hero = Soldier.objects.create(name='Cloud Strife', weapon='Buster Sword', level=50)

# Insert the antagonist into the 'soldiers' table
antagonist = Soldier.objects.create(name='Sephiroth', weapon='Masamune', level=99)

# Retrieve a Soldier with the name 'Cloud' from the 'soldiers' table
soldier = Soldier.objects.filter(name='Cloud Strife')

# Retrieve a Soldier filtering by the weapon
soldier = Soldier.objects.filter(weapon__startswith='Buster')

# Retrieve a list of Soldiers filtering by level greater than 10
soldiers = Soldier.objects.filter(level__gt=10)
```

## Schema usage
Hojo provides a BaseSchema class, that you can use with attrs @define and get some abstractions over it:

```python
from hojo import schema
from enum import StrEnum

class MateriaType(StrEnum):
    MAGIC = 'magic'
    SUPPORT = 'support'
    SUMMON = 'summon'
    COMMAND = 'command'

@schema
class Materia:
    name: str
    materia_type: MateriaType
    

ifrit = Materia.load({'name': 'Ifrit', 'materia_type': 'summon'})

print(ifrit) # => Materia(name='Ifrit', materia_type=<MateriaType.SUMMON: 'summon'>)

print(ifrit.dump()) # => {'name': 'Ifrit', 'materia_type': 'summon'}

print(ifrit.dump(only=['name'])) # => {'name': 'Ifrit'}

print(ifrit.dump(exclude=['name'])) # => {'materia_type': 'summon'}

```
maxlog 0.0.3
Provides the Log class is a custom logger implementation using the loguru library. It provides a flexible and customizable logging solution for projects.
License: MIT
Requires Python: >=3.10

# maxlog

[![PyPI version](https://badge.fury.io/py/maxlog.svg)](https://badge.fury.io/py/maxlog)
## Installation

```bash
pip install maxlog
```

## Usage

```python
# Create an instance of the Log class
_console = Console(record=True)
    log = Log("TRACE", console=_console)

    # Test log instance
    log.trace("This is a trace message.")
    log.debug("This is a debug message.")
    log.info("This is an info message.")
    log.success("This is a success message.")
    log.warning("This is a warning message.")
    log.error("This is an error message.")
    log.critical("This is a critical message.")

    log.console.save_svg("log.svg")

```
## Output

![maxlog output](img/log.svg)

## Created by Max Ludden

![Max Ludden's Logo](https://private-user-images.githubusercontent.com/51646468/284406500-dff29293-4afb-40a5-8e1a-275108898845.svg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTEiLCJleHAiOjE3MDI4MjgxMTUsIm5iZiI6MTcwMjgyNzgxNSwicGF0aCI6Ii81MTY0NjQ2OC8yODQ0MDY1MDAtZGZmMjkyOTMtNGFmYi00MGE1LThlMWEtMjc1MTA4ODk4ODQ1LnN2Zz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFJV05KWUFYNENTVkVINTNBJTJGMjAyMzEyMTclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjMxMjE3VDE1NDMzNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJhOTk1MThkYTM5MmExZjIwZWJjZmFhY2NiNDYwNDYyMjM4NDNlMzk1OWI1YjJiZDgyODdkNGIwY2JhNzc2Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.4KAmyPb43Tvt8UgDzfOpw3lN5aP0G8XjJT69tDbIvY8)