Metadata-Version: 2.1
Name: mysqlx-connector-python
Version: 26.7.0
Summary: A Python driver which implements the X DevAPI, an Application Programming Interface for working with the MySQL Document Store.
Author: Oracle and/or its affiliates
Author-email: 
License: GNU GPLv2 (with FOSS License Exception)
Project-URL: Homepage, https://dev.mysql.com/doc/connector-python/en/
Project-URL: Documentation, https://dev.mysql.com/doc/connector-python/en/
Project-URL: Downloads, https://dev.mysql.com/downloads/connector/python/
Project-URL: Release Notes, https://dev.mysql.com/doc/relnotes/connector-python/en/
Project-URL: Source Code, https://github.com/mysql/mysql-connector-python
Project-URL: Bug System, https://bugs.mysql.com/
Project-URL: Slack, https://mysqlcommunity.slack.com/messages/connectors
Project-URL: Forums, https://forums.mysql.com/list.php?50
Project-URL: Blog, https://blogs.oracle.com/mysql/
Keywords: mysql,database,db,connector,driver,xdevapi,nosql,docstore
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Provides-Extra: dns-srv
Requires-Dist: dnspython==2.6.1; extra == "dns-srv"
Provides-Extra: compression
Requires-Dist: lz4==4.4.4; extra == "compression"
Requires-Dist: zstandard==0.23.0; extra == "compression"

MySQL Connector/Python
======================



.. image::
    https://img.shields.io/pypi/v/mysqlx-connector-python.svg
    :target: https://pypi.org/project/mysqlx-connector-python/

.. image::
    https://img.shields.io/pypi/pyversions/mysqlx-connector-python.svg
    :target: https://pypi.org/project/mysqlx-connector-python/

.. image::
    https://img.shields.io/pypi/l/mysqlx-connector-python.svg
    :target: https://pypi.org/project/mysqlx-connector-python/







MySQL Connector/Python contains an implementation of the `X DevAPI <https://dev.mysql.com/doc/x-devapi-userguide/en>`__
- An Application Programming Interface for working with the `MySQL Document Store
<https://dev.mysql.com/doc/refman/en/document-store.html>`__.





Licensing
---------

Please refer to the `README.txt <https://github.com/mysql/mysql-connector-python/blob/trunk/README.txt>`__ and `LICENSE.txt <https://github.com/mysql/mysql-connector-python/blob/trunk/LICENSE.txt>`__
files, available in this repository, for further details.

Contributing
------------

We greatly appreciate feedback from our users, including bug reports and code contributions. Your input helps us improve, and we thank you for any issues you report or code you contribute. Please refer to the `CONTRIBUTING.md <https://github.com/mysql/mysql-connector-python/blob/trunk/CONTRIBUTING.md>`__ document for additional information.

Installation
------------

Connector/Python contains the Classic and X DevAPI connector APIs, which are
installed separately. Any of these can be installed from a binary
or source distribution.

Binaries are distributed in the following package formats:

* `RPM <https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/packaging_and_distributing_software/introduction-to-rpm_packaging-and-distributing-software>`__
* `WHEEL <https://packaging.python.org/en/latest/discussions/package-formats/#what-is-a-wheel>`__

On the other hand, the source code is distributed as a compressed file
from which a wheel package can be built.

The recommended way to install Connector/Python is via `pip <https://pip.pypa.io/>`__,
which relies on WHEEL packages. For such a reason, it is the installation procedure
that is going to be described moving forward.

Please, refer to the official MySQL documentation `Connector/Python Installation
<https://dev.mysql.com/doc/connector-python/en/connector-python-installation.html>`__ to
know more about installing from an RPM, or building and installing a WHEEL package from
a source distribution.

Before installing a package with `pip <https://pip.pypa.io/>`__, it is strongly suggested
to have the most 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 <https://pip.pypa.io/en/latest/installation/>`__.







.. code-block:: bash

    $ pip install mysqlx-connector-python

Please refer to the `installation tutorial <https://dev.mysql.com/doc/dev/connector-python/installation.html>`__
for installation alternatives of the X DevAPI.



Installation Options
++++++++++++++++++++

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







.. code-block:: bash

    # 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
----------------------------

.. code:: python

    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
--------------------


- `MySQL Connector/Python X DevAPI Reference <https://dev.mysql.com/doc/dev/connector-python/>`__
- `MySQL Connector/Python Forum <http://forums.mysql.com/list.php?50>`__
- `MySQL Public Bug Tracker <https://bugs.mysql.com>`__
- `Slack <https://mysqlcommunity.slack.com>`__ (`Sign-up <https://lefred.be/mysql-community-on-slack/>`__ required if you do not have an Oracle account)
- `Stack Overflow <https://stackoverflow.com/questions/tagged/mysql-connector-python>`__
- `Oracle Blogs <https://blogs.oracle.com/search.html?q=connector-python>`__


