Skip to main content

PostgreSQL database management system with a user-friendly interface

Project description

Pypostgres

Python PostgreSQL License

A powerful Python interface for PostgreSQL databases that simplifies database interactions and query management.

Features

  • Simplified PostgreSQL connection management
  • Easy query execution and result handling
  • Support for parameterized queries to prevent SQL injection
  • Transaction management utilities
  • Connection pooling for improved performance
  • Comprehensive error handling and logging

Installation

# Clone the repository
git clone https://github.com/Ayman-aa/pypostgres.git
cd pypostegres

# Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Usage

# Import the main class
from pypostegres import DatabaseManager

# Create a database manager instance
db_manager = DatabaseManager()

# Connect to your database
db_manager.selected_db = "your_database"
db_manager.setup()

# Execute a raw query with parameters
success, results = db_manager.execute_raw_query(
    "SELECT * FROM users WHERE active = %s", 
    [True]
)

# Process results
if success:
    for row in results:
        print(f"User: {row['username']}, Email: {row['email']}")

# Close the connection when done
db_manager.close()

Or alternatively use the CLI:

python3 pypostegres.main

Dependencies

  • Python 3.12+
  • psycopg2-binary 2.9.10+

Documentation

For more detailed documentation, see the docs/ directory or visit our documentation site.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • psycopg2 - PostgreSQL adapter for Python
  • All contributors who have helped this project grow

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

my_py_postgres-0.1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

my_py_postgres-0.1.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file my_py_postgres-0.1.0.tar.gz.

File metadata

  • Download URL: my_py_postgres-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for my_py_postgres-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f82ac58f56bf04f0eb4b421bae34ed4a712ebcce007c9aebf17625ecac0d9058
MD5 667a98e7dcf97ae7c66a747191d76c71
BLAKE2b-256 e794e560f12163dd8a858b197d6b633b2a96cae83ce46e01c52db8a40e7a7410

See more details on using hashes here.

File details

Details for the file my_py_postgres-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: my_py_postgres-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for my_py_postgres-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7062147f0ed8e4dede58b71ee96d6059e8764221435e0fc6c1d371d8d93ffbff
MD5 5f6d20a6e9d9cfbbca3b8b0ea1a13df3
BLAKE2b-256 c066214c244fb652ad7e5fda565325c433dbb23d4df27a65992df3b512e01493

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page