Skip to main content

A Python driver which implements the X DevAPI, an Application Programming Interface for working with the MySQL Document Store.

Project description

https://img.shields.io/pypi/v/mysql-connector-python.svg https://img.shields.io/pypi/pyversions/mysql-connector-python.svg https://img.shields.io/pypi/l/mysql-connector-python.svg

MySQL Connector/Python contains an implementation of the XDevAPI - An Application Programming Interface for working with the MySQL Document Store.

Installation

The recommended way to install Connector/Python is via pip.

Make sure you have a recent pip version installed on your system. If your system already has pip installed, you might need to update it. Or you can use the standalone pip installer.

$ pip install mysqlx-connector-python

Please refer to the installation tutorial for installation alternatives of the XDevAPI.

Installation Options

Connector packages included in MySQL Connector/Python allow you to install optional dependencies to unleash certain functionalities.

# 3rd party packages to unleash the compression functionality are installed
$ pip install mysqlx-connector-python[compression]

This installation option can be seen as a shortcut to install all the dependencies needed by a particular feature. Mind that this is optional and you are free to install the required dependencies by yourself.

Available options:

  • dns-srv

  • compression

Sample Code

import mysqlx

# Connect to server
session = mysqlx.get_session(
   host="127.0.0.1",
   port=33060,
   user="mike",
   password="s3cr3t!")
schema = session.get_schema("test")

# Use the collection "my_collection"
collection = schema.get_collection("my_collection")

# Specify which document to find with Collection.find()
result = collection.find("name like :param") \
                   .bind("param", "S%") \
                   .limit(1) \
                   .execute()

# Print document
docs = result.fetch_all()
print(r"Name: {0}".format(docs[0]["name"]))

# Close session
session.close()

Additional Resources

Contributing

There are a few ways to contribute to the Connector/Python code. Please refer to the contributing guidelines for additional information.

License

Please refer to the README.txt and LICENSE.txt files, available in this repository, for further details.

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

mysqlx-connector-python-9.1.0.tar.gz (169.2 kB view hashes)

Uploaded Source

Built Distributions

mysqlx_connector_python-9.1.0-py2.py3-none-any.whl (196.0 kB view hashes)

Uploaded Python 2 Python 3

mysqlx_connector_python-9.1.0-cp313-cp313-win_amd64.whl (782.4 kB view hashes)

Uploaded CPython 3.13 Windows x86-64

mysqlx_connector_python-9.1.0-cp313-cp313-manylinux_2_28_x86_64.whl (19.8 MB view hashes)

Uploaded CPython 3.13 manylinux: glibc 2.28+ x86-64

mysqlx_connector_python-9.1.0-cp313-cp313-manylinux_2_28_aarch64.whl (19.6 MB view hashes)

Uploaded CPython 3.13 manylinux: glibc 2.28+ ARM64

mysqlx_connector_python-9.1.0-cp313-cp313-macosx_13_0_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.13 macOS 13.0+ x86-64

mysqlx_connector_python-9.1.0-cp313-cp313-macosx_13_0_arm64.whl (1.6 MB view hashes)

Uploaded CPython 3.13 macOS 13.0+ ARM64

mysqlx_connector_python-9.1.0-cp312-cp312-win_amd64.whl (782.3 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

mysqlx_connector_python-9.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (19.8 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

mysqlx_connector_python-9.1.0-cp312-cp312-manylinux_2_28_aarch64.whl (19.6 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.28+ ARM64

mysqlx_connector_python-9.1.0-cp312-cp312-macosx_13_0_x86_64.whl (1.7 MB view hashes)

Uploaded CPython 3.12 macOS 13.0+ x86-64

mysqlx_connector_python-9.1.0-cp312-cp312-macosx_13_0_arm64.whl (1.6 MB view hashes)

Uploaded CPython 3.12 macOS 13.0+ ARM64

mysqlx_connector_python-9.1.0-cp311-cp311-win_amd64.whl (782.4 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

mysqlx_connector_python-9.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (19.8 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

mysqlx_connector_python-9.1.0-cp311-cp311-manylinux_2_28_aarch64.whl (19.6 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.28+ ARM64

mysqlx_connector_python-9.1.0-cp311-cp311-macosx_13_0_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.11 macOS 13.0+ x86-64

mysqlx_connector_python-9.1.0-cp311-cp311-macosx_13_0_arm64.whl (1.5 MB view hashes)

Uploaded CPython 3.11 macOS 13.0+ ARM64

mysqlx_connector_python-9.1.0-cp310-cp310-win_amd64.whl (791.8 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

mysqlx_connector_python-9.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (19.8 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

mysqlx_connector_python-9.1.0-cp310-cp310-manylinux_2_28_aarch64.whl (19.6 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.28+ ARM64

mysqlx_connector_python-9.1.0-cp310-cp310-macosx_13_0_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.10 macOS 13.0+ x86-64

mysqlx_connector_python-9.1.0-cp310-cp310-macosx_13_0_arm64.whl (1.5 MB view hashes)

Uploaded CPython 3.10 macOS 13.0+ ARM64

mysqlx_connector_python-9.1.0-cp39-cp39-win_amd64.whl (791.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

mysqlx_connector_python-9.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (19.8 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

mysqlx_connector_python-9.1.0-cp39-cp39-manylinux_2_28_aarch64.whl (19.6 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.28+ ARM64

mysqlx_connector_python-9.1.0-cp39-cp39-macosx_13_0_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 3.9 macOS 13.0+ x86-64

mysqlx_connector_python-9.1.0-cp39-cp39-macosx_13_0_arm64.whl (1.5 MB view hashes)

Uploaded CPython 3.9 macOS 13.0+ ARM64

Supported by

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