Metadata-Version: 2.1
Name: NetSuite-Connector
Version: 0.2.1
Summary: NetSuite Connector
Author-email: Marcos Lopez <merick16@gmail.com>
License: MIT License
        
        Copyright (c) 2023 Marcos Lopez
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/IngMarcosLopez/NetSuite-Connector
Project-URL: Bug Tracker, https://github.com/IngMarcosLopez/NetSuite-Connector/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# NetSuite-Connector

## Installation

Only Restlet support:

    $ pip install NetSuite-Connector
## Get Started
The following examples shows how to use this module.

### RESTlet GET
```python
from NetSuite_Connector.NetSuite import NetSuite
nt = NetSuite(
    account_id=123456,
    consumer_keys=dict(consumer_key="2345678", consumer_secret="3456yhg"),
    token_keys=dict(token_id="wfdbfdsdfg", token_secret="efguhfjoidejhfije"),
)

x = nt.get(
    url="https://xxxx.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=xxxx&deploy=xxxx",
    headers={"Content-Type": "application/json"},
    params={}
)
print(x.__dict__)
# Response <200>
```
### RESTlet PUT - POST
```python
from NetSuite_Connector.NetSuite import NetSuite
nt = NetSuite(
    account_id=123456,
    consumer_keys=dict(consumer_key="2345678", consumer_secret="3456yhg"),
    token_keys=dict(token_id="wfdbfdsdfg", token_secret="efguhfjoidejhfije"),
)
body={"foo":"bar"}
x = nt.post(
    url="https://xxxx.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=xxxx&deploy=xxxx",
    headers={"Content-Type": "application/json"},
    params={},
    body=body
)
print(x.__dict__)
# Response <200>
```
# ODBC Queries

Connector only supports ODBC Driver queries, JDBC is not supported
## Get Started

Before you begin install [ODBC Driver](https://system.netsuite.com/app/help/helpcenter.nl?fid=book_N748613.html).

Note that Support for NetSuite2.com is supported, which means that Only roles that hat not activated 2FA are supported. Also note that role must have permission to SuiteAnalitics.

### ODBC Query

```python
from NetSuite_Connector.ODBC import ODBC

nt = ODBC(
    account_id="*****",
    user_email="*****",
    role_id="*****",
    dsn="*****",
    password="*****"
)
q = nt.query("SELECT * FROM OA_tables")
# <NetSuite_Connector.NetsuiteObject>
print(q.status)
# 200
print(q.response)
#[{"foo":"bar"}]
print(q.data_received)
# SELECT * FROM OA_tables
print(q.columns)
# ["foo"]
```


## TODO

- Add TBA for ODBC connector support
