simonw / sqlite-utils-dateutil

Date utility functions for sqlite-utils

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sqlite-utils-dateutil

PyPI Changelog Tests License

Date utility functions for sqlite-utils.

Installation

Install this plugin in the same environment as sqlite-utils.

sqlite-utils install sqlite-utils-dateutil

Usage

This plugin adds a variety of SQL functions for parsing dates. For example:

sqlite-utils memory "select dateutil_parse('10 october 2020 3pm')" --table

Output:

dateutil_parse('10 october 2020 3pm')
---------------------------------------
2020-10-10T15:00:00

Consult the datasette-dateutil documentation for a full list of functions.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd sqlite-utils-dateutil
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

About

Date utility functions for sqlite-utils

License:Apache License 2.0


Languages

Language:Python 100.0%