Skip to main content

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:

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:

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.

Metadata

Release files for pitanga 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pitanga 0.0.1
File Size Uploaded Provenance Actions
pitanga-0.0.1.tar.gz 7.6 kB Without provenance Details for pitanga-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pitanga 0.0.1
File Interpreter ABI Platform Actions
pitanga-0.0.1-py3-none-any.whl Python 3 none any Details for pitanga-0.0.1-py3-none-any.whl

Total release size: 15.4 kB

Release files / pitanga-0.0.1.tar.gz

Download URL pitanga-0.0.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ad991ace50ae9f3b515e1188d33c3993cf66cfb7588ee7ebe78d64de789e8813
BLAKE2b-256 checksum
How to use checksums
4d722585e981eb1e2c4074908d18f42d63580af8c15f30e17ba26a3645de3a6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / pitanga-0.0.1-py3-none-any.whl

Download URL pitanga-0.0.1-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68a631b18b375daed0cb6daa021f8e96cbca1629c7d0dd9e8a018f2ea1902229
BLAKE2b-256 checksum
How to use checksums
fca44b2d3b4018f2151e72821979e992af8259c55e894ba03b279a9ace257db6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for pitanga 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page