A Python wrapper for the KRA eTIMS REST API
Project description
A Python wrapper for the KRA eTIMS REST API. Easily interact with the KRA eTIMS REST API using this library.
Installation
pip install kra-etims
Setup
from kra_etims import API
etimsapi = API(
url="http://localhost:8088",
pin="A123456789Z",
)
Options
Option |
Type |
Required |
Description |
---|---|---|---|
url |
string |
yes |
Your Server URL, example: http://localhost:8088/ |
pin |
string |
yes |
Your PIN |
timeout |
integer |
no |
Connection timeout, default is 5 |
verify_ssl |
bool |
no |
Verify SSL when connect, use this option as False when need to test with self-signed certificates |
user_agent |
string |
no |
Set a custom User-Agent, default is KRA-eTIMS-Python-REST-API/1.0.1 |
Methods
Params |
Type |
Description |
---|---|---|
endpoint |
string |
KRA eTIMS API endpoint, example: customers or order/12 |
data |
dictionary |
Data that will be converted to JSON |
**kwargs |
dictionary |
Accepts params, also other Requests arguments |
POST
.post(endpoint, data, **kwargs)
Response
All methods will return Response object.
Example of returned data:
>>> r = etimsapi.post("/items/selectItems", {
"bhfId":"00",
"lastReqDt":"20160523000000"
})
>>> r.status_code
200
>>> r.headers['content-type']
'application/json; charset=UTF-8'
>>> r.encoding
'UTF-8'
>>> r.text
u'{"resultCd": "000","resultMsg": "Successful","resultDt": "20240816201351","data": {"itemList": [{"tin": "P052350422M",...' // Json text
>>> r.json()
{u'resultCd': u'000',u'resultMsg': u'Successful',u'resultDt': u'20240816201351',u'data': {u'itemList': [{u'tin': u'P052350422M',... // Dictionary data
Changelog
See CHANGELOG.md.
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
File details
Details for the file kra_etims-1.0.1.tar.gz
.
File metadata
- Download URL: kra_etims-1.0.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 027b18f0b8cdb97e077ecb4a953dd08fc04a75c36666d2d4d59d544c612347fe |
|
MD5 | 20fee56a6f95b819d3a3b883aa2df918 |
|
BLAKE2b-256 | 4bad0efb1b57226e1e69fe32e17bca2ee62e88d6df504b8f4539cb78656fadcf |
File details
Details for the file kra_etims-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: kra_etims-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 701a13029ea30394779275e543486346e2fe9d4d6c46a4ca823e9e7f095ad3d7 |
|
MD5 | b861b65f1996680a3160449caa60b7c2 |
|
BLAKE2b-256 | dbadbe162566b358baa26b92f77c1e29a8f44b98c2028d025eeaeed0e570e07d |