Metadata-Version: 2.4
Name: msql-driver
Version: 0.10.0
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
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: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Rust
Classifier: Topic :: Database
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Classifier: Topic :: Software Development
Classifier: Typing :: Typed
Requires-Dist: numpy~=2.2 ; extra == 'numpy'
Requires-Dist: pandas~=2.3 ; extra == 'pandas'
Requires-Dist: streamlit~=1.54 ; extra == 'streamlit'
Requires-Dist: typing-extensions~=4.15 ; extra == 'streamlit'
Requires-Dist: msql-driver[numpy,pandas] ; extra == 'convert'
Requires-Dist: msql-driver[numpy,pandas,streamlit] ; extra == 'all'
Provides-Extra: numpy
Provides-Extra: pandas
Provides-Extra: streamlit
Provides-Extra: convert
Provides-Extra: all
License-File: LICENSE.txt
Summary: Mireo SpaceTime MSQL connector
Keywords: mireo,spacetime,msql,connector,sql,query,spatiotemporal,database
Author: Mireo
Maintainer-email: Zvonimir Jurelinac <zvonimir.jurelinac@mireo.com>
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://www.mireo.com/spacetime
Project-URL: MSQL Reference, https://spacetime.mireo.com/msql/
Project-URL: SpaceTime Live Demo, https://spacetime.mireo.com/

# Mireo SpaceTime MSQL connector

**msql-driver** is a Python module for querying a [Mireo SpaceTime database](https://www.mireo.com/spacetime) using the [MSQL query language](https://spacetime.mireo.com/msql/).

## Features

- Both **blocking** and **asynchronous** modes of operation.
- Query results are convertible to **Python lists**, **NumPy arrays**, and **Pandas dataframes**.
- **Streamlit** integration with support for **asynchronous** querying.
- **Type stubs** included — full IDE autocompletion and type checking.
- Requires **CPython 3.10+**.
- Available for **Linux** (**glibc** 2.17+ and **musl** 1.2+; x86-64 and arm64), **Windows** (x86-64 and arm64), and **macOS** (10.12+ x86-64 and 11.0+ arm64).

## Installation

```
pip install -U msql-driver
```

Conversions to NumPy or Pandas data types require optional dependencies:
```
pip install -U msql-driver[numpy]
pip install -U msql-driver[pandas]
```

Install optional dependencies for all available conversions:
```
pip install -U msql-driver[convert]
```

Streamlit integration requires an optional dependency:
```
pip install -U msql-driver[streamlit]
```

Install all optional dependencies using:
```
pip install -U msql-driver[all]
```

## Example

```python
import msql_driver

# Connect
session = msql_driver.SessionConfig().host(<address>).user(<org>, <user>, <password>).build()
print(session.status())  # SessionStatus.Connected

# Run a query (returns one Rows object per result set)
res, = session.run_query("select * from st.segment limit 10")

# Print column names, MSQL data types, and nullability
print(res.row_type.columns)

# Iterating over rows lazily converts each to a tuple of native Python types
for row in res:
    print(row)

# Or convert the whole result at once:
rows = res.to_list()    # list of tuples of native Python types
arr = res.to_numpy()    # NumPy array (requires numpy)
df = res.to_pandas()    # Pandas dataframe (requires pandas)

# Cancellable query execution
result, cancel = session.submit_query("select * from st.segment")
# ... cancel.cancel() to abort
res_list = result.try_get()  # non-blocking, returns None if not ready
res_list = result.get()      # blocks until ready

# Disconnect
session.stop()
print(session.status())  # SessionStatus.Stopped
```

## License
Licensed under [BSD 3-Clause "New" or "Revised" License](https://choosealicense.com/licenses/bsd-3-clause/).

## Credits
Authored and maintained by [Mireo](https://www.mireo.com).

