datasette-sqlite-dateutil 0.1a0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ from datasette import hookimpl
2
+ import sqlite_dateutil
3
+
4
+ __version__ = "0.1a0"
5
+
6
+
7
+ @hookimpl
8
+ def prepare_connection(conn):
9
+ sqlite_dateutil.load(conn)
@@ -0,0 +1,44 @@
1
+ Metadata-Version: 2.4
2
+ Name: datasette-sqlite-dateutil
3
+ Version: 0.1a0
4
+ Summary: Datasette plugin that loads the sqlite-dateutil SQLite extension
5
+ Author: Simon Willison
6
+ License-Expression: Apache-2.0
7
+ Requires-Python: >=3.11
8
+ Project-URL: Homepage, https://github.com/simonw/sqlite-dateutil
9
+ Project-URL: Issues, https://github.com/simonw/sqlite-dateutil/issues
10
+ Project-URL: Changelog, https://github.com/simonw/sqlite-dateutil/releases
11
+ Project-URL: CI, https://github.com/simonw/sqlite-dateutil/actions
12
+ Requires-Dist: datasette
13
+ Requires-Dist: sqlite-dateutil==0.1a0
14
+ Description-Content-Type: text/markdown
15
+
16
+ # datasette-sqlite-dateutil
17
+
18
+ Datasette plugin that loads the sqlite-dateutil SQLite extension. [sqlite-dateutil](https://github.com/simonw/sqlite-dateutil) is a C port of [python-dateutil](https://github.com/dateutil/dateutil)'s `parser.parse()`, about 38x faster than calling dateutil from Python.
19
+
20
+ ## Installation
21
+
22
+ ```bash
23
+ datasette install datasette-sqlite-dateutil
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ Once installed, the functions are available in every SQL query, for example:
29
+
30
+ ```sql
31
+ select dateutil_parse('Thu, 25 Sep 2003 10:49:41 -0300');
32
+ -- 2003-09-25T10:49:41-03:00
33
+ ```
34
+
35
+ Each function returns an ISO 8601 string, or `NULL` where dateutil would raise an exception:
36
+
37
+ | SQL function | Python equivalent |
38
+ | --- | --- |
39
+ | `dateutil_parse(text)` | `parse(text).isoformat()` |
40
+ | `dateutil_parse_fuzzy(text)` | `parse(text, fuzzy=True).isoformat()` |
41
+ | `dateutil_parse_dayfirst(text)` | `parse(text, dayfirst=True).isoformat()` |
42
+ | `dateutil_parse_fuzzy_dayfirst(text)` | `parse(text, fuzzy=True, dayfirst=True).isoformat()` |
43
+
44
+ See the [sqlite-dateutil documentation](https://github.com/simonw/sqlite-dateutil) for details and the known differences from dateutil.
@@ -0,0 +1,5 @@
1
+ datasette_sqlite_dateutil/__init__.py,sha256=MrypoXgsGM_ObVR2M7eFM8T_F3y2U-_Y8wJyVV-fRCM,150
2
+ datasette_sqlite_dateutil-0.1a0.dist-info/METADATA,sha256=76vNG3mm0mw0B5VtLjnstv9T9cGifmtB-c2TZJMRluc,1749
3
+ datasette_sqlite_dateutil-0.1a0.dist-info/WHEEL,sha256=8K9zzzCZkiOKg1UAZcHRzAjvM9pLKf0diGzeZ7lbRqM,108
4
+ datasette_sqlite_dateutil-0.1a0.dist-info/entry_points.txt,sha256=56XXwT9gW-DaRYqUjDxgwH4AM0VcMjttPIqZDq4yIrU,56
5
+ datasette_sqlite_dateutil-0.1a0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: sqlite-dateutil tools/build_wheels.py
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [datasette]
2
+ sqlite_dateutil = datasette_sqlite_dateutil