A Python toolkit for managing, retrieving and processing data.
Project description
Python Dataware Toolkit
A Python toolkit for managing, retrieving, and processing data.
Installation
You can install the toolkit with:
$ pip3 install pydtk
If you want to install the toolkit with extra feature (e.g. support for PointCloud and ROS), you can install it with extra dependencies as follows:
$ pip3 install pydtk[pointcloud,ros]
Some PyDTK models require additional packages.
Please refer the following table and install them manually with command pip install ...
.
PyDTK model | Required packages |
---|---|
pointcloud.PCDModel | pypcd (https://github.com/klintan/pypcd.git) |
Usage
By using Pydtk, you can load a variety of types of data with a unified interface as shown below.
- Load DBHandler for retrieving metadata
from pydtk.db import DBHandler
# Initialize handler (This will read all the metadata from DB on initialization)
handler = DBHandler(
db_class='meta',
db_host='./examples/example_db',
base_dir_path='./test'
)
- Read metadata from db with data selection.
# Select by timestamp
handler.read(pql='start_timestamp > 1420000000 and end_timestamp < 1500000000')
print(handler.data)
# Select by record-id
handler.read(pql='record_id == regex("test.*")')
print(handler.data)
- Load data from files based on metadata.
from pydtk.io import BaseFileReader, NoModelMatchedError
reader = BaseFileReader()
try:
for sample in handler:
print('loading content "{0}" from file "{1}"'.format(sample['contents'], sample['path']))
try:
timestamps, data, columns = reader.read(sample)
assert print(data)
except NoModelMatchedError as e:
print(str(e))
continue
except EOFError:
pass
Documentation
For more information about this toolkit, please refer the document.
Setup for contribution
To improve this toolkit, firstly clone this repository and then run the following command to prepare the environment.
$ git clone git@github.com:dataware-tools/pydtk.git --recurse-submodules
$ poetry install
Make sure that poetry is installed before executing the command.
If you want to install the toolkit with extra feature (e.g. support for ROS),
please specify it with -E
option.
Example (installation with pointcloud
and ros
extras):
$ poetry install -E pointcloud -E ros
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 pydtk-0.1.4.tar.gz
.
File metadata
- Download URL: pydtk-0.1.4.tar.gz
- Upload date:
- Size: 91.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.2 CPython/3.7.11 Linux/5.4.0-1051-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9166559b34a69b73a2e231e6f614d3d913f75db4d68539a9feb5e35f5a687813 |
|
MD5 | e39b9cfc3ee515d3a8b8e832aebcdc50 |
|
BLAKE2b-256 | 7a2a0a3403bc402541a508709195bacd4fda5db33912aed6f3be36e2b0242e78 |
File details
Details for the file pydtk-0.1.4-py3-none-any.whl
.
File metadata
- Download URL: pydtk-0.1.4-py3-none-any.whl
- Upload date:
- Size: 128.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.2 CPython/3.7.11 Linux/5.4.0-1051-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38c30fc4de9576860413084c78e2aaa202c9d25e89883e6a0c2c5e2994439ee8 |
|
MD5 | b3efd6cc5b861666290c4c4010e976ff |
|
BLAKE2b-256 | c7046a42fa7e78845238b0f856ec83403f9465f61c4ae4a6bb1318493e527873 |