Skip to main content

Jianshou Client APIs

Project description

jianshou-client

Jianshou Client APIs

# Install a virtual environment
pipenv shell

Install the dependencies in setup.py

pipenv install -e .

Installation

pip install jianshou-client

Usage

Import the package

from jianshou import JianshouClient

Create an instance of jianshou-client

from dotenv import load_dotenv
from jianshou import JianshouClient
# Create a `.env` file to load environmental variables
load_dotenv()

# Use the environmental variables or read them from inputs
JIANSHOU_EMAIL = os.environ.get('JIANSHOU_EMAIL') or input("Jianshou email: ")
JIANSHOU_PASSWD = os.environ.get('JIANSHOU_PASSWD') or input("Jianshou password: ")
jianshou_client = JianshouClient(JIANSHOU_EMAIL, JIANSHOU_PASSWD)

Upload an item for sale

item = jianshou_client.upload(name="new item", intro='testing', content="testing")
hashid = item.hashid

Delete an item

hashid = "123456"
item = jianshou_client.delete(hashid)

Update item base info and pay info

hashid = "123456"
updated_item = jianshou_client.update_baseinfo(hashid, new_name="new_item_updated", new_intro="intro_updated")
updated_item = jianshou_client.update_payinfo(hashid, new_price=111, new_stock=111, new_content="hello")

Generate a html snippet to be embeded in base info content or pay info content

# A paragraph of text followed by external links and images.
html_snippet = gen_typical_html_snippet(
	"one paragraph", 
	other_links=["https://www.google.com"],
	image_links=["https://yourdomain.com/path/to/directlink/photo.jpg"]
)

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

jianshou-client-1.0.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

jianshou_client-1.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file jianshou-client-1.0.1.tar.gz.

File metadata

  • Download URL: jianshou-client-1.0.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for jianshou-client-1.0.1.tar.gz
Algorithm Hash digest
SHA256 53c0c1a9c6e9af532de4008a06620aefb72c455516611a3e215e08fcdd58dfa8
MD5 eea3586deb4e7ff7d7cc64020de56251
BLAKE2b-256 a0e64a14a2e4f8c8fb3fe1885bf1db0d97ade6cdcd4071c2a84e3b80d42b7e79

See more details on using hashes here.

File details

Details for the file jianshou_client-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: jianshou_client-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.10

File hashes

Hashes for jianshou_client-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a9d9be7b2b8b182a1f2a42078bd3b40363bdf9962447697a64ab3174865e22b
MD5 de2f36d27a79a292d9d9872929f439d5
BLAKE2b-256 52be06736e3d4d681d7a4726f720a136248de284acbb38dad8b6a81a0fbf9204

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