Skip to main content

SqlAlchemy Manager [by django style]

Test Coverage Package version Supported Python versions

---

Quick start

Simple database structure

Base = declarative_base()


class BaseModel(Base):
    __abstract__ = True

    id = Column(Integer, primary_key=True)


class User(BaseModel):
    __tablename__ = "users"

    email = Column(String, unique=True, index=True)
    first_name = Column(String)

First of all, you need to create a Manager object

import os

from sqlalchemy import create_engine, Column, String, Integer
from sqlalchemy.orm import declarative_base, sessionmaker
from sqlalchemy_manager import Manager

database_url = os.getenv("DATABASE_URL", default="sqlite:///db")

engine = create_engine(
    url=database_url,
    echo=True,
)
session_maker = sessionmaker(engine)
manager = Manager(session_maker=session_maker)

Basic usage

user = manager(User).create(email="test@test.ru")
user = manager(User).get(email="test_2@test.ru")

Metadata

Release files for sqlalchemy-django-manager 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlalchemy-django-manager 0.1.0
File Size Uploaded Provenance
sqlalchemy_django_manager-0.1.0.tar.gz 2.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-django-manager 0.1.0
File Interpreter ABI Platform
sqlalchemy_django_manager-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 6.0 kB

Release files / sqlalchemy_django_manager-0.1.0.tar.gz

Download URL sqlalchemy_django_manager-0.1.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1a2d88db01a7a6db81c0d29e044c93376b116eb16605eded2e6f54f8317da4c7
BLAKE2b-256 checksum
How to use checksums
3fbd4d17d207f89929979e53f6e670e66d1b8fd0036888d1332b41df8f059bfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.0 Windows/11

Release files / sqlalchemy_django_manager-0.1.0-py3-none-any.whl

Download URL sqlalchemy_django_manager-0.1.0-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f2844a7c989a33af816356eacbc79e76c74d615d6d56139bd677a416d4600ee5
BLAKE2b-256 checksum
How to use checksums
4c1bf1b00be89ce4325ab51bab86b316bcffb7fb2af240507aeaaa3d62e66ce6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.12.0 Windows/11

Security for sqlalchemy-django-manager 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page