OAuth1 client for connecting to NetSuite REST APIs and RESTlets
Project description
netsuite-oauth-python
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+
requestsrequests-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
Disclaimer
This is not an official product of Oracle or NetSuite. Use at your own risk. By using this software, you agree not to:
- Violate any laws.
- Produce any harm to a person or persons.
- Disseminate any personal information that would be meant for harm.
- Spread misinformation.
- Target vulnerable groups.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a01750c81796535983553449717608de91f2d1e2aaf4f3417790f8b0219f0c
|
|
| MD5 |
2f464cb9f0c800cbc776ca611aeae946
|
|
| BLAKE2b-256 |
f69166f9556aeacdc5ea571e4a27dd18eb25ed890c1aae7b67731a6a665f4da6
|
File details
Details for the file netsuite_oauth_python-1.0.0-py3-none-any.whl.
File metadata
- Download URL: netsuite_oauth_python-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b62e1d53bbf637abf52d11e1a1696ee63ddeef09d52c103e5a46ff698ccdcf51
|
|
| MD5 |
695bf3a4d385b4e3b8dacc1219446cbd
|
|
| BLAKE2b-256 |
0793762e8933190f23a92a0a686d25656d63aa462842f33e187f83f023b23f7c
|