Skip to main content

pysqlw

A Python based wrapper (meta-wrapper, even) allowing easy MySQL and SQLite interactions.

Requirements

  • Python 2.7.3 (this is what I test with, should work with most 2.x; 3.x not guaranteed without porting)

  • sqlite3 module (comes with Python installs)

  • Install MySQLdb if you want MySQL support

    • If you’re using a Debian-like distro (Ubuntu, Debian, Crunchbang, etc), install the package python-mysqldb

      • $ sudo apt-get install python-mysqldb

    • There is no pypi package (someone get on this)

    • If that didn’t work, or you’re not using a Debian-like distro:

      • Build and install the MySQLdb module from source.

      • This link explains better than I could.

    • Verify it’s installed: $ python -c 'import MySQLdb'

      • If nothing shows up, you’re good!

      • If you get an ImportError, think, do you really need MySQL?

      • If yes, this is a problem, and I can’t really help. :(

      • If you don’t, just use sqlite, it’s much easier.

Usage

  • Install pysqlw: $ pip install pysqlw

  • Import pysqlw:

    • import pysqlw

  • Create a new instance:

    • p = pysqlw.pysqlw(db_type="sqlite", db_path="/home/user/example.db")

    • If you want to use MySQL you need to supply more details:

    • p = pysqlw.pysqlw(db_type="mysql", db_host="localhost", db_user="username", db_pass="password", db_name="database_name")

    • Alternatively, you can use it with Python’s with statement.

  • Documentation is now on the pysqlw readthedocs entry.

Contributing

If you’re interested, you can write extra meta-wrappers for foreign database types. They’re pretty simple, look at the pysqlw wrappers documentation page for an example.

If there’s not a wrapper for a database type you’d like (that is, an actual wrapper, not just a meta-wrapper), you should make one of those and send in some pull requests with meta-wrappers! More coverage is great.

If you wish to help contribute to the base wrapper functions, feel free to fork the github repo and send in pull requests!

Metadata

Release files for pysqlw 1.3.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 pysqlw 1.3.1
File Size Uploaded Provenance Actions
pysqlw-1.3.1.tar.gz 6.3 kB Without provenance Details for pysqlw-1.3.1.tar.gz

Release files / pysqlw-1.3.1.tar.gz

Download URL pysqlw-1.3.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
98d6a351b205d648fda4534d9ec8ed369ca455d6c36f9e4de1d81a03f1e5a463
BLAKE2b-256 checksum
How to use checksums
827322ac0a4cc7dc4eb13ca9f52d52e76c2a30b337d402ccbc1925397fa498ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pysqlw 1.3.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.

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