Skip to main content

A postgres database adapter for the minumtium library.

Project description

Minumtium Postgres

A postgres database adapter for the minumtium library. It uses SQL Alchemy as its abstraction library alongside with pg8000 as the connection driver.

What can I use it for?

It is used to provide access to data stored in postgres instances using the minumtium library.

Usage

Install it using your favorite package manager:

pip install minumtium-postgres
pipenv install minumtium-postgres
poetry install minumtium-postgres

Then, provide it to your minumtium Services:

from minumtium.modules.idm import IdmService, UserRepository
from minumtium_simple_jwt_auth import SimpleJwtAuthentication

from minumtium_postgres import MinumtiumPostgresAdapter, MinumtiumPostgresAdapterConfig

config = MinumtiumPostgresAdapterConfig(
    username='minumtium',
    password='samplepassword',
    host='localhost',
    port=5432,
    dbname='minumtium',
    schema_name='minumtium')

db_adapter = SqlAlchemyAdapter({config, 'posts')
auth_adapter = SimpleJwtAuthentication(configuration={
    'jwt_key': 'not a reliable key, change that quickly',
    'session_duration_hours': 1})

users_repository = UserRepository(db_adapter)
idm_service = IdmService(auth_adapter, users_repository)

idm_service.authenticate('jao', 'batata')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

minumtium_postgres-1.1.0.tar.gz (6.1 kB view hashes)

Uploaded Source

Built Distribution

minumtium_postgres-1.1.0-py3-none-any.whl (7.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page