Skip to main content

SQLAlchemy fields

Project description

SQLAlchemy Fields

PyPI - Version PyPI - Python Version


Table of Contents

Installation

pip install sqlalchemy-fields
pip install 'sqlalchemy-fields[full]'

Custom Types

  • EmailType
  • FileType
  • ImageType
  • IPAddressType
  • URLType
  • UUIDType
from sqlalchemy import Column, Integer, create_engine
from sqlalchemy.orm import Session, declarative_base
from sqlalchemy_fields.types import IPAddressType


Base = declarative_base()
engine = create_engine("sqlite:///example.db")


class Example(Base):
    __tablename__ = "example"

    id = Column(Integer, primary_key=True)
    ip = Column(IPAddressType)


example = Example(ip="127.0.0.1")
with Session(engine) as session:
    session.add(example)
    session.commit()
    print(example.ip)
"""
IPv4Address("127.0.0.1")
"""

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

sqlalchemy_fields-0.3.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sqlalchemy_fields-0.3.0-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file sqlalchemy_fields-0.3.0.tar.gz.

File metadata

  • Download URL: sqlalchemy_fields-0.3.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for sqlalchemy_fields-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3663d1cf39eea2336b23a8b8ba2173e35c85451291096afb53cb20e84e7b7c85
MD5 9ab83498fae32960276a2a2fbe8e4145
BLAKE2b-256 e49f77e9383db9b7cb8f4ca9c0019c79418a63afbd23296a18a2a266cd6f6c32

See more details on using hashes here.

File details

Details for the file sqlalchemy_fields-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sqlalchemy_fields-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5d9f880b9bc1614b4f6fc7fb358204f4594a256259c951436fd771520d7eae60
MD5 a42538e515525660e5f905935dc35480
BLAKE2b-256 61fc8df8f89810c78dd9c78ea9274ab08c13641bb33c0442cee05a6f813e72fc

See more details on using hashes here.

Supported by

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