{"id":23413318,"url":"https://github.com/forgineer/pandas-liteql","last_synced_at":"2026-05-11T05:37:55.680Z","repository":{"id":192967379,"uuid":"687764861","full_name":"forgineer/pandas-liteql","owner":"forgineer","description":"A simple pandas extension that enables users to execute SQL statements against DataFrames using in-memory SQLite.","archived":false,"fork":false,"pushed_at":"2025-05-10T03:14:47.000Z","size":1088,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T04:00:04.792Z","etag":null,"topics":["data-engineering","pandas","pandas-dataframe","pandas-extension","python","python3","sqlite"],"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/forgineer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-09-06T00:48:34.000Z","updated_at":"2025-05-10T03:14:50.000Z","dependencies_parsed_at":"2024-12-22T19:33:14.106Z","dependency_job_id":"66cd75e7-5ddf-4c62-8482-2dfee0650bed","html_url":"https://github.com/forgineer/pandas-liteql","commit_stats":null,"previous_names":["forgineer/pandas-liteql"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/forgineer/pandas-liteql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgineer%2Fpandas-liteql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgineer%2Fpandas-liteql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgineer%2Fpandas-liteql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgineer%2Fpandas-liteql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forgineer","download_url":"https://codeload.github.com/forgineer/pandas-liteql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forgineer%2Fpandas-liteql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32883466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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-engineering","pandas","pandas-dataframe","pandas-extension","python","python3","sqlite"],"created_at":"2024-12-22T19:32:02.979Z","updated_at":"2026-05-11T05:37:55.662Z","avatar_url":"https://github.com/forgineer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://forgineer.pythonanywhere.com/static/pandas_liteql/pandas-liteql-feather-logo-large.png\" alt=\"pandas-liteql-logo.png\"\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n---\n\n# What is pandas-liteql?\n**pandas-liteql** is a simple [pandas](https://pandas.pydata.org/) extension that enables users to execute SQL statements against DataFrames using in-memory [SQLite](https://www.sqlite.org/index.html). It is meant to streamline data manipulation and analysis tasks. For more detailed information and examples on **pandas-liteql**, visit the [documentation pages](https://forgineer.pythonanywhere.com/pandas-liteql).\n\n# What pandas-liteql is not\n**pandas-liteql** is not a competitor to libraries such as [PySpark](https://spark.apache.org/docs/latest/api/python/index.html) or [DuckDB](https://duckdb.org/) that can perform SQL queries on larger data sets and perform more advanced data science use-cases. Rather, it is inspired by those projects and similar libraries that have performed the same function, but have since been abandoned or were not as user-friendly.\n\n# Installing pandas-liteql\n**pandas-liteql** requires a minimum of Python 3.7 and the following libraries:\n\n| Library    | Version      |\n|------------|--------------|\n| Pandas     | `\u003e= 1.3.5`   |\n| SQLAlchemy | `\u003e= 1.4.36`  |\n\nAssuming these prerequisites are already installed, adding **pandas-liteql** is as simple as...\n\n```\npip install pandas-liteql\n```\n\n# Examples\nBelow are some usage examples to load, query, and drop data from the in-memory SQLite sessions established with **pandas-liteql** and pandas DataFrame integration.\n\n## Loading\nStart by loading your DataFrame with the `load` function. When **pandas-liteql** is imported, an in-memory SQLite session is created where data can be loaded to.\n\n```python\nimport pandas as pd\nfrom src import pandas_liteql as lql\n\n# Data set creation\nperson_data = {\n    'name': ['Bill', 'Ted', 'Abraham', 'Genghis', 'Napoleon'],\n    'age': [25, 24, 56, 64, 51],\n    'email': ['bill@excellent.com', 'ted@excellent.com',\n              'lincoln@excellent.com', 'khan@excellent.com',\n              'bonaparte@excellent.com']\n}\n\n# DataFrame creation\nperson_df = pd.DataFrame(data=person_data)\n\n# Loading the DataFrame to in-memory SQLite as the 'person' table\n# The 'person' variable is also a LiteQL class containing the table name and schema information\nperson = lql.load(df=person_df, table_name='person')\n\nprint(f'Table name: {person.name}')\nprint(person.schema)\n```\n\nOutput:\n```\nTable name: person\n    name    type  nullable default autoincrement  primary_key\n0  index  BIGINT      True    None          auto            0\n1   name    TEXT      True    None          auto            0\n2    age  BIGINT      True    None          auto            0\n3  email    TEXT      True    None          auto            0\n```\n\n## Querying\nNext, query the table using the `query` function. Using SQL syntax, the loaded table can be queried and the results will be returned as a pandas DataFrame.\n\n```python\nbill_and_ted = lql.query(sql='SELECT * FROM person WHERE age \u003c 30')\n\nprint(bill_and_ted)\n```\n\nOutput:\n```\n   index  name  age               email\n0      0  Bill   25  bill@excellent.com\n1      1   Ted   24   ted@excellent.com\n```\n\n## Dropping\nIf finished with a table within the flow of a script, you can simply drop it with the `drop` function to preserve memory.\n\n```python\nlql.drop(table_name='person')\n```\n\n## The DataFrame SQL Accessor\nLastly, for a more simplistic approach, you can use the `liteql.sql` accessor to perform the same functions above in one line and return the result as a pandas DataFrame. This approach requires that you query from the `liteql` table that is loaded from the DataFrame, queried, and then dropped.\n\n```python\nimport pandas as pd\nimport pandas_liteql as lql\n\n# Data set creation\nperson_data = {\n    'name': ['Bill', 'Ted', 'Abraham', 'Genghis', 'Napoleon'],\n    'age': [25, 24, 56, 64, 51],\n    'email': ['bill@excellent.com', 'ted@excellent.com',\n              'lincoln@excellent.com', 'khan@excellent.com',\n              'bonaparte@excellent.com']\n}\n\n# DataFrame creation\nperson_df = pd.DataFrame(data=person_data)\n\nbill_and_ted = person_df.liteql.sql('SELECT * FROM liteql WHERE age \u003c 30')\n\nprint(bill_and_ted)\n```\n\nOutput:\n```\n   index  name  age               email\n0      0  Bill   25  bill@excellent.com\n1      1   Ted   24   ted@excellent.com\n```\n\n\n# Contributing\nCurrently, **pandas-liteql** will not be receiving any additional updates. Contributions will not be accepted here, but feel free to fork this project if you desire.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforgineer%2Fpandas-liteql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforgineer%2Fpandas-liteql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforgineer%2Fpandas-liteql/lists"}