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]
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 V4DBHandler as 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("B05.*")')
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.
$ 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
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.0.0.tar.gz
.
File metadata
- Download URL: pydtk-0.0.0.tar.gz
- Upload date:
- Size: 60.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.2 CPython/3.7.10 Linux/5.4.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f4866c43b7fb4ac3df14b7a991a94f92975d4bb8e7bf9146bf269f378839f8f |
|
MD5 | 45cf9c96e7565c1d9ca17e75182a29c0 |
|
BLAKE2b-256 | f252e94c3df68058dbd5acbfd05b8da7d3f503934261e76582e085afea828a2e |
File details
Details for the file pydtk-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: pydtk-0.0.0-py3-none-any.whl
- Upload date:
- Size: 92.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.2 CPython/3.7.10 Linux/5.4.0-1040-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7c98e26daa8cece918f48d978a635cf356d3ec0589172d69389cde7c58bb896 |
|
MD5 | ef1f205f93a733f2dc04827d0b5adf33 |
|
BLAKE2b-256 | da0f6f7908d6d6954d2cf2b914a1896899688a6cb342c8823297dddfcfdf0001 |