The official python SDK for LendSmart API v1
Project description
lendsmart_api
python
The official python library for the Lendsmart API v1` in python.
This library is currently in beta.
https://badge.fury.io/py/lendsmart-api.svg
Pre reqs
-
python 3
-
install virtualenv using below command
pip install virtualenv
Activate virtual environment
. ./venv/bin/activate
Installation
pip install lendsmart_api
Usage
You will need the service account private key files to access Lendsmart.
Only a limited set of API is supported.
Client
Create client
Update Document
Building from Source
To build and install this package:
- Clone this repository
cd core_api
virtualenv venv
./setup.py install
Testing individually
Make sure the prereqs
, and building from source
are complete
cd lendsmart_python
. venv/bin/activate
python3 get_documents_test.py
Local testing with lendsmart_api package
Set environment path to your local file path in your python file
import sys
sys.path.append('/home/lendsmart/code/lendsmart/workspace/py_lscommon/core_api/')
remove old package which is in virtual environment
rm -r /venv/lib/python3.8/site-packages/lendsmart_api
Auto tests
Tests live in the tests
directory. When invoking tests, make sure you are
in the root directory of this project. To run the full suite across all
supported python versions, use tox_:
tox
Running tox also runs pylint and coverage reports.
The test suite uses fixtures stored as JSON in test/fixtures
. These files
contain sanitized JSON responses from the API - the file name is the URL called
to produce the response, replacing any slashes with underscores.
Test classes should extend test.base.ClientBaseCase
. This provides them
with self.client
, a LendsmartClient
object that is set up to work with
tests. Importantly, any GET request made by this object will be mocked to
retrieve data from the test fixtures. This includes lazy-loaded objects using
this client (and by extension related models).
When testing against requests other than GET requests, self.mock_post
(and
equivalent methods for other HTTP verbs) can be used in a with
block to
mock out the intended request type.
License
MIT
Author
Lendsmart Inc, USA
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 lendsmart_api-2.14.tar.gz
.
File metadata
- Download URL: lendsmart_api-2.14.tar.gz
- Upload date:
- Size: 36.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7adaf0c95ae988ddbe44c6c7d90501a63934abb44c19ce9e8a56bdc0d545f80 |
|
MD5 | dda2565e4f395a4452d9fc8703ed0175 |
|
BLAKE2b-256 | 0c896dab2f8c89c9663bc6a8c2881d29e939ab9639d2b22ba72a292e162b5de2 |
File details
Details for the file lendsmart_api-2.14-py3-none-any.whl
.
File metadata
- Download URL: lendsmart_api-2.14-py3-none-any.whl
- Upload date:
- Size: 47.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed1484c23c2fec81a6818a12e78c9a10249b2efedb0df7c0ebc4098e06de4d9d |
|
MD5 | 4165b55a0416dbce03a6e36604bd7659 |
|
BLAKE2b-256 | 164201602edde2d545cd6114b788d23ce5812fa88b07d32595e5cd6e76852b95 |