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 git+https://github.com/dataware-tools/pydtk.git

If you want to install the toolkit with extra feature (e.g. support for MongoDB and ROS), you can install extra dependencies as follows:

$ pip3 install git+https://github.com/dataware-tools/pydtk.git#egg=pydtk[mongodb,ros]

Some PyDTK models require additional packages.
Please refer the following table and install them manually with command pip install ....

PyDTK model Required packages
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 MongoDB), please specify it with -E option.
Example (installation with mongodb and ros extras):

$ poetry install -E mongodb -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.1.tar.gz (89.2 kB view details)

Uploaded Source

Built Distribution

pydtk-0.1.1-py3-none-any.whl (126.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pydtk-0.1.1.tar.gz
  • Upload date:
  • Size: 89.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.2 CPython/3.7.10 Linux/5.4.0-1049-azure

File hashes

Hashes for pydtk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 56f869340298141a412dc3b9b2781bd71f9203ec2bec2aae5891f21ab13fa0a6
MD5 5c35df51563a4bb8bff2ac83fd429b82
BLAKE2b-256 7daf8a5b1ee61ccbd2b67410d3585d29471ebed964dcc68f22bc2ae15d41ee77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydtk-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 126.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.2 CPython/3.7.10 Linux/5.4.0-1049-azure

File hashes

Hashes for pydtk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e9a56f9ee347d056b28ba60fe7b3eea93caa09ab49209be489dd53b19c9fdb1
MD5 6af8ece4699d0ec37bbb361bee6b855c
BLAKE2b-256 fe6b27998fdd2de436da04bbdbb0822d9cb7658e2e1025c407811e3ecbe1999a

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