Wykres commitów

219 Commity (f4c0830529a9513a83437a9e1550bbe27ebc5c64)

Autor SHA1 Wiadomość Data
Simon Willison 57a71377c9
Releasing Datasette 0.25 2018-09-19 19:48:12 +02:00
Jay Graves 1bcd54a834 Fix small doc typo - thanks @jaywgraves (#365) 2018-09-19 18:15:42 +01:00
Simon Willison 1f54e09230
Better docs for publish_subcommand() plugin hook 2018-08-28 11:59:50 +01:00
Simon Willison b7c6a9f9bd
extra_css_urls(template, database, table, datasette)
The extra_css_urls and extra_js_urls hooks now take additional optional
parameters.

Also refactored them out of the Datasette class and into RenderMixin.

Plus improved plugin documentation to explicitly list parameters.
2018-08-28 11:56:57 +01:00
Simon Willison 2e836f72d9
render_cell(value, column, table, database, datasette)
The render_cell plugin hook previously was only passed value.

It is now passed (value, column, table, database, datasette).
2018-08-28 03:03:01 -07:00
Simon Willison 9e1fca4b01
Corrected indentation in metadata.rst 2018-08-28 02:56:34 -07:00
Simon Willison 5cf0c6c91c
New plugin hook: extra_body_script 2018-08-28 02:02:49 -07:00
Simon Willison 0a14a4846b
Added plugin_config() method 2018-08-28 01:35:21 -07:00
Simon Willison 7d0299edd4
fts_table and fts_pk metadata configs, available for both tables and views 2018-08-05 17:44:47 -07:00
Simon Willison 5629aaca67
sortable_columns also now works with views 2018-08-05 17:29:23 -07:00
Simon Willison 4ac9132240
render_cell(value) plugin hook, closes #352
New plugin hook for customizing the way cells values are rendered in HTML.

The first full example of this hook in use is https://github.com/simonw/datasette-json-html
2018-08-04 17:14:56 -07:00
Simon Willison 788a542d3c
Docs for IndexView, TableView, RowView, closes #299
Also removed xfail from test_view_classes_are_documented, so any future *View
classes that are added without documentation will cause the tests to fail.
2018-07-27 21:21:42 -07:00
Simon Willison 8da6b0d542
Added labels so unit tests can detect docs, refs #299 2018-07-27 20:26:18 -07:00
Simon Willison dbbe707841
publish_subcommand hook + default plugins mechanism, used for publish heroku/now (#349)
This change introduces a new plugin hook, publish_subcommand, which can be
used to implement new subcommands for the "datasette publish" command family.

I've used this new hook to refactor out the "publish now" and "publish heroku"
implementations into separate modules. I've also added unit tests for these
two publishers, mocking the subprocess.call and subprocess.check_output
functions.

As part of this, I introduced a mechanism for loading default plugins. These
are defined in the new "default_plugins" list inside datasette/app.py

Closes #217 (Plugin support for datasette publish)
Closes #348 (Unit tests for "datasette publish")
Refs #14, #59, #102, #103, #146, #236, #347
2018-07-25 22:15:59 -07:00
Simon Willison bd1db56936
'Usage: datasette', not 'Usage: cli' - refs #336 2018-07-24 09:03:07 -07:00
Simon Willison 74ad3ff4af
Ensure --help examples in docs are always up to date, closes #336
Unit tests now check that docs/*.txt help examples are all up-to-date.

I ran into a problem here in that the terminal_width needed to be more
accurately defined - so I replaced update-docs-help.sh with update-docs-
help.py which hard-codes the terminal width.
2018-07-24 09:01:23 -07:00
Simon Willison 28872a1fa7
Release notes for 0.24 release 2018-07-23 21:34:38 -07:00
Simon Willison 700d83d8ad
?_json_infinity=1 for handling Infinity/-Infinity - fixes #332 2018-07-23 20:07:57 -07:00
Simon Willison f24b49a1a8
New force_https_urls option, refs #333 2018-07-23 08:58:29 -07:00
Simon Willison 6e37f091ed
Support title/description for canned queries, closes #342
Demo here: https://latest.datasette.io/fixtures/neighborhood_search
2018-07-15 19:33:30 -07:00
Russ Garrett 58fec99ab0 Allow app names for `datasette publish heroku`
Lets you supply the `-n` parameter for Heroku deploys, which also lets
you update existing Heroku deployments.
2018-07-14 07:04:42 -07:00
Simon Willison aec3ae5323
Docs for datasette publish and package, closes #337
Also introduced a new mechanism for ensuring the --help examples in the
documentation reflect the current output of the --help commands, via a new
update-docs-help.sh script. Closes #336
2018-07-10 19:05:46 -07:00
Simon Willison 9281a4a804
New tagline: 'A tool for exploring and publishing data' 2018-07-10 19:05:41 -07:00
Simon Willison fc9b1cc136
New truncate_cells_html config for truncating cells, closes #330 2018-07-10 09:20:41 -07:00
Simon Willison 6df6f712b3
Release notes for 0.23.2 2018-07-07 22:28:45 -07:00
Simon Willison 29bd606514
Documentation typo 2018-06-28 00:09:03 -05:00
Simon Willison 7d9bcdd307
Documentation tweaks 2018-06-28 00:07:53 -05:00
Simon Willison ad66c0da2b
Installation instructions, including docker image - closes #328 2018-06-27 22:59:58 -05:00
Simon Willison dea86b9fba
Changelog for 0.23.1 2018-06-21 08:37:13 -07:00
Simon Willison 3683a6b626
Docs + example of canned SQL query using || concatenation
Closes #321
2018-06-20 21:54:36 -07:00
Simon Willison e04f5b0d34
Release notes for 0.23 2018-06-18 08:11:57 -07:00
Simon Willison 04c896160a
Renamed 'stream all records' to 'stream all rows', refs #266 2018-06-18 07:25:44 -07:00
Simon Willison bb4a9fbf36
Docs for CSV export, refs #266 2018-06-18 07:12:21 -07:00
Simon Willison fc3660cfad
Streaming mode for downloading all rows as a CSV (#315)
* table.csv?_stream=1 to download all rows - refs #266

This option causes Datasette to serve ALL rows in the table, by internally
following the _next= pagination links and serving everything out as a stream.

Also added new config option, allow_csv_stream, which can be used to disable
this feature.

* New config option max_csv_mb limiting size of CSV export
2018-06-17 20:21:02 -07:00
Simon Willison ed631e690b
?_labels= and ?_label=COL to expand foreign keys in JSON/CSV
These new querystring arguments can be used to request expanded foreign keys
in both JSON and CSV formats.

?_labels=on turns on expansions for ALL foreign key columns

?_label=COLUMN1&_label=COLUMN2 can be used to pick specific columns to expand

e.g. `Street_Tree_List.json?_label=qSpecies&_label=qLegalStatus`

    {
        "rowid": 233,
        "TreeID": 121240,
        "qLegalStatus": {
            "value" 2,
            "label": "Private"
        }
        "qSpecies": {
            "value": 16,
            "label": "Sycamore"
        }
        "qAddress": "91 Commonwealth Ave",
        ...
    }

The labels option also works for the HTML and CSV views.

HTML defaults to `?_labels=on`, so if you pass `?_labels=off` you can disable
foreign key expansion entirely - or you can use `?_label=COLUMN` to request
just specific columns.

If you expand labels on CSV you get additional columns in the output:

`/Street_Tree_List.csv?_label=qLegalStatus`

    rowid,TreeID,qLegalStatus,qLegalStatus_label...
    1,141565,1,Permitted Site...
    2,232565,2,Undocumented...

I also refactored the existing foreign key expansion code.

Closes #233. Refs #266.
2018-06-16 15:18:57 -07:00
Simon Willison b252bdb740
Documented how to set multiple --config at once 2018-06-04 18:45:47 -07:00
Simon Willison 29edbe90ff
New cache_size_kb config for SQLite, closes #304 2018-06-04 09:02:07 -07:00
Simon Willison 16398641d9
SQL syntax highlighting in docs 2018-05-31 06:17:53 -07:00
Simon Willison d69ebce533
Fixed broken :ref: 2018-05-29 20:11:24 -07:00
Simon Willison 27eff1809c
Expanded SpatiaLite docs to cover GeoJSON plus lat-lon spatial indexes 2018-05-29 19:32:30 -07:00
Simon Willison 76d11eb768
New ?_json=colname argument for returning unescaped JSON
Also extracted docs for special JSON arguments into a new section.

Closes #31
2018-05-28 11:08:39 -07:00
Simon Willison c972d79b5a
Added docs on Importing shapefiles into SpatiaLite 2018-05-26 18:39:26 -07:00
Simon Willison 7944a8b0de
Added num_sql_threads config option, closes #285 2018-05-26 17:43:22 -07:00
Simon Willison 276913b748
?_shape=arrayfirst, closes #287 2018-05-26 17:32:15 -07:00
Simon Willison b463f60158
?_ttl= parameter and default_cache_ttl config
Refs #285, Closes #289
2018-05-26 15:17:33 -07:00
Simon Willison 08029a2f8f
Hyperlink to www.srihash.org 2018-05-26 12:46:24 -07:00
Simon Willison df71e8cea8
Fixed documentation typo 2018-05-26 11:04:43 -07:00
Simon Willison 37f8361c6f
Initial documentation on using SpatiaLite
https://datasette.readthedocs.io/en/latest/spatialite.html
2018-05-26 11:04:09 -07:00
Simon Willison f722b0a730
allow_sql config option to disable custom SQL, closes #284 2018-05-24 22:50:50 -07:00
Simon Willison 50920cfe3d
allow_facet, allow_download, suggest_facets boolean --config
Refs #284
2018-05-24 18:12:27 -07:00
Simon Willison 5d62527882
0.22.1 bugfix release 2018-05-23 07:00:01 -07:00
Simon Willison d59366d36e
Link to /-/plugins example 2018-05-20 21:07:26 -07:00
Simon Willison 558d9d7bfe
Datasette 0.22: Datasette Facets 2018-05-20 16:41:47 -07:00
Simon Willison 0b8e5981a3
Typo fix 2018-05-20 14:30:48 -07:00
Simon Willison bd3353a31f
Added docs for introspection endpoints
https://datasette.readthedocs.io/en/latest/introspection.html
2018-05-20 14:28:53 -07:00
Simon Willison f6183ff5fa
Renamed --limit to --config, added --help-config, closes #274
Removed the --page_size= argument to datasette serve in favour of:

    datasette serve --config default_page_size:50 mydb.db

Added new help section:

    $ datasette --help-config
    Config options:
      default_page_size            Default page size for the table view
                                   (default=100)
      max_returned_rows            Maximum rows that can be returned from a table
                                   or custom query (default=1000)
      sql_time_limit_ms            Time limit for a SQL query in milliseconds
                                   (default=1000)
      default_facet_size           Number of values to return for requested facets
                                   (default=30)
      facet_time_limit_ms          Time limit for calculating a requested facet
                                   (default=200)
      facet_suggest_time_limit_ms  Time limit for calculating a suggested facet
                                   (default=50)
2018-05-20 10:01:49 -07:00
Simon Willison 2c2e67b9bb
Updated default facet limits in docs 2018-05-18 08:50:37 -07:00
Simon Willison cef9a9a870
--limit= mechanism plus new limits for facets
Replaced the --max_returned_rows and --sql_time_limit_ms options to
"datasette serve" with a new --limit option, which supports a larger
list of limits.

Example usage:

	datasette serve --limit max_returned_rows:1000 \
		--limit sql_time_limit_ms:2500 \
		--limit default_facet_size:50 \
		--limit facet_time_limit_ms:1000 \
		--limit facet_suggest_time_limit_ms:500

New docs: https://datasette.readthedocs.io/en/latest/limits.html

Closes #270
Closes #264
2018-05-17 22:08:26 -07:00
Simon Willison 5e78d11c24
Docs: Speeding up facets with indexes 2018-05-16 21:08:50 -07:00
Simon Willison 96aac7f9e9
Facet documentation tweaks 2018-05-16 13:50:34 -07:00
Simon Willison 9959a9e4de Added screenshots to facets and full_text_search docs, refs #255 2018-05-16 08:27:24 -07:00
Simon Willison 858d79fe93 Typo fix 2018-05-16 08:27:24 -07:00
Simon Willison 566f2d31d6 Clarified relationship between metadata and _facet= facets, updated docs - refs @255 2018-05-16 08:27:24 -07:00
Simon Willison de05cf21aa Facet "selected" key and toggle_url now toggles, refs #255 2018-05-16 08:27:24 -07:00
Simon Willison eaaa3ea149
Initial implementation of facets, plus tests and docs
Refs #255
2018-05-12 19:29:41 -03:00
Simon Willison 1c815207cc
Update conf.py 2018-05-12 09:08:11 -03:00
Simon Willison 694f845715
Documentation for SQLite full-text search support, closes #253 2018-05-12 09:06:38 -03:00
Simon Willison 403211de63
Release Datasette 0.21 2018-05-05 20:15:38 -03:00
Simon Willison 1259b8ac0b
Support _search_COLUMN=text searches, closes #237 2018-05-05 19:33:08 -03:00
Simon Willison d4da4c92c8
?_size=max option, closes #249 2018-05-04 15:03:40 -03:00
Simon Willison 349e262bb1 Renamed ?_sql_time_limit_ms= to ?_timelimit, closes #242 2018-05-01 17:20:39 -07:00
Simon Willison a4cc5dc813 New ?_shape=array option + tweaks to _shape, closes #245
* Default is now ?_shape=arrays (renamed from lists)
* New ?_shape=array returns an array of objects as the root object
* Changed ?_shape=object to return the object as the root
* Updated docs
2018-05-01 17:20:39 -07:00
Simon Willison f188ceaa2a
New ?_size=XXX querystring parameter for table view, closes #229
Also added documentation for all of the _special arguments.

Plus deleted some duplicate logic implementing _group_count.
2018-04-25 21:47:12 -07:00
Simon Willison 02ee31c8b4
New hidden: True option for table metadat, closes #239 2018-04-25 20:42:57 -07:00
Simon Willison f27cabbaf3
label_column option in metadata.json - closes #234 2018-04-22 10:53:16 -07:00
Simon Willison 72a7ae6859
Datasette 0.20: static assets and templates for plugins 2018-04-20 07:32:02 -07:00
Simon Willison 1e4c295012
Fixed out-dated template in documentation 2018-04-18 22:57:31 -07:00
Simon Willison b52171db1e
Plugins can now bundle custom templates, closes #224
Refs #14
2018-04-18 22:50:27 -07:00
Simon Willison 6e28ed447f
Thanks to #214 JavaScript is no longer 'soon' 2018-04-18 08:17:20 -07:00
Simon Willison 7581320823
Documentation for --install option, refs #223 2018-04-18 08:05:06 -07:00
Simon Willison f8f818711b
Formatting tweak 2018-04-17 21:30:58 -07:00
Simon Willison 1c36d07dd4
New plugin hooks: extra_css_urls() and extra_js_urls()
Closes #214
2018-04-17 20:12:21 -07:00
Simon Willison ca588b6a30
Fixed example HTML in CSS docs 2018-04-17 19:35:03 -07:00
Simon Willison 0bb483ca5b
/-/static-plugins/PLUGIN_NAME/ now serves static/ from plugins
Refs #214
2018-04-17 19:32:48 -07:00
Simon Willison a5792a8c61
<th> now gets class="col-X" - plus added col-X documentation
Refs #209
2018-04-17 19:11:54 -07:00
Simon Willison ba9bfa5831
Datasette 0.19: plugin preview (with release notes) 2018-04-16 19:12:21 -07:00
Simon Willison 904f1c75a3
Initial documentation for plugins, closes #213
https://datasette.readthedocs.io/en/latest/plugins.html
2018-04-16 08:12:09 -07:00
Simon Willison 43ae15c0d1
Releasing v0.18 - support for units!
Refs #203
2018-04-14 08:36:10 -07:00
Russ Garrett 7d5f25dfb3
Add link to pint custom units page to docs 2018-04-14 15:08:20 +01:00
Russ Garrett 3c985ec271
Allow custom units to be registered with Pint 2018-04-14 12:27:06 +01:00
Russ Garrett 8bfeb98478
Tidy up units support
* Add units to exported JSON
* Units key in metadata skeleton
* Docs
2018-04-14 11:43:34 +01:00
Simon Willison b6539ff045
Releasing v0.16 2018-04-13 11:28:55 -07:00
Simon Willison 7706fe0c67
Releasing v0.15 2018-04-09 08:48:24 -07:00
Simon Willison a290f28caa
table_rows => table_rows_count, filtered_table_rows => filtered_table_rows_count
Renamed properties. Closes #194
2018-04-08 22:24:24 -07:00
Simon Willison b13f0986f2 New sortable_columns option in metadata.json to control sort options
You can now explicitly set which columns in a table can be used for sorting
using the _sort and _sort_desc arguments using metadata.json:

    {
        "databases": {
            "database1": {
                "tables": {
                    "example_table": {
                        "sortable_columns": [
                            "height",
                            "weight"
                        ]
                    }
                }
            }
        }
    }

Refs #189
2018-04-08 22:10:22 -07:00
Simon Willison 0abd3abacb
New ?_shape=objects/object/lists param for JSON API (#192)
New _shape= parameter replacing old .jsono extension

Now instead of this:

	/database/table.jsono

We use the _shape parameter like this:

	/database/table.json?_shape=objects

Also introduced a new _shape called 'object' which looks like this:

	/database/table.json?_shape=object

Returning an object for the rows key:

	...
	"rows": {
		"pk1": {
			...
		},
		"pk2": {
			...
		}
	}

Refs #122
2018-04-03 07:52:54 -07:00
Simon Willison 89d9fbb91b
Database/Table views inherit source/license/source_url/license_url metadata
If you set the source_url/license_url/source/license fields in your root
metadata those values will now be inherited all the way down to the database
and table templates.

The title/description are NOT inherited.

Also added unit tests for the HTML generated by the metadata.

Refs #185
2018-03-27 09:18:32 -07:00
Simon Willison cac32b0ec4
Initial documentation for pagination 2018-01-09 20:47:03 -08:00
Simon Willison e63f432fe5
Mention Heroku in docs index page 2018-01-09 20:46:34 -08:00
Simon Willison 7db790fbf9
Release notes for 0.14
Also updated "datasette serve" help in getting started docs.
2017-12-09 17:26:32 -08:00
Simon Willison 7126d08f10
HTML comment showing which templates were considered for a page
Closes #171
2017-12-09 13:47:32 -08:00
Simon Willison 3c9f889715
Custom templates for canned queries
Closes #170
2017-12-09 13:34:46 -08:00
Simon Willison 06645f2e26
Formatting tweak 2017-12-09 10:41:20 -08:00
Simon Willison 3459ab9166
Formatting fixes 2017-12-09 10:33:14 -08:00
Simon Willison 9af2964f6f
Documentation for metadata.json and "datasette skeleton" command
http://datasette.readthedocs.io/en/latest/metadata.html

Closes #166
2017-12-07 09:19:35 -08:00
Simon Willison 7e1ba161ec
Ability to easily customize _rows_and_columns.html per database table
Also added documentation for this.

Refs #158, Closes #159.
2017-12-06 22:11:22 -08:00
Simon Willison 67ad77a307
Re-ordered docs index page 2017-12-06 10:27:50 -08:00
Simon Willison f2dece01db
Documented _sql_time_limit_ms querystring argument
Closes #163
2017-12-06 07:06:56 -08:00
Simon Willison 7a4da7e5ae
Documentation for custom SQL queries
http://datasette.readthedocs.io/en/latest/sql_queries.html

Closes #20
2017-12-05 09:43:59 -08:00
Simon Willison b7b590b414
Docs for query.html CSS/template, refs #20 2017-12-05 08:35:14 -08:00
Simon Willison 1feb5735da
Moved getting started into separate docs page 2017-11-30 10:27:00 -08:00
Simon Willison 601934936c
Documentation for custom CSS/JavaScript/Templates
Will go live at http://datasette.readthedocs.io/en/latest/custom_templates.html

Closes #156
2017-11-30 09:09:48 -08:00
Simon Willison cf46b86cf7
Switch to sphinx_rtd_theme 2017-11-30 08:56:20 -08:00
Simon Willison 0d3479ba32
Release notes for 0.13 2017-11-24 19:32:24 -08:00
Simon Willison b7c4165346 Added --load-extension argument to datasette serve
Allows loading of SQLite extensions. Refs #110.
2017-11-16 08:48:49 -08:00
Simon Willison 9e27b2a0ba Add example of named parameter UI to the release notes 2017-11-16 08:46:25 -08:00
Simon Willison a9138f044a Added date to most recent changelog entry 2017-11-16 07:40:43 -08:00
Simon Willison 51bdd67691 Changelog for 0.12 release 2017-11-16 07:37:46 -08:00
Simon Willison e6ca885883 Added initial docs, including a changelog
Docs initialized using this helpful guide:

http://docs.readthedocs.io/en/latest/getting_started.html

I used https://pypi.python.org/pypi/gitchangelog to kick-start the changelog.

Closes #99

Refs #109
2017-11-16 07:11:00 -08:00