sqlalchemy-fields


Namesqlalchemy-fields JSON
Version 0.5.0 PyPI version JSON
download
home_pageNone
SummarySQLAlchemy fields
upload_time2023-06-27 08:36:57
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords django orm sqlalchemy
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # SQLAlchemy Fields

<p align="center">
<a href="https://github.com/aminalaee/sqlalchemy-fields/actions">
    <img src="https://github.com/aminalaee/sqlalchemy-fields/workflows/Tests/badge.svg" alt="Build Status">
</a>
<a href="https://github.com/aminalaee/sqlalchemy-fields/actions">
    <img src="https://github.com/aminalaee/sqlalchemy-fields/workflows/Publish/badge.svg" alt="Publish Status">
</a>
<a href="https://codecov.io/gh/aminalaee/sqlalchemy-fields">
    <img src="https://codecov.io/gh/aminalaee/sqlalchemy-fields/branch/main/graph/badge.svg" alt="Coverage">
</a>
<a href="https://pypi.org/project/sqlalchemy-fields/">
    <img src="https://badge.fury.io/py/sqlalchemy-fields.svg" alt="Package version">
</a>
<a href="https://pypi.org/project/sqlalchemy-fields" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/sqlalchemy-fields.svg?color=%2334D058" alt="Supported Python versions">
</a>
</p>

---

**Documentation**: [https://aminalaee.dev/sqlalchemy-fields](https://aminalaee.dev/sqlalchemy-fields)

**Source Code**: [https://github.com/aminalaee/sqlalchemy-fields](https://github.com/aminalaee/sqlalchemy-fields)

---

**Table of Contents**

- [Installation](#installation)
- [Custom Types](#custom-types)

## Installation

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

## Custom Types

- `EmailType`
- `FileType`
- `ImageType`
- `IPAddressType`
- `URLType`
- `UUIDType`

```python
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")
"""
```

## Storages

- `FileSystemStorage`
- `S3Storage`

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sqlalchemy-fields",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "django,orm,sqlalchemy",
    "author": null,
    "author_email": "Amin Alaee <me@aminalaee.dev>",
    "download_url": "https://files.pythonhosted.org/packages/eb/e5/3235a01aef002472a741c43ecbc9337c192d66f7aa64d78ceaf3f9908ed6/sqlalchemy_fields-0.5.0.tar.gz",
    "platform": null,
    "description": "# SQLAlchemy Fields\n\n<p align=\"center\">\n<a href=\"https://github.com/aminalaee/sqlalchemy-fields/actions\">\n    <img src=\"https://github.com/aminalaee/sqlalchemy-fields/workflows/Tests/badge.svg\" alt=\"Build Status\">\n</a>\n<a href=\"https://github.com/aminalaee/sqlalchemy-fields/actions\">\n    <img src=\"https://github.com/aminalaee/sqlalchemy-fields/workflows/Publish/badge.svg\" alt=\"Publish Status\">\n</a>\n<a href=\"https://codecov.io/gh/aminalaee/sqlalchemy-fields\">\n    <img src=\"https://codecov.io/gh/aminalaee/sqlalchemy-fields/branch/main/graph/badge.svg\" alt=\"Coverage\">\n</a>\n<a href=\"https://pypi.org/project/sqlalchemy-fields/\">\n    <img src=\"https://badge.fury.io/py/sqlalchemy-fields.svg\" alt=\"Package version\">\n</a>\n<a href=\"https://pypi.org/project/sqlalchemy-fields\" target=\"_blank\">\n    <img src=\"https://img.shields.io/pypi/pyversions/sqlalchemy-fields.svg?color=%2334D058\" alt=\"Supported Python versions\">\n</a>\n</p>\n\n---\n\n**Documentation**: [https://aminalaee.dev/sqlalchemy-fields](https://aminalaee.dev/sqlalchemy-fields)\n\n**Source Code**: [https://github.com/aminalaee/sqlalchemy-fields](https://github.com/aminalaee/sqlalchemy-fields)\n\n---\n\n**Table of Contents**\n\n- [Installation](#installation)\n- [Custom Types](#custom-types)\n\n## Installation\n\n```console\npip install sqlalchemy-fields\npip install 'sqlalchemy-fields[full]'\n```\n\n## Custom Types\n\n- `EmailType`\n- `FileType`\n- `ImageType`\n- `IPAddressType`\n- `URLType`\n- `UUIDType`\n\n```python\nfrom sqlalchemy import Column, Integer, create_engine\nfrom sqlalchemy.orm import Session, declarative_base\nfrom sqlalchemy_fields.types import IPAddressType\n\n\nBase = declarative_base()\nengine = create_engine(\"sqlite:///example.db\")\n\n\nclass Example(Base):\n    __tablename__ = \"example\"\n\n    id = Column(Integer, primary_key=True)\n    ip = Column(IPAddressType)\n\n\nexample = Example(ip=\"127.0.0.1\")\nwith Session(engine) as session:\n    session.add(example)\n    session.commit()\n    print(example.ip)\n\"\"\"\nIPv4Address(\"127.0.0.1\")\n\"\"\"\n```\n\n## Storages\n\n- `FileSystemStorage`\n- `S3Storage`\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "SQLAlchemy fields",
    "version": "0.5.0",
    "project_urls": {
        "Documentation": "https://github.com/aminalaee/sqlalchemy-fields#readme",
        "Issues": "https://github.com/aminalaee/sqlalchemy-fields/issues",
        "Source": "https://github.com/aminalaee/sqlalchemy-fields"
    },
    "split_keywords": [
        "django",
        "orm",
        "sqlalchemy"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "b628b60ce2d69be492dfffa1b6bec7657f15b02b25ec676a1736fc9429b2e2de",
                "md5": "1394e4e9f3e8df0bf488a0bc3add3ab9",
                "sha256": "601298a808b3d873224a8dd1febc774e58f720556c3f995a5975e77195b55408"
            },
            "downloads": -1,
            "filename": "sqlalchemy_fields-0.5.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1394e4e9f3e8df0bf488a0bc3add3ab9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 11853,
            "upload_time": "2023-06-27T08:37:02",
            "upload_time_iso_8601": "2023-06-27T08:37:02.703038Z",
            "url": "https://files.pythonhosted.org/packages/b6/28/b60ce2d69be492dfffa1b6bec7657f15b02b25ec676a1736fc9429b2e2de/sqlalchemy_fields-0.5.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ebe53235a01aef002472a741c43ecbc9337c192d66f7aa64d78ceaf3f9908ed6",
                "md5": "145ce022b5f6f71765961cb5a136e679",
                "sha256": "b30022d73b69696f1e76bddfce55d59555361c25a4be572efa87a22f237349ec"
            },
            "downloads": -1,
            "filename": "sqlalchemy_fields-0.5.0.tar.gz",
            "has_sig": false,
            "md5_digest": "145ce022b5f6f71765961cb5a136e679",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 8146,
            "upload_time": "2023-06-27T08:36:57",
            "upload_time_iso_8601": "2023-06-27T08:36:57.597281Z",
            "url": "https://files.pythonhosted.org/packages/eb/e5/3235a01aef002472a741c43ecbc9337c192d66f7aa64d78ceaf3f9908ed6/sqlalchemy_fields-0.5.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-06-27 08:36:57",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aminalaee",
    "github_project": "sqlalchemy-fields#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "sqlalchemy-fields"
}
        
Elapsed time: 0.29763s