{"id":17343709,"url":"https://github.com/zbrookle/dataframe_sql","last_synced_at":"2025-08-20T18:33:19.358Z","repository":{"id":45707150,"uuid":"221794578","full_name":"zbrookle/dataframe_sql","owner":"zbrookle","description":"A Python package that parses SQL and interprets it as methods that act upon existing pandas (or other types of) DataFrames that have been declared and registered","archived":false,"fork":false,"pushed_at":"2021-09-03T21:03:14.000Z","size":399,"stargazers_count":98,"open_issues_count":1,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-10T04:10:25.629Z","etag":null,"topics":["data","dataframes","pandas","python","sql"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zbrookle.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-14T22:02:00.000Z","updated_at":"2024-04-03T08:30:06.000Z","dependencies_parsed_at":"2022-08-30T13:52:35.838Z","dependency_job_id":null,"html_url":"https://github.com/zbrookle/dataframe_sql","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbrookle%2Fdataframe_sql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbrookle%2Fdataframe_sql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbrookle%2Fdataframe_sql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zbrookle%2Fdataframe_sql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zbrookle","download_url":"https://codeload.github.com/zbrookle/dataframe_sql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230066400,"owners_count":18167538,"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":["data","dataframes","pandas","python","sql"],"created_at":"2024-10-15T16:10:09.227Z","updated_at":"2024-12-19T14:07:34.181Z","avatar_url":"https://github.com/zbrookle.png","language":"Python","readme":"dataframe_sql\n=============\n\n.. image:: https://github.com/zbrookle/dataframe_sql/workflows/CI/badge.svg?branch=master\n    :target: https://github.com/zbrookle/dataframe_sql/actions?query=workflow\n\n.. image:: https://pepy.tech/badge/dataframe-sql\n    :target: https://pepy.tech/project/dataframe-sql\n\n.. image:: https://img.shields.io/pypi/l/dataframe_sql.svg\n    :target: https://github.com/zbrookle/dataframe_sql/blob/master/LICENSE.txt\n\n.. image:: https://img.shields.io/pypi/status/dataframe_sql.svg\n    :target: https://pypi.python.org/pypi/dataframe_sql/\n\n.. image:: https://img.shields.io/pypi/v/dataframe_sql.svg\n    :target: https://pypi.python.org/pypi/dataframe_sql/\n\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n\n``dataframe_sql`` is a Python_ package that translates SQL syntax into operations on\npandas_ DataFrames, a functionality which is not available in the central pandas\npackage.\n\n.. _Python: https://www.python.org/\n\nInstallation\n------------\n\n.. code-block:: bash\n\n    pip install dataframe_sql\n\n\nUsage\n-----\n\nIn this simple example, a DataFrame is read in from a csv and then using the query\nfunction you can produce a new DataFrame from the sql query.\n\n.. code-block:: python\n\n    from pandas import read_csv\n    from dataframe_sql import register_temp_table, query\n\n    my_table = read_csv(\"some_file.csv\")\n\n    register_temp_table(my_table, \"my_table\")\n\n    query(\"\"\"select * from my_table\"\"\")\n\n\nThe package currently only supports pandas_ but there are plans to support dask_,\nrapids_, and modin_ in the future.\n\n.. _pandas: https://github.com/pandas-dev/pandas\n.. _dask: https://github.com/dask/dask\n.. _rapids: https://github.com/rapidsai/cudf\n.. _modin: https://github.com/modin-project/modin\n\nSQL Syntax\n----------\nThe SQL syntax for ``dataframe_sql`` is exactly the same as the syntax in\n``sql_to_ibis``, its underlying package.\n\nYou can find the full SQL syntax\n`here \u003chttps://github.com/zbrookle/sql_to_ibis#sql-syntax\u003e`__\n\nWhy use dataframe_sql?\n----------------------\n\nWhile there are other packages that accomplish the goal of using SQL with pandas\nDataFrames, all other packages such as pandasql_ actually use a database on the\nbackend which defeats the purpose of using pandas_ to begin with. In the case of\npandasql_ which uses SQLite, this can result in major performance bottlenecks.\n``dataframe_sql`` actually performs native pandas operations in memory on DataFrames,\nwhich avoids conflicts that may arise from using external databases.\n\n.. _pandasql: https://github.com/yhat/pandasql\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbrookle%2Fdataframe_sql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzbrookle%2Fdataframe_sql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzbrookle%2Fdataframe_sql/lists"}