Skip to main content

netsuite-oauth-python

PyPI version Python versions License: MIT

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

Installation

pip install netsuite-oauth-python

Quick start

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.

# 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

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

Build and publish:

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

Maintainers

@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.

Metadata

Release files for netsuite-oauth-python 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for netsuite-oauth-python 1.0.0
File Size Uploaded
netsuite_oauth_python-1.0.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for netsuite-oauth-python 1.0.0
File Interpreter ABI Platform
netsuite_oauth_python-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / netsuite_oauth_python-1.0.0.tar.gz

Download URL netsuite_oauth_python-1.0.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
83a01750c81796535983553449717608de91f2d1e2aaf4f3417790f8b0219f0c
BLAKE2b-256 checksum
How to use checksums
f69166f9556aeacdc5ea571e4a27dd18eb25ed890c1aae7b67731a6a665f4da6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release files / netsuite_oauth_python-1.0.0-py3-none-any.whl

Download URL netsuite_oauth_python-1.0.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b62e1d53bbf637abf52d11e1a1696ee63ddeef09d52c103e5a46ff698ccdcf51
BLAKE2b-256 checksum
How to use checksums
0793762e8933190f23a92a0a686d25656d63aa462842f33e187f83f023b23f7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.0

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page