Metadata-Version: 2.4
Name: netsuite-oauth-python
Version: 1.0.0
Summary: OAuth1 client for connecting to NetSuite REST APIs and RESTlets
Author-email: karthous <karthous@users.noreply.github.com>
Maintainer-email: karthous <karthous@users.noreply.github.com>
License: MIT
Project-URL: Homepage, https://github.com/karthous/netsuite_oauth_python
Project-URL: Repository, https://github.com/karthous/netsuite_oauth_python
Project-URL: Issues, https://github.com/karthous/netsuite_oauth_python/issues
Project-URL: Changelog, https://github.com/karthous/netsuite_oauth_python/releases
Keywords: netsuite,oauth,oauth1,rest,restlet,tba,token-based-authentication
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.25.0
Requires-Dist: requests-oauthlib>=1.3.0
Dynamic: license-file

# netsuite-oauth-python

[![PyPI version](https://img.shields.io/pypi/v/netsuite-oauth-python.svg)](https://pypi.org/project/netsuite-oauth-python/)
[![Python versions](https://img.shields.io/pypi/pyversions/netsuite-oauth-python.svg)](https://pypi.org/project/netsuite-oauth-python/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

OAuth 1.0 (Token-Based Authentication) client for NetSuite REST APIs and RESTlets.

## Installation

```bash
pip install netsuite-oauth-python
```

## Quick start

```python
from netsuite_oauth import NetsuiteOauth

client = NetsuiteOauth(
    url="https://1234567.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=1234&deploy=1",
    consumer_key="YOUR_CONSUMER_KEY",
    consumer_secret="YOUR_CONSUMER_SECRET",
    token_id="YOUR_TOKEN_ID",
    token_secret="YOUR_TOKEN_SECRET",
    account="1234567",
)

response = client.get()
print(response.content)
```

## API

| Method | Description |
|--------|-------------|
| `get(params=None, headers=None, **kwargs)` | Authenticated GET |
| `post(data=None, headers=None, **kwargs)` | Authenticated POST (JSON body) |
| `put(data=None, headers=None, **kwargs)` | Authenticated PUT (JSON body) |
| `patch(data=None, headers=None, **kwargs)` | Authenticated PATCH (JSON body) |
| `delete(headers=None, **kwargs)` | Authenticated DELETE |
| `request(method, data=None, params=None, headers=None, **kwargs)` | Arbitrary HTTP method |

All methods return a `requests.Response` and call `raise_for_status()` on failure.

```python
# POST JSON
response = client.post({"name": "Acme"})

# Custom headers / query params
response = client.get(params={"limit": 10}, headers={"Prefer": "transient"})
```

## Requirements

- Python 3.8+
- `requests`
- `requests-oauthlib`

## Development

```bash
git clone https://github.com/karthous/netsuite_oauth_python.git
cd netsuite_oauth_python
pip install -e .
```

Build and publish:

```bash
pip install build twine
python -m build
twine check dist/*
twine upload dist/*
```

## Maintainers

[@karthous](https://github.com/karthous)

## Disclaimer

This is not an official product of Oracle or NetSuite.
Use at your own risk.
By using this software, you agree **not** to:

1. Violate any laws.
2. Produce any harm to a person or persons.
3. Disseminate any personal information that would be meant for harm.
4. Spread misinformation.
5. Target vulnerable groups.
