Skip to main content

OAuth1 client for connecting to NetSuite REST APIs and RESTlets

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netsuite_oauth_python-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

netsuite_oauth_python-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file netsuite_oauth_python-1.0.0.tar.gz.

File metadata

  • Download URL: netsuite_oauth_python-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for netsuite_oauth_python-1.0.0.tar.gz
Algorithm Hash digest
SHA256 83a01750c81796535983553449717608de91f2d1e2aaf4f3417790f8b0219f0c
MD5 2f464cb9f0c800cbc776ca611aeae946
BLAKE2b-256 f69166f9556aeacdc5ea571e4a27dd18eb25ed890c1aae7b67731a6a665f4da6

See more details on using hashes here.

File details

Details for the file netsuite_oauth_python-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for netsuite_oauth_python-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b62e1d53bbf637abf52d11e1a1696ee63ddeef09d52c103e5a46ff698ccdcf51
MD5 695bf3a4d385b4e3b8dacc1219446cbd
BLAKE2b-256 0793762e8933190f23a92a0a686d25656d63aa462842f33e187f83f023b23f7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page