Skip to main content

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.

  1. 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'
)
  1. 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)
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydtk-0.1.3.tar.gz (90.0 kB view details)

Uploaded Source

Built Distribution

pydtk-0.1.3-py3-none-any.whl (127.7 kB view details)

Uploaded Python 3

File details

Details for the file pydtk-0.1.3.tar.gz.

File metadata

  • Download URL: pydtk-0.1.3.tar.gz
  • Upload date:
  • Size: 90.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

Hashes for pydtk-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3a2876d7ff3b73b2d6d3a7186c0435642ab467f8c6bef5611e707711162a1d93
MD5 d9a4c525a61b3a7fe8b7af18105580b2
BLAKE2b-256 33621ce0e5c077246a8a267579f5810c08a49c1bf70852182adfe1a9852f4b2b

See more details on using hashes here.

File details

Details for the file pydtk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pydtk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 127.7 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

Hashes for pydtk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f7e31873cd584627bb0f0248dbb356be589209d0037ec0bba70254eb3ab94163
MD5 a737ba19ce17c3fa69a8bc6250de7250
BLAKE2b-256 5832fbf9ec3f3366533603850d7d3a60c4a7170a6b300623f1650fcae6de6fe7

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