Skip to main content

Python library for accessing the Digital Twin Web

Project description

DTWeb-python

Python library for accessing the Digital Twin Web

:exclamation: Alpha release :exclamation:
0.0.x denotes an alpha phase release. Anything may change in future releases without notice.

Install

# Create and activate virtual environment (recommended)
python3 -m venv env
source env/bin/activate

# Install with pip
pip install dtweb

To deactivate virtual environment:

deactivate

Usage

import dtweb

dtweb.client.fetch_host_url('<DTID>')

dtweb.client.fetch_dt_doc('<DTID>')

Usage example:

import dtweb

# Fetch and pring hosting URL from DTID of Ilmatar crane
crane_hosturl = dtweb.client.fetch_host_url('http://d-t.fi/konecranes-K16052')
print(crane_hosturl)

# Fetch and pring DT document from DTID of Ilmatar crane
crane_doc = dtweb.client.fetch_dt_doc('http://d-t.fi/konecranes-K16052')
print(crane_doc)

Development instructions

Click to show

OS: Ubuntu 20.04 WSL (Ubuntu 20.04.1 LTS (GNU/Linux 4.4.0-18362-Microsoft x86_64))

Setup new computer

Hint: You can just copy and paste this whole code block to terminal. Dirty but works.

# Clone repository
git clone https://github.com/juusoautiosalo/dtweb-python.git

# Change directory
cd dtweb-python

# Create virtual environment (recommended)
python3 -m venv env

# Activate virtual environment (recommended)
source env/bin/activate

# Install python package builder
pip install build

# Build the dtweb package
python3 -m build

# Uninstall earlier installation (required if earlier install with same/higher version number exists)
pip uninstall dtweb

# Install package (edit version number if needed)
pip install dist/dtweb-0.0.1-py3-none-any.whl

# Show library info (optional)
pip show dtweb

Uploading to TestPyPI

# Install twine
pip install twine

# Upload to test repository (You will need TestPyPI credentials for this)
twine upload --repository testpypi dist/*

Install from TestPyPI

pip install -i https://test.pypi.org/simple/ dtweb

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

dtweb-0.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

dtweb-0.0.1-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file dtweb-0.0.1.tar.gz.

File metadata

  • Download URL: dtweb-0.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

File hashes

Hashes for dtweb-0.0.1.tar.gz
Algorithm Hash digest
SHA256 edb1e278e8b0c976d5cf56c384376c3b823e1d90ace6a2493098a4129269e485
MD5 b7dcf563a4893f303c686ca71051bb2e
BLAKE2b-256 7f59486bb704a690f2c653f45db08d92c175b0504b6156ecc4f6557d50b79d02

See more details on using hashes here.

File details

Details for the file dtweb-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: dtweb-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.8.5

File hashes

Hashes for dtweb-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aac9fc5dde866caedcce7f71ebc3f051f72c47735e35eb946bac52c8c8b07f40
MD5 39380511a6300b69a98df4f092615191
BLAKE2b-256 70c7bd0857ea9b456b73e0daabc92bafd5427e11a279cc319c20514208d96cb3

See more details on using hashes here.

Supported by

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