DTWeb-python
Python library for accessing the Digital Twin Web
| ❗ Alpha release ❗ |
|---|
| 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
Metadata
Release files for dtweb 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dtweb-0.0.1.tar.gz | 2.9 kB | Without provenance | Details for dtweb-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dtweb-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for dtweb-0.0.1-py3-none-any.whl |
Total release size: 6.4 kB
Release files / dtweb-0.0.1.tar.gz
| Download URL | dtweb-0.0.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
edb1e278e8b0c976d5cf56c384376c3b823e1d90ace6a2493098a4129269e485
|
|
BLAKE2b-256 checksum How to use checksums |
7f59486bb704a690f2c653f45db08d92c175b0504b6156ecc4f6557d50b79d02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / dtweb-0.0.1-py3-none-any.whl
| Download URL | dtweb-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aac9fc5dde866caedcce7f71ebc3f051f72c47735e35eb946bac52c8c8b07f40
|
|
BLAKE2b-256 checksum How to use checksums |
70c7bd0857ea9b456b73e0daabc92bafd5427e11a279cc319c20514208d96cb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for dtweb 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.