# PandaSQLite
PandaSQLite is a lightweight wrapper library that combines the power of SQLite databases with the ease of use of Python numerical libraries like pandas, numpy, scipy, etc. This library allows you to store and manage data using a modern SQLite database, while still being able to use query results seamlessly in python.
## Why bother with PandaSQLite?
### Features
- Fast and reliable data storage and management.
- Easy to use, with no setup required.
- Designed for use in Jupyter notebooks.
- Easily import data from different file formats.
- Leverage powerful SQL syntax for advanced data manipulation and analysis.
### Advantages
- Fast and reliable data storage and management.
- SQL is a declarative language, which optimizes your queries automatically in a way that imperative languages cannot. SQL will be almost certainly faster than Python scripts that parse data from disk!
- All data stored in a single binary file, keeping your data organized, tidy and much easier to share.
- Materialize intermediate results efficiently to speed up your data analysis.
- Speed up your code automatically using indices.
## Getting Started
### Requirements
PandaSQLite only supports Python 3 and is built on top of the `pandas` and `sqlite3` packages.
### Installation
To start using PandaSQLite, simply install the library using pip:
```
pip install PandaSQLite
```
Once the library is installed, you can start using it in your Python projects or Jupyter notebooks.
### Basic usage
This script defines the most basic usage of the library. The raw data must be imported in the database only once.
```py
from PandaSQLite import PandaSQLiteDB
# Create/open database
db = PandaSQLiteDB("my_database.sql")
# Import raw data -- must only be done once!
# Import example CSV data
db.import_data("my_table", "my_csv.csv", format="csv")
# Execute query with no return value
db.execute("INSERT INTO my_table VALUES (...)")
# Query dataframe with return values
df = db.query("SELECT * FROM my_table")
```
For a more comprehensive showcase of features, check out the examples in the examples directory to get started.
### Documentation
The documentation for PandaSQLite is [available here](https://github.com/MarcelFerrari/PandaSQLite/wiki)
### Common problems
`TypeError: 'NoneType' object is not iterable`:<br>
This issue is usually caused by executing a query with no return data in the `db.query()` function, which should only be used for queries that return a table ("SELECT" queries). Use the `db.execute()` function for queries with no return data (e.g: "INSERT", "UPDATE", "ALTER", ... queries).
<hr>
Raw data
{
"_id": null,
"home_page": "https://github.com/MarcelFerrari/PandaSQLite",
"name": "PandaSQLite",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "Pandas,SQL,Database,Numerical Python,SQLite,Data science,Jupyter notebook",
"author": "Marcel Ferrari",
"author_email": "marcel.mfnc@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/94/f5/ea420bed33af0503b37f8547a058bc7c7d81893b740eec1b749de2d57ee8/PandaSQLite-1.0.post1.tar.gz",
"platform": null,
"description": "\n# PandaSQLite\n\nPandaSQLite is a lightweight wrapper library that combines the power of SQLite databases with the ease of use of Python numerical libraries like pandas, numpy, scipy, etc. This library allows you to store and manage data using a modern SQLite database, while still being able to use query results seamlessly in python.\n\n## Why bother with PandaSQLite?\n\n### Features\n- Fast and reliable data storage and management.\n- Easy to use, with no setup required.\n- Designed for use in Jupyter notebooks.\n- Easily import data from different file formats.\n- Leverage powerful SQL syntax for advanced data manipulation and analysis.\n\n### Advantages\n- Fast and reliable data storage and management.\n- SQL is a declarative language, which optimizes your queries automatically in a way that imperative languages cannot. SQL will be almost certainly faster than Python scripts that parse data from disk!\n- All data stored in a single binary file, keeping your data organized, tidy and much easier to share.\n- Materialize intermediate results efficiently to speed up your data analysis.\n- Speed up your code automatically using indices.\n\n## Getting Started\n### Requirements\nPandaSQLite only supports Python 3 and is built on top of the `pandas` and `sqlite3` packages.\n\n### Installation\n\nTo start using PandaSQLite, simply install the library using pip:\n\n```\npip install PandaSQLite\n```\n\nOnce the library is installed, you can start using it in your Python projects or Jupyter notebooks.\n\n### Basic usage\nThis script defines the most basic usage of the library. The raw data must be imported in the database only once.\n```py\nfrom PandaSQLite import PandaSQLiteDB\n\n# Create/open database\ndb = PandaSQLiteDB(\"my_database.sql\")\n\n# Import raw data -- must only be done once!\n# Import example CSV data\ndb.import_data(\"my_table\", \"my_csv.csv\", format=\"csv\")\n\n# Execute query with no return value\ndb.execute(\"INSERT INTO my_table VALUES (...)\")\n\n# Query dataframe with return values\ndf = db.query(\"SELECT * FROM my_table\")\n```\n\nFor a more comprehensive showcase of features, check out the examples in the examples directory to get started.\n\n### Documentation\nThe documentation for PandaSQLite is [available here](https://github.com/MarcelFerrari/PandaSQLite/wiki)\n\n### Common problems\n`TypeError: 'NoneType' object is not iterable`:<br>\nThis issue is usually caused by executing a query with no return data in the `db.query()` function, which should only be used for queries that return a table (\"SELECT\" queries). Use the `db.execute()` function for queries with no return data (e.g: \"INSERT\", \"UPDATE\", \"ALTER\", ... queries).\n<hr>\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "PandaSQLite is a lightweight library that combines the power of SQLite databases with the ease of use of Python numerical libraries like pandas, numpy, scipy, etc.",
"version": "1.0.post1",
"split_keywords": [
"pandas",
"sql",
"database",
"numerical python",
"sqlite",
"data science",
"jupyter notebook"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "94f5ea420bed33af0503b37f8547a058bc7c7d81893b740eec1b749de2d57ee8",
"md5": "985d21a9d32d21d3fc3616d2f5991c9c",
"sha256": "c535c4d64d3b8302cb1d7b284c1adde995db7d4bf7852aea1818e804545da194"
},
"downloads": -1,
"filename": "PandaSQLite-1.0.post1.tar.gz",
"has_sig": false,
"md5_digest": "985d21a9d32d21d3fc3616d2f5991c9c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 4734,
"upload_time": "2023-02-10T08:44:56",
"upload_time_iso_8601": "2023-02-10T08:44:56.393482Z",
"url": "https://files.pythonhosted.org/packages/94/f5/ea420bed33af0503b37f8547a058bc7c7d81893b740eec1b749de2d57ee8/PandaSQLite-1.0.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-10 08:44:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "MarcelFerrari",
"github_project": "PandaSQLite",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "pandasqlite"
}