Metadata-Version: 2.4
Name: intersystems_irispython
Version: 5.3.0
Summary: InterSystems IRIS Python SDK Kit
Author: InterSystems Corporation
Author-email: support@intersystems.com
License-Expression: LicenseRef-InterSystems-External-Repository
Project-URL: Homepage, https://www.intersystems.com/
Project-URL: License, https://www.intersystems.com/IERTU/
Project-URL: Documentation, https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=PAGE_python_native
Classifier: Development Status :: 5 - Production/Stable
Classifier: Topic :: Database
Classifier: Topic :: Database :: Front-Ends
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
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 :: Implementation :: CPython
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE-OpenSSL.txt
License-File: LICENSE.txt
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: license-expression
Dynamic: project-url
Dynamic: requires-python
Dynamic: summary

# intersystems-irispython [![PyPI version](https://img.shields.io/pypi/v/intersystems-irispython?logo=pypi)](https://pypi.org/project/intersystems-irispython/)

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install intersystems-irispython.

```bash
pip install intersystems-irispython
```

## Usage

### Native Connections
```python
import iris

# Open a connection to the server
args = {
	'hostname':'127.0.0.1', 
	'port': 1972,
	'namespace':'USER', 
	'username':'username', 
	'password':'password'
}
conn = iris.connect(**args)

# Create an iris object
irispy = iris.createIRIS(conn)

# Create a global array in the USER namespace on the server
irispy.set("myGlobal", "hello world!") 

# Read the value from the database and print it
print(irispy.get("myGlobal"))

# Delete the global array and terminate
irispy.kill("myGlobal") 
conn.close()
```

### Using DB-API

```python

# >>> On a native connection object "conn" <<<

# Create a cursor object
cursor = conn.cursor()

# Prepare and execute a SQL
cursor.execute("SELECT * FROM Sample.Person WHERE ID = 1")

# Fetch next row of a query result set
row = cursor.fetchone()

# Retrieve all column values of a row
values = row[:]
print(values)

# Close the cursor object
cursor.close()
```

More details on how to use DB-API can be found at [Using the Python DB-API](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=BPYNAT_pyapi)

## Documentation

Full documentation is available at [InterSystems Native SDK for Python](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=PAGE_python_native)

## Help

For any issues you can contact [InterSystems Worldwide Response Center (WRC)](https://www.intersystems.com/resources/supporting-your-business-matters-intersystems-worldwide-response-center-wrc/)

## License

This project is licensed under the terms detailed at [https://www.intersystems.com/IERTU/](https://www.intersystems.com/IERTU/).

## Release Notes

#### Version 5.3.0
- Improved performance for fetching data with DB-API through the "read ahead" and "fast select" features. "Read ahead" is enabled by default and "fast select" can be enabled by setting the `featureOptions` connection parameter to `+1`.
- Fixed an issue with string to integer conversions that resulted in a `Data Error` instead of returning `0` for values like `+inf`, `-inf` or `NaN`.
- Fixed an issue with the precision of doubles/decimals while rounding.
- Fixed a typo in the error message for invalid port number.

#### Version 5.2.1
- Fixed an issue where using the default value for the `sharedmemory` parameter would prevent connections to remote hosts with SSL/TLS.
- Fixed an issue that caused a crash with a PEX shared connection.
- Improved error messages for issues with SSL/TLS connections.

#### Version 5.2.0
- Added support for the following to conform with the DB-API specification in [PEP 249](https://peps.python.org/pep-0249/):
  - Exceptions
  - Type Objects and Constructors
- Added support for Common Table Expression (CTE) parsing.
- `executemany()`: Fixed an error that did not allow the field value to be in a list or a tuple for an INSERT/UPDATE of multiple rows in a single column.
- Fixed an issue where executing a SQL statement to insert default values in a table would raise an exception.
- Fixed an issue where output redirection incorrectly displayed the value `None` for an empty string.
 
#### Version 5.1.2
- Updated the `rowcount` attribute to return `-1` if the `Cursor` object is closed.
