Metadata-Version: 2.4
Name: msql-driver
Version: 0.9.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 [Mireo SpaceTime database](https://www.mireo.com/spacetime) using [MSQL query language](https://spacetime.mireo.com/msql/).

## Features

- Both **blocking** and **asynchronous** modes of operation are available.
- Query results are convertible to **Python lists**, **NumPy arrays** and **Pandas dataframes**.
- **Streamlit** integration with support for **asynchronous** querying available.
- 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 available with optional dependency:
```
pip install -U msql-driver[streamlit]
```

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

## Example

```
import msql_driver

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

# Run query
res, = session.run_query("select * from st.segment limit 10")

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

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

# Query result can be converted to:
rows = res.to_list()  # Python list of appropriate Python data types
arr = res.to_numpy()  # NumPy array of appropriate NumPy data types (requires numpy)
df = res.to_pandas()  # Pandas dataframe of appropriate NumPy/Pandas data types (requires pandas)

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

