Table of Contents
- Table of Contents
- Overview
- Features
- Project Structure
- Getting Started
- Roadmap
- Contributing
- License
- Acknowledgments
Overview
dxpq is a simple and intuitive Python library designed to facilitate connection and interaction with PostgreSQL databases. It was created with the goal of providing an efficient way to perform common PostgreSQL operations, such as executing SQL queries, inserting and updating data, and managing transactions.
This library is lightweight and easy to use, allowing developers to quickly connect to the database without the complexity of setting up additional packages. With support for basic SQL commands and transactions, dxpq offers a clear and straightforward interface for working with PostgreSQL.
Ideal for those seeking a minimalist solution focused only on essential database operations, dxpq is perfect for projects that don't require large frameworks or heavy libraries but still need robust communication with PostgreSQL.
Features
-
Database Connection: Easily establish a connection to a PostgreSQL database using a connection string.
-
Cursor Management: Create and manage cursors for executing SQL queries. Fetch all results or a single row, with support for different result formats (e.g., dictionary-style results).
-
SQL Execution: Execute SQL queries and commands with parameters for secure and dynamic query building.
-
Context Manager Support: The library supports context manager functionality, allowing the use of connections and cursors in
withblocks for automatic resource management. -
Cursor Types: Supports different cursor types, such as dictionary-style results, for easier access to columns by name.
-
Clean Resource Management: Automatically close database connections and cursors when done, either through context management or explicit cleanup with
close()and__del__methods.
Project Structure
└── dxpq/
├── README.md
├── dxpq
│ ├── __init__.py
│ ├── connection.py
│ └── cursor.py
├── pyproject.toml
├── requirements-dev.txt
└── requirements.txt
Getting Started
Prerequisites
This project requires the following dependencies:
- Programming Language: Python
- Package Manager: Pip
Installation
Build dxpq from the source and intsall dependencies:
-
Clone the repository:
❯ git clone https://github.com/pedrohsbarbosa99/dxpq
-
Navigate to the project directory:
❯ cd dxpq
-
Install the dependencies: Using https://pypi.org/project/pip:
❯ pip install -r requirements.txt, requirements-dev.txt
Usage
Run the project with:
Using pip:
pip install dxpq
import dxpq
connection = dxpq.Connection("postgresql://postgres:postgres@localhost:5432/postgres")
with connection.cursor() as cursor:
cursor.execute("select 1")
cursor.fetchall()
Testing
Under development
Roadmap
-
Transaction support: Implement support to SQL commands
Contributing
- 💬 Join the Discussions: Share your insights, provide feedback, or ask questions.
- 🐛 Report Issues: Submit bugs found or log feature requests for the
dxpqproject. - 💡 Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your github account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone https://github.com/pedrohsbarbosa99/dxpq
- Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.'
- Push to github: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
License
Dxpq is protected under the MIT License. For more details, refer to the LICENSE file.
Metadata
Release files for dxpq 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dxpq-0.0.7.tar.gz | 5.6 kB | Without provenance | Details for dxpq-0.0.7.tar.gz |
Release files / dxpq-0.0.7.tar.gz
| Download URL | dxpq-0.0.7.tar.gz |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
577d7eef995fcc60d8e90ae5507715108c82bc175b3d1b736395b6adb755dc28
|
|
BLAKE2b-256 checksum How to use checksums |
51dc4f2364b3d2c761214b948334ddaa98d3a1aac4f183a54bc0bcde9eb384da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for dxpq 0.0.7
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.