semvec/pypi-packages huggingface dataset:
saas-core-lib 0.1.5
Common core library for all microservices
Requires Python: >=3.10

# SAAS Core Library

Common core library for all microservices in the SAAS platform.

## Features

- **Database Management**: SQLAlchemy 2.0+ async engine with connection pooling
- **Redis Client**: Async Redis client with state and cache databases  
- **Elasticsearch**: Centralized Elasticsearch client management
- **Security**: JWT token management, password hashing, API key handling
- **Logging**: Structured logging with service-specific loggers
- **Response Handling**: Standardized API response formats
- **Configuration**: Environment-based configuration management

## Installation

```bash
pip install saas-core-lib
```

## Usage

### Database

```python
from saas_core_lib import get_db_session, create_tables

# Get database session
async with get_db_session() as session:
    # Your database operations
    pass

# Create all tables
await create_tables()
```

### Redis

```python
from saas_core_lib import get_redis_client

# Get Redis client
redis_client = await get_redis_client()
await redis_client.set("key", "value")
```

### Security

```python
from saas_core_lib import hash_password, verify_password, create_access_token

# Hash password
hashed = hash_password("my_password")

# Verify password
is_valid = verify_password("my_password", hashed)

# Create JWT token
token = create_access_token({"user_id": "123"})
```

### Response Handling

```python
from saas_core_lib import create_success_response, create_error_response, ErrorCode

# Success response
return create_success_response("User created successfully", {"user_id": "123"})

# Error response
return create_error_response("User not found", ErrorCode.NOT_FOUND, 404)
```

### Logging

```python
from saas_core_lib import get_logger, LogLevel, setup_logging

# Setup logging for service
setup_logging("my-service", LogLevel.INFO)

# Get logger
logger = get_logger("my-service")
logger.info("Application started")
```

## Configuration

Set environment variables in `.env` file:

```env
# Database
DATABASE_URL=postgresql+asyncpg://user:pass@localhost/dbname

# Redis  
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=password

# Elasticsearch
ELASTICSEARCH_URL=https://localhost:9200
ELASTICSEARCH_USERNAME=user
ELASTICSEARCH_PASSWORD=pass

# JWT
JWT_SECRET=your-secret-key
JWT_ALGORITHM=HS256
JWT_EXPIRE_DAYS=7
```

## Development

```bash
# Install dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Code formatting
black src/
isort src/

# Type checking
mypy src/
```

## License

MIT License
grill 0.19.1
Pipeline tools for (but not limited to) audiovisual projects.
Keywords: cg cgi audiovisual pipeline tools usd pxr cook pixar 3d animation

# 👨‍🍳 The Grill
[![Python CI](https://github.com/thegrill/grill/actions/workflows/python-package.yml/badge.svg)](https://github.com/thegrill/grill/actions/workflows/python-package.yml)
[![codecov](https://codecov.io/gh/thegrill/grill/branch/main/graph/badge.svg)](https://codecov.io/gh/thegrill/grill)
[![Documentation Status](https://readthedocs.org/projects/grill/badge/?version=latest)](https://grill.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://badge.fury.io/py/grill.svg)](https://badge.fury.io/py/grill)
[![PyPI](https://img.shields.io/pypi/pyversions/grill.svg)](https://pypi.python.org/pypi/grill)

> Cook digital.

`The Grill` is a toolset that helps with digital content creation. This is the `grill` namespace, a meta-package with core tools and philosophy guidelines.

With future users and readers in mind, `The Grill` aims to stick to the following principles:

- [DRY (don't repeat yourself)](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself)
- [SSOT (single source of truth)](https://en.wikipedia.org/wiki/Single_source_of_truth)
- [Convention over configuration (sensible defaults)](https://en.wikipedia.org/wiki/Convention_over_configuration)
- [SOLID (understandable, flexible and maintainable)](https://en.wikipedia.org/wiki/SOLID)
- [KISS (keep it simple)](https://en.wikipedia.org/wiki/KISS_principle)

Foundational tools:
- [Python](https://docs.python.org/3/)
- [USD](https://graphics.pixar.com/usd/docs/index.html)
- [EdgeDB](https://edgedb.com)

Please [visit the docs](https://grill.rtfd.io) for a full walk-through!
bqtools-json 1.0.10
A Big Query json utility package
Requires Python: >3.8
Keywords: bqtools

This is bqtools a handy set of utils to help create big query tables from json objects and make them into tables (so get the schema) and to create json new line files.
Plus a set of common functions to ease writing biq query python code

Goals
* Simplify handling and move between big query stryuctured data and json data
* Allow you to create big query table schemas from json structures (as resource or schema objects) uses reflection of types
* Provides easy generation of views for day partitioned tabled
  * head - latest data
  * diff views for time snap shots of data i.e. each day partition has current view of data
* Calculate valid json structures from representative json data that can be used as basis of big query schemas
* Clean json data such that it can be loaded into big query
  * Replace bare lists with dictionaries
  * Replace field  names with valid values that can be column names in big query (removes spaces, characters not allowed in field names using same algorithms big query uses when auto detecting schemas)
  * Encodes json output of dates, datetimes, times, timedeltas encoded in format acceptable for big query corresponding field types
* Generate code for bq command line tool from bq table structures
* Simplify common tasks of handling big query data
  * Basic tests on dataset or tables existing
  * Schema patching compare an existing schema to a template json object calculate if changed and generate a merged schema that can be used in a patch
  * Flattening views to avoid view depth limits
  
```
import bqtools

# if you load a json object say something like
foo = {
        "id":1,
        "description":""
        "aboolean":False
      }
      
# generate a schema
table = {
   "type":"TABLE",
   "location":os.environ["location"],
   "tableReference":{
       "projectId": os.environ["projectid"],
       "datasetId": os.environ["dataset"],
       "tableId": key
   },
   "timePartitioning":{
       "type": "DAY",
       "expirationMs": "94608000000"
   },
   "schema": {}
}

# use bqtools to create a schema structure
table["schema"]["fields"] = bqtools.get_bq_schema_from_json_repr(foo)

```

Demonstrates some of power of tools via [bqsync](https://github.com/hsbc/bqtools/blob/master/BQSYNCUSAGE.md) that is installed if you install via pip.

    pip install bqtools-json
    
Or you can find the source for this [here](https://github.com/hsbc/bqtools/blob/master/bqtools/bqsync)
    
Also provides means to handle views across environments supports SQL views based upon Jinja templates. So you can "configure" views for different environments.

Provides support for calculating view dependencies such views can be applied in parallel tranches.

Provides support for calculating authorised views based on set of views "compiled"

Compilation flattens views to lower view depth but automatically does not flatten authorised views to keep access to data tight as feasible.