{"id":23920668,"url":"https://github.com/anybox/pylint_flask_sqlalchemy","last_synced_at":"2025-04-11T22:11:03.321Z","repository":{"id":43009943,"uuid":"224142018","full_name":"anybox/pylint_flask_sqlalchemy","owner":"anybox","description":"pylint_flask_sqlalchemy is a Pylint plugin to improve static code analysis of Flask-SQLAlchemy based projects.","archived":false,"fork":false,"pushed_at":"2024-05-27T14:10:56.000Z","size":78,"stargazers_count":8,"open_issues_count":10,"forks_count":5,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-03T05:09:10.649Z","etag":null,"topics":["flask","pylint","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anybox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-26T08:36:43.000Z","updated_at":"2023-03-16T07:43:16.000Z","dependencies_parsed_at":"2025-01-05T15:51:37.766Z","dependency_job_id":"98fef77c-5072-49ba-9b03-93155f7eb202","html_url":"https://github.com/anybox/pylint_flask_sqlalchemy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anybox%2Fpylint_flask_sqlalchemy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anybox%2Fpylint_flask_sqlalchemy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anybox%2Fpylint_flask_sqlalchemy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anybox%2Fpylint_flask_sqlalchemy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anybox","download_url":"https://codeload.github.com/anybox/pylint_flask_sqlalchemy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248487695,"owners_count":21112191,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","pylint","python","sqlalchemy"],"created_at":"2025-01-05T15:51:29.322Z","updated_at":"2025-04-11T22:11:03.292Z","avatar_url":"https://github.com/anybox.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pylint Flask SQLAlchemy\n\n[![PyPI](https://badge.fury.io/py/pylint-flask-sqlalchemy.svg)](https://pypi.org/project/pylint-flask-sqlalchemy/)\n[![Workflow](https://github.com/anybox/pylint_flask_sqlalchemy/actions/workflows/main.yml/badge.svg)](https://github.com/anybox/pylint_flask_sqlalchemy/actions)\n[![Downloads](https://pepy.tech/badge/pylint-flask-sqlalchemy/month)](https://pepy.tech/project/pylint-flask-sqlalchemy)\n\n## About\n\n`pylint_flask_sqlalchemy` is a [Pylint](https://www.pylint.org/) to improve static code\nanalysis of [Flask-SQLAlchemy](https://flask-sqlalchemy.palletsprojects.com) based\nprojects.\n\n`pylint_flask_sqlalchemy` is now hosted on GitHub: https://github.com/anybox/pylint_flask_sqlalchemy\n\n## Installation \n\n```sh\npip install pylint_flask_sqlalchemy\n```\n\nAnd tell Pylint to `--load-plugins pylint_flask_sqlalchemy`.\n\n## Usage\n\nHere's a simple flask application:\n\n```python\n\"\"\"app.py\"\"\"\nfrom flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\n\napp = Flask(__name__)\napp.config[\"SQLALCHEMY_DATABASE_URI\"] = \"sqlite:////tmp/test.db\"\ndb = SQLAlchemy(app)\n\n\nclass Group(db.Model):\n    id = db.Column(db.Integer, primary_key=True)\n    name = db.Column(db.String(80), unique=True, nullable=False)\n\n    def __repr__(self):\n        return f\"\u003cGroup {self.name}\u003e\"\n\n\nclass User(db.Model):\n    id = db.Column(db.Integer, primary_key=True)\n    username = db.Column(db.String(80), unique=True, nullable=False)\n    group = db.relationship(Group)\n\n    def __repr__(self):\n        return f\"\u003cUser {self.username}\u003e\"\n\nuser = User(username=\"test\")\ndb.session.add(user)\ndb.session.commit()\n```\n\n### Without the plugin 😓\n\n```sh\npylint app.py\n\napp.py:11:9: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)\napp.py:11:19: E1101: Instance of 'SQLAlchemy' has no 'Integer' member (no-member)\napp.py:12:11: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)\napp.py:12:21: E1101: Instance of 'SQLAlchemy' has no 'String' member (no-member)\napp.py:19:9: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)\napp.py:19:19: E1101: Instance of 'SQLAlchemy' has no 'Integer' member (no-member)\napp.py:20:15: E1101: Instance of 'SQLAlchemy' has no 'Column' member (no-member)\napp.py:20:25: E1101: Instance of 'SQLAlchemy' has no 'String' member (no-member)\napp.py:21:12: E1101: Instance of 'SQLAlchemy' has no 'relationship' member (no-member)\napp.py:28:0: E1101: Instance of 'scoped_session' has no 'add' member (no-member)\napp.py:29:0: E1101: Instance of 'scoped_session' has no 'commit' member (no-member)\n\n----------------------------------------------------------------------\nYour code has been rated at -18.95/10 (previous run: 10.00/10, -28.95)\n```\n\n\n\n### With pylint_flask_sqlalchemy 🥳\n\n```sh\npylint --load-plugins pylint_flask_sqlalchemy app.py\n\n----------------------------------------------------------------------\nYour code has been rated at 10.00/10 (previous run: -13.08/10, +23.08)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanybox%2Fpylint_flask_sqlalchemy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanybox%2Fpylint_flask_sqlalchemy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanybox%2Fpylint_flask_sqlalchemy/lists"}