Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simonw/sqlite-utils-dateutil
Date utility functions for sqlite-utils
https://github.com/simonw/sqlite-utils-dateutil
Last synced: 27 days ago
JSON representation
Date utility functions for sqlite-utils
- Host: GitHub
- URL: https://github.com/simonw/sqlite-utils-dateutil
- Owner: simonw
- License: apache-2.0
- Created: 2023-07-24T01:29:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-24T02:53:28.000Z (over 1 year ago)
- Last Synced: 2024-05-01T23:17:57.665Z (7 months ago)
- Language: Python
- Size: 6.84 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sqlite-utils-dateutil
[![PyPI](https://img.shields.io/pypi/v/sqlite-utils-dateutil.svg)](https://pypi.org/project/sqlite-utils-dateutil/)
[![Changelog](https://img.shields.io/github/v/release/simonw/sqlite-utils-dateutil?include_prereleases&label=changelog)](https://github.com/simonw/sqlite-utils-dateutil/releases)
[![Tests](https://github.com/simonw/sqlite-utils-dateutil/workflows/Test/badge.svg)](https://github.com/simonw/sqlite-utils-dateutil/actions?query=workflow%3ATest)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/simonw/sqlite-utils-dateutil/blob/main/LICENSE)Date utility functions for [sqlite-utils](https://sqlite-utils.datasette.io/).
## Installation
Install this plugin in the same environment as sqlite-utils.
```bash
sqlite-utils install sqlite-utils-dateutil
```## Usage
This plugin adds a variety of SQL functions for parsing dates. For example:
```bash
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](https://github.com/simonw/datasette-dateutil/blob/main/README.md#usage) 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/activateNow install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest