Skip to content

rcbop/python-timeseries-exercise

Repository files navigation

Timeseries

This is an coding practice repository for a timeseries API using python, angular, mqtt and MongoDB.

Tests   codecov  CodeQL  FOSSA Status

Requirements

Development

Run all tests with docker compose:

make test

Spin up development environment:

make compose-up

Query String Filters

API endpoint with query string filters deep-object like:

?timestamp[gte]=2021-01-01T00:00:00&timestamp[lte]=2021-01-05T00:00:00&metadata.area=kitchen&limit=100"

will become mongo query:

{
    "timestamp": { $gte: ISODate("2021-01-01T00:00:00"), $lte: ISODate("2021-01-05T00:00:00") },
    "metadata": { "area": "kitchen" },
    "limit": 100
}

CI

Used github actions to define CI pipelines:

workflows

Preview

Default endpoint result:

Limits to 100 results:

query-result

Angular Custom Dashboard:

dashboard

Plotly Dashboard:

plotly-dashboard

Filtering by query string example:

using-query-string-filters

Dependencies

FOSSA Status

TODO

  • API pagination offset (done)
  • Pyparsing query validation (done)
  • check usage of mongo engine ORM with timeseries collection
  • kube-linter does not support kustomize, pre-render manifests before running linter
  • add UI tests (cypress)
  • increase test coverage (done)
  • instrumentation, tracing, metrics and monitoring
  • terraform deployment

About

exercise using mongodb timeseries collection

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published