flake8-sqlalchemy
A flake8 plugin for SQLAlchemy code.
Installation
pip install flake8-sqlalchemy
Configuration
By default, all checks are enabled.
You can disable all checks by adding the following to your setup.cfg:
[flake8]
ignore = SQA
or ignore specific checks:
[flake8]
ignore = SQA100
SQA100 - sqlalchemy import alias
Checks that when sqlalchemy is imported with an alias,
the alias is either sa or db.
Bad
import sqlalchemy as foo
Good
import sqlalchemy as sa
# or
import sqlalchemy as db
SQA200 - Column keyword argument comment required
When writing a Column definition the comment keyword argument is required.
This provides inline documentation for the column,
as well as generating the SQL to add the comment to the database.
Bad
class Users(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
name = Column(String)
Good
class Users(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True, comment="User ID from Auth Service")
name = Column(String, comment="User name: first, middle, last")
Also applies to mapped_column:
class Users(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True, comment="User ID from Auth Service")
name = mapped_column(String, comment="User name: first, middle, last")
License
This project is licensed under the terms of the MIT license. See the LICENSE file for the full license text.
Author
Metadata
Release files for flake8-sqlalchemy 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| flake8_sqlalchemy-0.2.0.tar.gz | 6.4 kB | Without provenance | Details for flake8_sqlalchemy-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| flake8_sqlalchemy-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for flake8_sqlalchemy-0.2.0-py3-none-any.whl |
Total release size: 14.7 kB
Release files / flake8_sqlalchemy-0.2.0.tar.gz
| Download URL | flake8_sqlalchemy-0.2.0.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0330865e8ea53c9da581283d960b91bf4716a467672d60a61433cbff202f884d
|
|
BLAKE2b-256 checksum How to use checksums |
d8d6fe5646eb1c8e5f0260642128859195e6cc2ff7542356edeccebe90f63ef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0
|
Release files / flake8_sqlalchemy-0.2.0-py3-none-any.whl
| Download URL | flake8_sqlalchemy-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
96c719d560f42857ef24fdb09b97a2e4acffbd40b6795f8bf26c01f2c109d50a
|
|
BLAKE2b-256 checksum How to use checksums |
6cf4207e32a090d2304561aec4b39ebcfb8b00bfc22d31ed1f70e91e598c7fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.5 Darwin/22.6.0
|
Security for flake8-sqlalchemy 0.2.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.