Skip to main content

sqlalchemy-citext

Creates a SQLAlchemy user defined type to understand PostgreSQL’s CIText extension.

Installation

This requires some kind of PostgreSQL compatible db-api driver already installed in order to work.

Make sure you have something like psycopg2 already installed.

pip install sqlalchemy-citext

Usage

from sqlalchemy import create_engine, MetaData, Integer
from sqlalchemy.schema import Column, Table
import sqlalchemy.orm as orm

from citext import CIText


engine = create_engine('postgresql://localhost/test_db')
meta = MetaData()

test_table = Table('test', meta,
    Column('id', Integer(), primary_key=True),
    Column('txt', CIText()))

conn = engine.connect()

meta.bind = conn
meta.drop_all()
meta.create_all()

class TestObj(object):
    def __init__(self, id_, txt):
        self.id = id_
        self.txt = txt

    def __repr__(self):
        return "TestObj(%r, %r)" % (self.id, self.txt)

orm.mapper(TestObj, test_table)
Session = orm.sessionmaker(bind=engine)
ses = Session()

to = TestObj(1, txt='FooFighter')
ses.add(to)
ses.commit()
row = ses.query(TestObj).filter(TestObj.txt == 'foofighter').all()
assert len(row) == 1
print row
ses.close()

License

sqlalchemy-citext is an MIT/BSD dual-Licensed library.

Contribute

  • Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.

  • Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).

  • Write a test which shows that the bug was fixed or that the feature works as expected.

  • Send a pull request and bug the maintainer until it gets merged and published.

  • Make sure to add yourself to the author’s file in setup.py and the Contributors section below :)

Contributors

Metadata

Release files for sqlalchemy-citext 1.6-1

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-citext 1.6-1
File Size Uploaded Provenance Actions
sqlalchemy-citext-1.6-1.tar.gz 3.3 kB Without provenance Details for sqlalchemy-citext-1.6-1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sqlalchemy-citext 1.6-1
File Interpreter ABI Platform Actions
sqlalchemy_citext-1.6.post1-py2.py3-none-any.whl Python 2, Python 3 none any Details for sqlalchemy_citext-1.6.post1-py2.py3-none-any.whl

Total release size: 8.2 kB

Release files / sqlalchemy-citext-1.6-1.tar.gz

Download URL sqlalchemy-citext-1.6-1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8da1ea1b7deba4d1884961bd8a03fe1fd2bb2b3242e849e7696401c1fb4d4606
BLAKE2b-256 checksum
How to use checksums
1a22914b08fc3b11c52875f419cd28db9165fb14f789ac9b59fe9353b4f805a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Release files / sqlalchemy_citext-1.6.post1-py2.py3-none-any.whl

Download URL sqlalchemy_citext-1.6.post1-py2.py3-none-any.whl
Size 4.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1b11d51efc9b772142e22fceb260793265e01f300fdd3af83b0be31cdfb7a5ca
BLAKE2b-256 checksum
How to use checksums
5065a4814f1489deec5dc83deffb40108af4ebcc2ae8da47686c0548001503d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Security for sqlalchemy-citext 1.6-1

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.

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