Name | pitanga JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | Tools for Database Operations in Python |
upload_time | 2024-07-31 02:25:28 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.6 |
license | MIT License Copyright (c) 2024 Cereja Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
database
postgress
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Pitanga
Welcome to Pitanga, the hidden gem of your database operation toolkit in Python! Just like the pitanga fruit, our library is small, vibrant, and packed with value. Pitanga is designed to make your interactions with PostgreSQL databases more efficient, robust, and enjoyable.
## Funcionalidades
Pitanga is loaded with features that will transform the way you handle database operations:
- Efficient Connection: Utilize a connection pool to keep your operations fast and stable.
- Batch Queries: Execute SELECT queries in batches, leveraging multithreading to handle large volumes of data with ease.
- Safe Updates and Deletes: Perform UPDATE and DELETE operations with automatic commit, ensuring data integrity.
- Optimized Record Counting: Count records efficiently, even in complex queries with DISTINCT.
- Robust Error Handling: Integrated mechanisms to capture and handle errors effectively, keeping your system resilient.
## Installation
You can install the Pitanga library directly from GitHub:
```bash
pip install git+https://github.com/cereja-project/pitanga.git
```
## Usage
With Pitanga, your database operations become as easy as enjoying a fresh pitanga. Here's how:
```python
import logging
from pitanga import DatabaseOperations, DataBaseUpdateError, InvalidQueryError
# Basic logging configuration
logging.basicConfig(level=logging.INFO)
# Initialize database operations
db_operations = DatabaseOperations()
# SELECT query
try:
results = db_operations.select("SELECT * FROM my_table", batch_size=100)
for batch in results:
print(batch)
except InvalidQueryError as e:
logging.error(f"Query error: {e}")
except DataBaseUpdateError as e:
logging.error(f"Database update error: {e}")
# UPDATE query
try:
db_operations.update("UPDATE my_table SET column = value WHERE condition")
except InvalidQueryError as e:
logging.error(f"Query error: {e}")
except DataBaseUpdateError as e:
logging.error(f"Database update error: {e}")
# DELETE query
try:
db_operations.delete("DELETE FROM my_table WHERE condition")
except InvalidQueryError as e:
logging.error(f"Query error: {e}")
except DataBaseUpdateError as e:
logging.error(f"Database update error: {e}")
# Close connections
db_operations.close_connection()
```
## Contribution
Pitanga is a community project and we welcome contributions! Feel free to open issues and pull requests on our GitHub repository. Together, we can make Pitanga even sweeter.
## Licença
This project is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": null,
"name": "pitanga",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "Database, Postgress",
"author": null,
"author_email": "Joab Leite <leitejoab@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/4d/72/2585e981eb1e2c4074908d18f42d63580af8c15f30e17ba26a3645de3a6c/pitanga-0.0.1.tar.gz",
"platform": null,
"description": "\n# Pitanga\n\nWelcome to Pitanga, the hidden gem of your database operation toolkit in Python! Just like the pitanga fruit, our library is small, vibrant, and packed with value. Pitanga is designed to make your interactions with PostgreSQL databases more efficient, robust, and enjoyable.\n\n## Funcionalidades\n\nPitanga is loaded with features that will transform the way you handle database operations:\n\n- Efficient Connection: Utilize a connection pool to keep your operations fast and stable.\n- Batch Queries: Execute SELECT queries in batches, leveraging multithreading to handle large volumes of data with ease.\n- Safe Updates and Deletes: Perform UPDATE and DELETE operations with automatic commit, ensuring data integrity.\n- Optimized Record Counting: Count records efficiently, even in complex queries with DISTINCT.\n- Robust Error Handling: Integrated mechanisms to capture and handle errors effectively, keeping your system resilient.\n\n## Installation\n\nYou can install the Pitanga library directly from GitHub:\n\n```bash\npip install git+https://github.com/cereja-project/pitanga.git\n```\n\n## Usage\n\nWith Pitanga, your database operations become as easy as enjoying a fresh pitanga. Here's how:\n\n```python\nimport logging\nfrom pitanga import DatabaseOperations, DataBaseUpdateError, InvalidQueryError\n\n# Basic logging configuration\nlogging.basicConfig(level=logging.INFO)\n\n# Initialize database operations\ndb_operations = DatabaseOperations()\n\n# SELECT query\ntry:\n results = db_operations.select(\"SELECT * FROM my_table\", batch_size=100)\n for batch in results:\n print(batch)\nexcept InvalidQueryError as e:\n logging.error(f\"Query error: {e}\")\nexcept DataBaseUpdateError as e:\n logging.error(f\"Database update error: {e}\")\n\n# UPDATE query\ntry:\n db_operations.update(\"UPDATE my_table SET column = value WHERE condition\")\nexcept InvalidQueryError as e:\n logging.error(f\"Query error: {e}\")\nexcept DataBaseUpdateError as e:\n logging.error(f\"Database update error: {e}\")\n\n# DELETE query\ntry:\n db_operations.delete(\"DELETE FROM my_table WHERE condition\")\nexcept InvalidQueryError as e:\n logging.error(f\"Query error: {e}\")\nexcept DataBaseUpdateError as e:\n logging.error(f\"Database update error: {e}\")\n\n# Close connections\ndb_operations.close_connection()\n```\n\n## Contribution\n\nPitanga is a community project and we welcome contributions! Feel free to open issues and pull requests on our GitHub repository. Together, we can make Pitanga even sweeter.\n\n## Licen\u00e7a\n\nThis project is licensed under the MIT License.\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Cereja Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Tools for Database Operations in Python",
"version": "0.0.1",
"project_urls": {
"Bug Tracker": "https://github.com/cereja-project/pitanga/issues/new/choose",
"Homepage": "https://github.com/cereja-project/pitanga"
},
"split_keywords": [
"database",
" postgress"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fca44b2d3b4018f2151e72821979e992af8259c55e894ba03b279a9ace257db6",
"md5": "d145d2344344171a06d4f5e626166a15",
"sha256": "68a631b18b375daed0cb6daa021f8e96cbca1629c7d0dd9e8a018f2ea1902229"
},
"downloads": -1,
"filename": "pitanga-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d145d2344344171a06d4f5e626166a15",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 7762,
"upload_time": "2024-07-31T02:25:26",
"upload_time_iso_8601": "2024-07-31T02:25:26.635584Z",
"url": "https://files.pythonhosted.org/packages/fc/a4/4b2d3b4018f2151e72821979e992af8259c55e894ba03b279a9ace257db6/pitanga-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4d722585e981eb1e2c4074908d18f42d63580af8c15f30e17ba26a3645de3a6c",
"md5": "798af53fc61055d157bf766963a622c5",
"sha256": "ad991ace50ae9f3b515e1188d33c3993cf66cfb7588ee7ebe78d64de789e8813"
},
"downloads": -1,
"filename": "pitanga-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "798af53fc61055d157bf766963a622c5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7609,
"upload_time": "2024-07-31T02:25:28",
"upload_time_iso_8601": "2024-07-31T02:25:28.593511Z",
"url": "https://files.pythonhosted.org/packages/4d/72/2585e981eb1e2c4074908d18f42d63580af8c15f30e17ba26a3645de3a6c/pitanga-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-31 02:25:28",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cereja-project",
"github_project": "pitanga",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "pitanga"
}