{"id":16933081,"url":"https://github.com/aiguofer/sql_connectors","last_synced_at":"2025-10-13T19:19:24.757Z","repository":{"id":45115860,"uuid":"126122871","full_name":"aiguofer/sql_connectors","owner":"aiguofer","description":"A simple wrapper for SQL connections using SQLAlchemy and Pandas read_sql to standardize SQL workflow with multiple data sources.","archived":false,"fork":false,"pushed_at":"2022-01-07T08:55:00.000Z","size":155,"stargazers_count":11,"open_issues_count":160,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-13T19:19:23.738Z","etag":null,"topics":["data-analysis","data-analytics","data-exploration","data-science","pandas","relational-databases","sql","sqlalchemy","standardized-api"],"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/aiguofer.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-21T04:23:13.000Z","updated_at":"2023-04-14T13:08:19.000Z","dependencies_parsed_at":"2022-09-12T01:30:17.311Z","dependency_job_id":null,"html_url":"https://github.com/aiguofer/sql_connectors","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/aiguofer/sql_connectors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aiguofer%2Fsql_connectors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aiguofer%2Fsql_connectors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aiguofer%2Fsql_connectors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aiguofer%2Fsql_connectors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aiguofer","download_url":"https://codeload.github.com/aiguofer/sql_connectors/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aiguofer%2Fsql_connectors/sbom","scorecard":{"id":172863,"data":{"date":"2025-08-11","repo":{"name":"github.com/aiguofer/sql_connectors","commit":"b80c6ff786ef3bac3b90101a92bdf5257735599f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.9,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":1,"reason":"9 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-42991 / GHSA-v3c5-jqr6-7qm8","Warn: Project is vulnerable to: PYSEC-2020-73","Warn: Project is vulnerable to: PYSEC-2019-124 / GHSA-38fc-9xqv-7f7q","Warn: Project is vulnerable to: PYSEC-2019-123 / GHSA-887w-45rq-vxgf","Warn: Project is vulnerable to: PYSEC-2012-9 / GHSA-hfg2-wf6j-x53p","Warn: Project is vulnerable to: PYSEC-2021-437 / GHSA-5xp3-jfq3-5q8x","Warn: Project is vulnerable to: PYSEC-2020-173 / GHSA-gpvv-69j7-gwj8","Warn: Project is vulnerable to: PYSEC-2023-228 / GHSA-mq26-g339-26xf","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T17:02:40.417Z","repository_id":45115860,"created_at":"2025-08-16T17:02:40.417Z","updated_at":"2025-08-16T17:02:40.417Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279016895,"owners_count":26085884,"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","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["data-analysis","data-analytics","data-exploration","data-science","pandas","relational-databases","sql","sqlalchemy","standardized-api"],"created_at":"2024-10-13T20:48:32.581Z","updated_at":"2025-10-13T19:19:24.704Z","avatar_url":"https://github.com/aiguofer.png","language":"Python","readme":"==============\nSQL Connectors\n==============\n\n\n.. image:: https://img.shields.io/pypi/v/sql_connectors.svg\n        :target: https://pypi.python.org/pypi/sql_connectors\n\n.. image:: https://img.shields.io/travis/aiguofer/sql_connectors.svg\n        :target: https://travis-ci.org/aiguofer/sql_connectors\n\n.. image:: https://readthedocs.org/projects/sql-connectors/badge/?version=latest\n        :target: https://sql-connectors.readthedocs.io/en/latest/?badge=latest\n        :alt: Documentation Status\n\n.. image:: https://pyup.io/repos/github/aiguofer/sql_connectors/shield.svg\n     :target: https://pyup.io/repos/github/aiguofer/sql_connectors/\n     :alt: Updates\n\n\n\nA simple wrapper for SQL connections using SQLAlchemy and Pandas read_sql to standardize SQL workflow. The main goals of this project is to reduce boilerplate code when working with SQL based data sources and to enable interactive exploration of data sources in Python.\n\n\n* Free software: MIT license\n* Documentation: https://sql-connectors.readthedocs.io.\n* Repo: https://github.com/aiguofer/sql_connectors.\n\n\nFeatures\n--------\n\n* Standardized client for working with different SQL datasources, including a standardized format for defining your connection configurations\n* A SqlClient interface based off the SQLAlchemy ``Engine`` with some helpful functions like Pandas' ``read_sql`` and functions to leverage ``reflection`` from SQLAlchemy\n\nInstallation\n------------\n\nStable release\n~~~~~~~~~~~~~~\n\nTo install SQL Connectors, run this command in your terminal:\n\n.. code-block:: console\n\n    $ pip install --process-dependency-links sql_connectors\n\nThis is the preferred method to install SQL Connectors, as it will always install the most recent stable release.\n\nIf you don't have `pip`_ installed, this `Python installation guide`_ can guide\nyou through the process.\n\n.. _pip: https://pip.pypa.io\n.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/\n\n\nDev install\n~~~~~~~~~~~\n\nThe sources for SQL Connectors can be downloaded from the `Github repo`_.\n\nYou can clone the public repository and install in development mode:\n\n.. code-block:: console\n\n    $ git clone git://github.com/aiguofer/sql_connectors\n    $ cd sql_connectors\n    $ pip install --process-dependency-links -e .[dev]\n\n\nConfigurations\n--------------\n\nConfigurations can be stored wherever you want by implementing your own ``Storage``. However, the default is ``LocalStorage`` reading in configuration files from ``~/.config/sql_connectors``.\n\nYou can change the ``Storage`` class using the ``SQL_CONNECTORS_STORAGE`` environment variable (for example ``sql_connectors.storage.LocalStorage``), and you can specify a different configuration directory or URI with ``SQL_CONNECTORS_PATH_OR_URI``.\n\nThe ``example_connection.json`` file is provided as a template; feel free to replace this with your own connection details and re-name the file.\n\nThe contents of the example file are:\n\n.. code:: javascript\n\n   {\n       \"drivername\": \"sqlite\",\n       \"relative_paths\": [\"database\"],\n       \"default_env\": \"default\",\n       \"default\": {\n           \"database\": \"example_connection.db\"\n       }\n   }\n\nThe fields mean the following:\n\n   drivername (string)\n      This required field is a SQLAlchemy dialect or dialect+driver. See the `SQLAlchemy Engine documentation \u003chttp://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls\u003e`_ for more details. You may first have to install the required python modules for your dialect+driver to work if it's a third party plug-in.\n\n   relative_paths (list of strings)\n      This optional field lets you specify if an option for your connection needs to load a file relative to your config directory. For example, if you had a connection that needed to use a cert, you could add ``query.sslrootcert`` to this list, set ``\"query\": { \"sslmode\": \"verify-ca\", \"sslrootcert\": \"certs/root.crt\"}``, and drop the cert in ``$SQL_CONNECTORS_CONFIG_DIR/certs/root.crt``.\n\n   default_env (string)\n      This optional field lets you specify which environment should be used by default. If not included, it will use ``default``.\n\n   default_schema (string)\n      This optional field lets you specify which schema should be used by default. If not included, it will use ``None``.\n\n   default_reflect (boolean)\n      This optional field lets you specify whether it should reflect the data source by default. If not included, it will use ``False``.\n\n   env.username (string)\n      This optional field specifies the username for the connection. If it's left out or set to null and the driver is not 'sqlite', the user will be prompte when they try to create the client. If the connection doesn't have credentials, set this to an empty string. Should not be set for 'sqlite'.\n\n   env.password (string)\n      This optional field specifies the password for the connection. If it's left out or set to null and the driver is not 'sqlite', the user will be prompte when they try to create the client. If the connection doesn't have credentials, set this to an empty string. Should not be set for 'sqlite'.\n\n   env.host (string)\n      This optional field specifies the host for the connection. Should not be set for 'sqlite'.\n\n   env.port (string or integer)\n      This optional field specifies the port for the connection. Should not be set for 'sqlite'.\n\n   env.database (string)\n      This optional field specifies the database name for the connection. If it's a 'sqlite' connection and left empty, it will use ``:memory:``. Otherwise, you can specify a relative path or an absolute path; if you want the file in your config directory, you can use the ``relative_paths`` property.\n\n   env.query (object)\n      This optional field is a json object with options to pass onto the dialect and/or DBAPI upon connect.\n\n   env.allowed_hosts (list of strings)\n      This optional field is a list of strings containing hostnames where the given credentials are accepted. If the hostname is not in the list, it will prompt the user for credentials. This was added due to some specific usecase where we share service credentials but they're only allowed on our common servers.\n\nHow-To\n------\n\nThe module will check your available connection configurations and create variables within the top level module for each of them. It will create 2 variables for each config, ``connection_name`` and ``connection_name_envs``; these are both functions, the first will return a ``get_client`` function with some defaults set based on the config, and the second will return a ``get_available_envs`` function that when called returns available environments for the given data source. When ``reflection`` is enabled, the client will hold metadata about the available tables.\n\nHere's a basic usage example assuming the example config file exists:\n\n.. code:: python\n\n   from sql_connectors import connections\n   client = connections.example_connection()\n   client.read_sql('select 1')\n\n\nHere's a more complex example that's pretty redundant but shows more functionality\n\n.. code:: python\n\n   from sql_connectors import connections\n\n   available_envs = connections.example_connection_envs()\n   client = connections.example_connection(env=available_envs[0], reflect=True)\n\n   client.read_sql('select 1').to_sql('example_table', client, if_exists='replace')\n   available_tables = client.table_names()\n   table1 = client.get_table(available_tables[0])\n   df = client.read_sql(table1.select())\n\n\nCredits\n-------\n\nThis package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage\n.. _Github repo: https://github.com/aiguofer/sql_connectors\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faiguofer%2Fsql_connectors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faiguofer%2Fsql_connectors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faiguofer%2Fsql_connectors/lists"}