diff --git a/datasette/inspect-data.json b/datasette/inspect-data.json new file mode 100644 index 0000000..bda64b0 --- /dev/null +++ b/datasette/inspect-data.json @@ -0,0 +1,12 @@ +{ + "db": { + "hash": "e7781c4da0df3983d9e8bfc09d513162302d787bff766e3cfee2dd5dcd272b85", + "size": 121118720, + "file": "datasette/db.db", + "tables": { + "decp": { + "count": 292374 + } + } + } +} \ No newline at end of file diff --git a/datasette/metadata.yaml b/datasette/metadata.yaml new file mode 100644 index 0000000..c49b10e --- /dev/null +++ b/datasette/metadata.yaml @@ -0,0 +1,31 @@ +--- +extra_css_urls: +- "/static/custom.css" +title: Exploration et téléchargement des données essentielles de la commande publique + (format tabulaire) +description: Ce site vous permet de filtrer et trier les données sur les marchés publics, + et de télécharger le résultat sous la forme d'un fichier que vous pourrez ouvrir + dans un logiciel de tableur (MS Excel, LibreOffice, OpenOffice). +source: Données essentielles de la commande publique +source_url: https://www.data.gouv.fr/fr/datasets/608c055b35eb4e6ee20eb325/ +license: Licence ouverte +license_url: https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Licence_Ouverte.pdf +databases: + db: + tables: + decp: + title: Marchés et titulaires (= DECP) + description_html: |- + Marché publics et leurs titulaires, données équivalentes au format réglementaire. Une ligne = un titulaire de marché, donc ces données ne sont pas adaptées pour travailler avec les montants de marché ou compter les marchés. + size: 40 + download: https://www.data.gouv.fr/fr/datasets/r/8587fe77-fb31-4155-8753-f6a3c5e0f5c9 + decp-sans-titulaires: + title: Marchés publics sans leurs titulaires + description_html: Marchés publics sans les titulaires (pas de colonnes titulaire). Une ligne = un marché, donc ces données sont adaptées pour travailler avec les montants de marchés et compter les marchés. + size: 40 + download: https://www.data.gouv.fr/fr/datasets/r/834c14dd-037c-4825-958d-0a841c4777ae + decp-titulaires: + title: Données sur les titulaires et géolocalisation + description_html: Données détaillées sur les titulaires, dont leur géolocalisation. Les colonnes formePrix, procedure, objetModification et datePublicationDonnees sont absentes. Une ligne = un titulaire de marché, donc ces données ne sont pas adaptées pour travailler avec les montants de marché ou compter les marchés. + size: 40 + download: https://www.data.gouv.fr/fr/datasets/r/25fcd9e6-ce5a-41a7-b6c0-f140abb2a060 diff --git a/datasette/plugins/menu.py b/datasette/plugins/menu.py new file mode 100644 index 0000000..ddf0b9a --- /dev/null +++ b/datasette/plugins/menu.py @@ -0,0 +1,12 @@ +from datasette import hookimpl + +@hookimpl +def menu_links(datasette, actor): + return [ + {"href": "https://teamopendata.org/t/decp-info-les-donnees-de-la-commande-publique-pour-tous-questions-reponses-discussions/2948", "label": "Présentation / FAQ"}, + {"href": "https://github.com/ColinMaudry/decp-table-schema/#documentation-du-sch%C3%A9ma", "label": "Documentation des champs"}, + {"href": "https://github.com/ColinMaudry/decp.info", "label": "Code source"}, + {"href": "/versions", "label": "Notes de version"}, + {"href": "/inscription", "label": "Lettre d'information"}, + {"href": "/mentions-legales", "label": "Mentions légales"} + ] diff --git a/datasette/plugins/xlsx.py b/datasette/plugins/xlsx.py new file mode 100644 index 0000000..88bf4dd --- /dev/null +++ b/datasette/plugins/xlsx.py @@ -0,0 +1,75 @@ +from datasette import hookimpl +from datasette.utils.asgi import Response +from openpyxl import Workbook +from openpyxl.writer.excel import save_virtual_workbook +from openpyxl.cell import WriteOnlyCell +from openpyxl.styles import Alignment, Font, PatternFill +from tempfile import NamedTemporaryFile + + +def render_spreadsheet(rows): + wb = Workbook(write_only=True) + ws = wb.create_sheet() + ws = wb.active + ws.title = "decp" + + columnSpecs = { + 'acheteur.nom': { + 'width': 7, + 'wrapText': True + }, + 'objet': { + 'width': 7, + 'wrapText': True + }, + 'titulaire.denominationSociale': { + 'width': 7, + 'wrapText': True + }, + } + + columns = rows[0].keys() + if columns[0] == "rowid": + columns = columns[1:] + + letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + + headers = [] + index = 0 + for col in columns : + c = WriteOnlyCell(ws, col) + c.fill = PatternFill("solid", fgColor="DDEFFF") + headers.append(c) + if col in columnSpecs: + ws.column_dimensions[letters[index]].width = columnSpecs[col]['width'] * 5 + else: + ws.column_dimensions[letters[index]].bestFit = True + index = index + 1 + ws.append(headers) + + for row in rows: + wsRow = [] + for col in columns: + c = WriteOnlyCell(ws, row[col]) + if col in columnSpecs : + c.alignment = Alignment(wrapText = columnSpecs[col]['wrapText']) + wsRow.append(c) + ws.append(wsRow) + + with NamedTemporaryFile() as tmp: + wb.save(tmp.name) + tmp.seek(0) + return Response( + tmp.read(), + headers={ + 'Content-Disposition': 'attachment; filename=decp.xlsx', + 'Content-type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + } + ) + + +@hookimpl +def register_output_renderer(): + return {"extension": "xlsx", + "render": render_spreadsheet, + "can_render": lambda: False} diff --git a/datasette/settings.json b/datasette/settings.json new file mode 100644 index 0000000..a9c9b3e --- /dev/null +++ b/datasette/settings.json @@ -0,0 +1,12 @@ +{ + "sql_time_limit_ms": 10000, + "max_returned_rows": 50000, + "num_sql_threads": 6, + "default_cache_ttl": 3600, + "max_csv_mb": 0, + "force_https_urls": 1, + "allow_facet": "off", + "suggest_facets": "off", + "template_debug": 1, + "hash_urls": 1 +} diff --git a/datasette/static/custom.css b/datasette/static/custom.css new file mode 100644 index 0000000..6e291c4 --- /dev/null +++ b/datasette/static/custom.css @@ -0,0 +1,166 @@ +section.content > div.table-wrapper { + display: inline-block; +} + +a, a:visited, a:focus, a:active { + color: #276890; + text-decoration: underline; +} + +a:hover { + color: #0c286d; +} + +a.explore { + font-size: 1.6em; +} + +a.nodec { + text-decoration: none; +} + +nav ul { + list-style-type: none; +} + +nav li { + padding: 10px; + border-top: solid 1px #fff; +} + +nav summary { + font-weight: bold; +} + +nav .nav-menu-inner { + padding: 10px 0; +} + +table.rows-and-columns td > div { + max-height: 100px; + font-size: 0.8em; + overflow-y: auto; + overflow-x: hidden; +} + +table.rows-and-columns tr:nth-child(even) { + background-color: #DDEFFF; +} + +h4,.header4 { + text-decoration: none; +} + +table.rows-and-columns td.col-objet > div { + min-width: 140px; +} + +table.rows-and-columns td.col-procedure > div { + min-width: 140px; +} + +td.col-longitude,th.col-longitude,td.col-latitude,th.col-latitude { + display: none; +} + +#sib-container form label { + width: 100%; +} + +.db-table .columns { + font-size: 0.9em; + color: #555; +} + +.db-presentation { + border-left: 10px solid #276890; + padding-left: 10px; + max-width: 1000px; + margin-top: 30px; + font-size: 1.2em; +} + + + +/* +Flaticon icon font: Flaticon +Creation date: 22/06/2016 15:35 +*/ + +@font-face { +font-family: "Flaticon"; +src: url("./font/Flaticon.eot"); +src: url("./font/Flaticon.eot?#iefix") format("embedded-opentype"), + url("./font/Flaticon.woff") format("woff"), + url("./font/Flaticon.ttf") format("truetype"), + url("./font/Flaticon.svg#Flaticon") format("svg"); +font-weight: normal; +font-style: normal; +} + +@media screen and (-webkit-min-device-pixel-ratio:0) { +@font-face { +font-family: "Flaticon"; +src: url("./font/Flaticon.svg#Flaticon") format("svg"); +} +} + +[class^="flaticon-"]:before, [class*=" flaticon-"]:before, +[class^="flaticon-"]:after, [class*=" flaticon-"]:after { +font-family: Flaticon; + font-size: 20px; +font-style: normal; +font-weight: bold; +margin-left: 20px; +} + +.flaticon-avatar:before { content: "\f100"; } +.flaticon-avatar-1:before { content: "\f101"; } +.flaticon-back:before { content: "\f102"; } +.flaticon-book:before { content: "\f103"; } +.flaticon-cancel:before { content: "\f104"; } +.flaticon-chat:before { content: "\f105"; } +.flaticon-chat-1:before { content: "\f106"; } +.flaticon-chat-2:before { content: "\f107"; } +.flaticon-copy:before { content: "\f108"; } +.flaticon-dislike:before { content: "\f109"; } +.flaticon-download:before { content: "\f10a"; } +.flaticon-download-1:before { content: "\f10b"; } +.flaticon-edit:before { content: "\f10c"; } +.flaticon-envelope:before { content: "\f10d"; } +.flaticon-folder:before { content: "\f10e"; } +.flaticon-garbage:before { content: "\f10f"; } +.flaticon-glasses:before { content: "\f110"; } +.flaticon-hand:before { content: "\f111"; } +.flaticon-headphones:before { content: "\f112"; } +.flaticon-heart:before { content: "\f113"; } +.flaticon-house:before { content: "\f114"; } +.flaticon-like:before { content: "\f115"; } +.flaticon-link:before { content: "\f116"; } +.flaticon-logout:before { content: "\f117"; } +.flaticon-magnifying-glass:before { content: "\f118"; } +.flaticon-monitor:before { content: "\f119"; } +.flaticon-musical-note:before { content: "\f11a"; } +.flaticon-next:before { content: "\f11b"; } +.flaticon-next-1:before { content: "\f11c"; } +.flaticon-padlock:before { content: "\f11d"; } +.flaticon-paper-plane:before { content: "\f11e"; } +.flaticon-phone-call:before { content: "\f11f"; } +.flaticon-photo-camera:before { content: "\f120"; } +.flaticon-pie-chart:before { content: "\f121"; } +.flaticon-piggy-bank:before { content: "\f122"; } +.flaticon-placeholder:before { content: "\f123"; } +.flaticon-printer:before { content: "\f124"; } +.flaticon-reload:before { content: "\f125"; } +.flaticon-settings:before { content: "\f126"; } +.flaticon-settings-1:before { content: "\f127"; } +.flaticon-share:before { content: "\f128"; } +.flaticon-shopping-bag:before { content: "\f129"; } +.flaticon-shopping-cart:before { content: "\f12a"; } +.flaticon-shuffle:before { content: "\f12b"; } +.flaticon-speaker:before { content: "\f12c"; } +.flaticon-star:before { content: "\f12d"; } +.flaticon-tag:before { content: "\f12e"; } +.flaticon-upload:before { content: "\f12f"; } +.flaticon-upload-1:before { content: "\f130"; } +.flaticon-vector:before { content: "\f131"; } diff --git a/datasette/static/font/Flaticon.eot b/datasette/static/font/Flaticon.eot new file mode 100644 index 0000000..d5f80f6 Binary files /dev/null and b/datasette/static/font/Flaticon.eot differ diff --git a/datasette/static/font/Flaticon.svg b/datasette/static/font/Flaticon.svg new file mode 100644 index 0000000..b679e84 --- /dev/null +++ b/datasette/static/font/Flaticon.svg @@ -0,0 +1,445 @@ + + + + + +Created by FontForge 20120731 at Wed Jun 22 15:35:07 2016 + By root +Created by root with FontForge 2.0 (http://fontforge.sf.net) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/datasette/static/font/Flaticon.ttf b/datasette/static/font/Flaticon.ttf new file mode 100644 index 0000000..399bb49 Binary files /dev/null and b/datasette/static/font/Flaticon.ttf differ diff --git a/datasette/static/font/Flaticon.woff b/datasette/static/font/Flaticon.woff new file mode 100644 index 0000000..6bbf5e6 Binary files /dev/null and b/datasette/static/font/Flaticon.woff differ diff --git a/datasette/static/font/_flaticon.scss b/datasette/static/font/_flaticon.scss new file mode 100644 index 0000000..102084f --- /dev/null +++ b/datasette/static/font/_flaticon.scss @@ -0,0 +1,139 @@ + /* + Flaticon icon font: Flaticon + Creation date: 22/06/2016 15:35 + */ + + @font-face { + font-family: "Flaticon"; + src: url("./Flaticon.eot"); + src: url("./Flaticon.eot?#iefix") format("embedded-opentype"), + url("./Flaticon.woff") format("woff"), + url("./Flaticon.ttf") format("truetype"), + url("./Flaticon.svg#Flaticon") format("svg"); + font-weight: normal; + font-style: normal; +} + +@media screen and (-webkit-min-device-pixel-ratio:0) { + @font-face { + font-family: "Flaticon"; + src: url("./Flaticon.svg#Flaticon") format("svg"); + } +} + + .fi:before{ + display: inline-block; + font-family: "Flaticon"; + font-style: normal; + font-weight: normal; + font-variant: normal; + line-height: 1; + text-decoration: inherit; + text-rendering: optimizeLegibility; + text-transform: none; + -moz-osx-font-smoothing: grayscale; + -webkit-font-smoothing: antialiased; + font-smoothing: antialiased; + } + + .flaticon-avatar:before { content: "\f100"; } +.flaticon-avatar-1:before { content: "\f101"; } +.flaticon-back:before { content: "\f102"; } +.flaticon-book:before { content: "\f103"; } +.flaticon-cancel:before { content: "\f104"; } +.flaticon-chat:before { content: "\f105"; } +.flaticon-chat-1:before { content: "\f106"; } +.flaticon-chat-2:before { content: "\f107"; } +.flaticon-copy:before { content: "\f108"; } +.flaticon-dislike:before { content: "\f109"; } +.flaticon-download:before { content: "\f10a"; } +.flaticon-download-1:before { content: "\f10b"; } +.flaticon-edit:before { content: "\f10c"; } +.flaticon-envelope:before { content: "\f10d"; } +.flaticon-folder:before { content: "\f10e"; } +.flaticon-garbage:before { content: "\f10f"; } +.flaticon-glasses:before { content: "\f110"; } +.flaticon-hand:before { content: "\f111"; } +.flaticon-headphones:before { content: "\f112"; } +.flaticon-heart:before { content: "\f113"; } +.flaticon-house:before { content: "\f114"; } +.flaticon-like:before { content: "\f115"; } +.flaticon-link:before { content: "\f116"; } +.flaticon-logout:before { content: "\f117"; } +.flaticon-magnifying-glass:before { content: "\f118"; } +.flaticon-monitor:before { content: "\f119"; } +.flaticon-musical-note:before { content: "\f11a"; } +.flaticon-next:before { content: "\f11b"; } +.flaticon-next-1:before { content: "\f11c"; } +.flaticon-padlock:before { content: "\f11d"; } +.flaticon-paper-plane:before { content: "\f11e"; } +.flaticon-phone-call:before { content: "\f11f"; } +.flaticon-photo-camera:before { content: "\f120"; } +.flaticon-pie-chart:before { content: "\f121"; } +.flaticon-piggy-bank:before { content: "\f122"; } +.flaticon-placeholder:before { content: "\f123"; } +.flaticon-printer:before { content: "\f124"; } +.flaticon-reload:before { content: "\f125"; } +.flaticon-settings:before { content: "\f126"; } +.flaticon-settings-1:before { content: "\f127"; } +.flaticon-share:before { content: "\f128"; } +.flaticon-shopping-bag:before { content: "\f129"; } +.flaticon-shopping-cart:before { content: "\f12a"; } +.flaticon-shuffle:before { content: "\f12b"; } +.flaticon-speaker:before { content: "\f12c"; } +.flaticon-star:before { content: "\f12d"; } +.flaticon-tag:before { content: "\f12e"; } +.flaticon-upload:before { content: "\f12f"; } +.flaticon-upload-1:before { content: "\f130"; } +.flaticon-vector:before { content: "\f131"; } + + $font-Flaticon-avatar: "\f100"; + $font-Flaticon-avatar-1: "\f101"; + $font-Flaticon-back: "\f102"; + $font-Flaticon-book: "\f103"; + $font-Flaticon-cancel: "\f104"; + $font-Flaticon-chat: "\f105"; + $font-Flaticon-chat-1: "\f106"; + $font-Flaticon-chat-2: "\f107"; + $font-Flaticon-copy: "\f108"; + $font-Flaticon-dislike: "\f109"; + $font-Flaticon-download: "\f10a"; + $font-Flaticon-download-1: "\f10b"; + $font-Flaticon-edit: "\f10c"; + $font-Flaticon-envelope: "\f10d"; + $font-Flaticon-folder: "\f10e"; + $font-Flaticon-garbage: "\f10f"; + $font-Flaticon-glasses: "\f110"; + $font-Flaticon-hand: "\f111"; + $font-Flaticon-headphones: "\f112"; + $font-Flaticon-heart: "\f113"; + $font-Flaticon-house: "\f114"; + $font-Flaticon-like: "\f115"; + $font-Flaticon-link: "\f116"; + $font-Flaticon-logout: "\f117"; + $font-Flaticon-magnifying-glass: "\f118"; + $font-Flaticon-monitor: "\f119"; + $font-Flaticon-musical-note: "\f11a"; + $font-Flaticon-next: "\f11b"; + $font-Flaticon-next-1: "\f11c"; + $font-Flaticon-padlock: "\f11d"; + $font-Flaticon-paper-plane: "\f11e"; + $font-Flaticon-phone-call: "\f11f"; + $font-Flaticon-photo-camera: "\f120"; + $font-Flaticon-pie-chart: "\f121"; + $font-Flaticon-piggy-bank: "\f122"; + $font-Flaticon-placeholder: "\f123"; + $font-Flaticon-printer: "\f124"; + $font-Flaticon-reload: "\f125"; + $font-Flaticon-settings: "\f126"; + $font-Flaticon-settings-1: "\f127"; + $font-Flaticon-share: "\f128"; + $font-Flaticon-shopping-bag: "\f129"; + $font-Flaticon-shopping-cart: "\f12a"; + $font-Flaticon-shuffle: "\f12b"; + $font-Flaticon-speaker: "\f12c"; + $font-Flaticon-star: "\f12d"; + $font-Flaticon-tag: "\f12e"; + $font-Flaticon-upload: "\f12f"; + $font-Flaticon-upload-1: "\f130"; + $font-Flaticon-vector: "\f131"; \ No newline at end of file diff --git a/datasette/static/font/flaticon.css b/datasette/static/font/flaticon.css new file mode 100644 index 0000000..1d54a8c --- /dev/null +++ b/datasette/static/font/flaticon.css @@ -0,0 +1,81 @@ + /* + Flaticon icon font: Flaticon + Creation date: 22/06/2016 15:35 + */ + +@font-face { + font-family: "Flaticon"; + src: url("./Flaticon.eot"); + src: url("./Flaticon.eot?#iefix") format("embedded-opentype"), + url("./Flaticon.woff") format("woff"), + url("./Flaticon.ttf") format("truetype"), + url("./Flaticon.svg#Flaticon") format("svg"); + font-weight: normal; + font-style: normal; +} + +@media screen and (-webkit-min-device-pixel-ratio:0) { + @font-face { + font-family: "Flaticon"; + src: url("./Flaticon.svg#Flaticon") format("svg"); + } +} + +[class^="flaticon-"]:before, [class*=" flaticon-"]:before, +[class^="flaticon-"]:after, [class*=" flaticon-"]:after { + font-family: Flaticon; + font-size: 20px; +font-style: normal; +margin-left: 20px; +} + +.flaticon-avatar:before { content: "\f100"; } +.flaticon-avatar-1:before { content: "\f101"; } +.flaticon-back:before { content: "\f102"; } +.flaticon-book:before { content: "\f103"; } +.flaticon-cancel:before { content: "\f104"; } +.flaticon-chat:before { content: "\f105"; } +.flaticon-chat-1:before { content: "\f106"; } +.flaticon-chat-2:before { content: "\f107"; } +.flaticon-copy:before { content: "\f108"; } +.flaticon-dislike:before { content: "\f109"; } +.flaticon-download:before { content: "\f10a"; } +.flaticon-download-1:before { content: "\f10b"; } +.flaticon-edit:before { content: "\f10c"; } +.flaticon-envelope:before { content: "\f10d"; } +.flaticon-folder:before { content: "\f10e"; } +.flaticon-garbage:before { content: "\f10f"; } +.flaticon-glasses:before { content: "\f110"; } +.flaticon-hand:before { content: "\f111"; } +.flaticon-headphones:before { content: "\f112"; } +.flaticon-heart:before { content: "\f113"; } +.flaticon-house:before { content: "\f114"; } +.flaticon-like:before { content: "\f115"; } +.flaticon-link:before { content: "\f116"; } +.flaticon-logout:before { content: "\f117"; } +.flaticon-magnifying-glass:before { content: "\f118"; } +.flaticon-monitor:before { content: "\f119"; } +.flaticon-musical-note:before { content: "\f11a"; } +.flaticon-next:before { content: "\f11b"; } +.flaticon-next-1:before { content: "\f11c"; } +.flaticon-padlock:before { content: "\f11d"; } +.flaticon-paper-plane:before { content: "\f11e"; } +.flaticon-phone-call:before { content: "\f11f"; } +.flaticon-photo-camera:before { content: "\f120"; } +.flaticon-pie-chart:before { content: "\f121"; } +.flaticon-piggy-bank:before { content: "\f122"; } +.flaticon-placeholder:before { content: "\f123"; } +.flaticon-printer:before { content: "\f124"; } +.flaticon-reload:before { content: "\f125"; } +.flaticon-settings:before { content: "\f126"; } +.flaticon-settings-1:before { content: "\f127"; } +.flaticon-share:before { content: "\f128"; } +.flaticon-shopping-bag:before { content: "\f129"; } +.flaticon-shopping-cart:before { content: "\f12a"; } +.flaticon-shuffle:before { content: "\f12b"; } +.flaticon-speaker:before { content: "\f12c"; } +.flaticon-star:before { content: "\f12d"; } +.flaticon-tag:before { content: "\f12e"; } +.flaticon-upload:before { content: "\f12f"; } +.flaticon-upload-1:before { content: "\f130"; } +.flaticon-vector:before { content: "\f131"; } \ No newline at end of file diff --git a/datasette/static/font/flaticon.html b/datasette/static/font/flaticon.html new file mode 100644 index 0000000..f638216 --- /dev/null +++ b/datasette/static/font/flaticon.html @@ -0,0 +1,705 @@ + + + + + + + + Flaticon WebFont + + + + + + + + +
+ + Font Demo +
+ + +
+ +

Instructions

+ + + +
+ + + + +
+ + +
+
.flaticon-avatar
+ +
+ +
+
.flaticon-avatar-1
+ +
+ +
+
.flaticon-back
+ +
+ +
+
.flaticon-book
+ +
+ +
+
.flaticon-cancel
+ +
+ +
+
.flaticon-chat
+ +
+ +
+
.flaticon-chat-1
+ +
+ +
+
.flaticon-chat-2
+ +
+ +
+
.flaticon-copy
+ +
+ +
+
.flaticon-dislike
+ +
+ +
+
.flaticon-download
+ +
+ +
+
.flaticon-download-1
+ +
+ +
+
.flaticon-edit
+ +
+ +
+
.flaticon-envelope
+ +
+ +
+
.flaticon-folder
+ +
+ +
+
.flaticon-garbage
+ +
+ +
+
.flaticon-glasses
+ +
+ +
+
.flaticon-hand
+ +
+ +
+
.flaticon-headphones
+ +
+ +
+
.flaticon-heart
+ +
+ +
+
.flaticon-house
+ +
+ +
+
.flaticon-like
+ +
+ +
+
.flaticon-link
+ +
+ +
+
.flaticon-logout
+ +
+ +
+
.flaticon-magnifying-glass
+ +
+ +
+
.flaticon-monitor
+ +
+ +
+
.flaticon-musical-note
+ +
+ +
+
.flaticon-next
+ +
+ +
+
.flaticon-next-1
+ +
+ +
+
.flaticon-padlock
+ +
+ +
+
.flaticon-paper-plane
+ +
+ +
+
.flaticon-phone-call
+ +
+ +
+
.flaticon-photo-camera
+ +
+ +
+
.flaticon-pie-chart
+ +
+ +
+
.flaticon-piggy-bank
+ +
+ +
+
.flaticon-placeholder
+ +
+ +
+
.flaticon-printer
+ +
+ +
+
.flaticon-reload
+ +
+ +
+
.flaticon-settings
+ +
+ +
+
.flaticon-settings-1
+ +
+ +
+
.flaticon-share
+ +
+ +
+
.flaticon-shopping-bag
+ +
+ +
+
.flaticon-shopping-cart
+ +
+ +
+
.flaticon-shuffle
+ +
+ +
+
.flaticon-speaker
+ +
+ +
+
.flaticon-star
+ +
+ +
+
.flaticon-tag
+ +
+ +
+
.flaticon-upload
+ +
+ +
+
.flaticon-upload-1
+ +
+ +
+
.flaticon-vector
+ +
+ + +
+ + + +
+ +
License and attribution:
Font generated by flaticon.com.

Under CC: Gregor Cresnar

+
+
Copy the Attribution License:
+ + + +
+ +
+ +
Examples:
+ +
+

+ + <i class="flaticon-avatar"></i> +

+
+ +
+

+ + <i class="flaticon-avatar-1"></i> +

+
+ +
+

+ + <i class="flaticon-back"></i> +

+
+ +
+

+ + <i class="flaticon-book"></i> +

+
+ + + +
+ + + + + + + \ No newline at end of file diff --git a/datasette/static/icons/1024.png b/datasette/static/icons/1024.png new file mode 100644 index 0000000..524f1b5 Binary files /dev/null and b/datasette/static/icons/1024.png differ diff --git a/datasette/static/icons/favicon.ico b/datasette/static/icons/favicon.ico new file mode 100644 index 0000000..93135a5 Binary files /dev/null and b/datasette/static/icons/favicon.ico differ diff --git a/datasette/static/icons/icon-192x192.png b/datasette/static/icons/icon-192x192.png new file mode 100644 index 0000000..3ed8591 Binary files /dev/null and b/datasette/static/icons/icon-192x192.png differ diff --git a/datasette/static/icons/icon-256x256.png b/datasette/static/icons/icon-256x256.png new file mode 100644 index 0000000..805a4cf Binary files /dev/null and b/datasette/static/icons/icon-256x256.png differ diff --git a/datasette/static/icons/icon-384x384.png b/datasette/static/icons/icon-384x384.png new file mode 100644 index 0000000..7f96df3 Binary files /dev/null and b/datasette/static/icons/icon-384x384.png differ diff --git a/datasette/static/icons/icon-512x512.png b/datasette/static/icons/icon-512x512.png new file mode 100644 index 0000000..91f8938 Binary files /dev/null and b/datasette/static/icons/icon-512x512.png differ diff --git a/datasette/static/manifest.webmanifest b/datasette/static/manifest.webmanifest new file mode 100644 index 0000000..a7c389a --- /dev/null +++ b/datasette/static/manifest.webmanifest @@ -0,0 +1,33 @@ +{ + "theme_color": "#276890", + "background_color": "#276890", + "display": "browser", + "scope": "/", + "start_url": "/", + "lang": "fr", + "name": "decp.info", + "short_name": "decp.info", + "description": "Outil d'exploration et de t\u00e9l\u00e9chargemetn des donn\u00e9es de la commande publique.", + "icons": [ + { + "src": "/static/icons/icon-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/static/icons/icon-256x256.png", + "sizes": "256x256", + "type": "image/png" + }, + { + "src": "/static/icons/icon-384x384.png", + "sizes": "384x384", + "type": "image/png" + }, + { + "src": "/static/icons/icon-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ] +} diff --git a/datasette/templates/_close_open_menus.html b/datasette/templates/_close_open_menus.html new file mode 100644 index 0000000..65eebdd --- /dev/null +++ b/datasette/templates/_close_open_menus.html @@ -0,0 +1,16 @@ + diff --git a/datasette/templates/_codemirror.html b/datasette/templates/_codemirror.html new file mode 100644 index 0000000..a17eaf9 --- /dev/null +++ b/datasette/templates/_codemirror.html @@ -0,0 +1,14 @@ + + + + + + diff --git a/datasette/templates/_codemirror_foot.html b/datasette/templates/_codemirror_foot.html new file mode 100644 index 0000000..ee09cff --- /dev/null +++ b/datasette/templates/_codemirror_foot.html @@ -0,0 +1,38 @@ + diff --git a/datasette/templates/_description_source_license.html b/datasette/templates/_description_source_license.html new file mode 100644 index 0000000..c24f321 --- /dev/null +++ b/datasette/templates/_description_source_license.html @@ -0,0 +1,30 @@ +{% if metadata.description_html or metadata.description %} +
+ {% if metadata.description_html %} + {{ metadata.description_html|safe }} + {% else %} + {{ metadata.description }} + {% endif %} +
+{% endif %} +{% if metadata.license or metadata.license_url or metadata.source or metadata.source_url %} +

+ {% if metadata.license or metadata.license_url %}Licence des données : + {% if metadata.license_url %} + {{ metadata.license or metadata.license_url }} + {% else %} + {{ metadata.license }} + {% endif %} + {% endif %} + {% if metadata.source or metadata.source_url %}{% if metadata.license or metadata.license_url %}·{% endif %} + Source des données : {% if metadata.source_url %} + + {% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}{% endif %} + {% endif %} + {% if metadata.about or metadata.about_url %}{% if metadata.license or metadata.license_url or metadata.source or metadata.source_url %}·{% endif %} + Plus d'informations : {% if metadata.about_url %} + + {% endif %}{{ metadata.about or metadata.about_url }}{% if metadata.about_url %}{% endif %} + {% endif %} +

+{% endif %} diff --git a/datasette/templates/_footer.html b/datasette/templates/_footer.html new file mode 100644 index 0000000..dcf46fd --- /dev/null +++ b/datasette/templates/_footer.html @@ -0,0 +1,23 @@ +Propulsé par Datasette + +{% if metadata %} + {% if metadata.license or metadata.license_url %}· Licence des données : + {% if metadata.license_url %} + {{ metadata.license or metadata.license_url }} + {% else %} + {{ metadata.license }} + {% endif %} + {% endif %} + {% if metadata.source or metadata.source_url %}· + Source des données : {% if metadata.source_url %} + + {% endif %}{{ metadata.source or metadata.source_url }}{% if metadata.source_url %}{% endif %} + {% endif %} + · Code source : Github + {% if metadata.about or metadata.about_url %}· + Plus d'informations : {% if metadata.about_url %} + + {% endif %}{{ metadata.about or metadata.about_url }}{% if metadata.about_url %}{% endif %} + {% endif %} + · Mentions légales +{% endif %} diff --git a/datasette/templates/_table.html b/datasette/templates/_table.html new file mode 100644 index 0000000..ccc2d9c --- /dev/null +++ b/datasette/templates/_table.html @@ -0,0 +1,34 @@ +{% if display_rows %} +
+ + + + {% for column in display_columns %} + + {% endfor %} + + + + {% for row in display_rows %} + + {% for cell in row %} + + {% endfor %} + + {% endfor %} + +
+ {% if not column.sortable %} + {{ column.name }} + {% else %} + {% if column.name == sort %} + {{ column.name }} ▼ + {% else %} + {{ column.name }}{% if column.name == sort_desc %} ▲{% endif %} + {% endif %} + {% endif %} +
{% if cell.column == "titulaire.id" or cell.column == "acheteur.id" %}{{ cell.value }}{% elif cell.column == "codeAPE" %} {{ cell.value }} {% else %}{{ cell.value }}{% endif %}
+
+{% else %} +

0 lignes

+{% endif %} diff --git a/datasette/templates/about.html b/datasette/templates/about.html new file mode 100644 index 0000000..290fd9d --- /dev/null +++ b/datasette/templates/about.html @@ -0,0 +1,3 @@ +{% extends "base.html" %} + +

Coucou

diff --git a/datasette/templates/allow_debug.html b/datasette/templates/allow_debug.html new file mode 100644 index 0000000..0f1b30f --- /dev/null +++ b/datasette/templates/allow_debug.html @@ -0,0 +1,58 @@ +{% extends "base.html" %} + +{% block title %}Debug allow rules{% endblock %} + +{% block extra_head %} + +{% endblock %} + +{% block content %} + +

Debug allow rules

+ +

Use this tool to try out different actor and allow combinations. See Defining permissions with "allow" blocks for documentation.

+ +
+
+

+ +
+
+

+ +
+
+ +
+
+ +{% if error %}

{{ error }}

{% endif %} + +{% if result == "True" %}

Result: allow

{% endif %} + +{% if result == "False" %}

Result: deny

{% endif %} + +{% endblock %} diff --git a/datasette/templates/base.html b/datasette/templates/base.html new file mode 100644 index 0000000..874aa19 --- /dev/null +++ b/datasette/templates/base.html @@ -0,0 +1,85 @@ + + + + {% block title %}{% endblock %} + + + +{% for url in extra_css_urls %} + +{% endfor %} +{% for url in extra_js_urls %} + +{% endfor %} +{% block extra_head %}{% endblock %} + + + + + + + + + +
+ +{% block messages %} +{% if show_messages %} + {% for message, message_type in show_messages() %} +

{{ message }}

+ {% endfor %} +{% endif %} +{% endblock %} + +
+{% block content %} +{% endblock %} +
+ + + +{% include "_close_open_menus.html" %} + +{% for body_script in body_scripts %} + {{ body_script.script }} +{% endfor %} + +{% if select_templates %}{% endif %} + + diff --git a/datasette/templates/database.html b/datasette/templates/database.html new file mode 100644 index 0000000..97a99cb --- /dev/null +++ b/datasette/templates/database.html @@ -0,0 +1,113 @@ +{% extends "base.html" %} + +{% block title %}{{ database }}{% endblock %} + +{% block extra_head %} +{{ super() }} +{% include "_codemirror.html" %} +{% endblock %} + +{% block body_class %}db db-{{ database|to_css_class }}{% endblock %} + +{% block nav %} +

+ accueil +

+ {{ super() }} +{% endblock %} + +{% block content %} + + + + + + + +{% if attached_databases %} +
+

The following databases are attached to this connection, and can be used for cross-database joins:

+ +
+{% endif %} + +

decp.info vous permet d'explorer les données à travers différentes vues. Selon que vous soyez plutôt intéressé·e par le montant, les titulaires ou les caractériques d'un marché public, une vue vous sera plus utile qu'une autre.

+ +{% for table in tables %} +{% if show_hidden or not table.hidden %} +
+

{{ metadata.tables[table.name].title }}{% if table.private %} 🔒{% endif %}{% if table.hidden %} (hidden){% endif %}

+

Description : {{ metadata.tables[table.name].description_html | safe }} (CSV)

+

Colonnes : {% for column in table.columns %}{{ column }}{% if not loop.last %}, {% endif %}{% endfor %}

+

{% if table.count is none %}{% else %}{{ "{:,}".format(table.count) }} ligne{% if table.count == 1 %}{% else %}s{% endif %}{% endif %}

+
+{% endif %} +{% endfor %} + +{% if hidden_count and not show_hidden %} +

... and {{ "{:,}".format(hidden_count) }} hidden table{% if hidden_count == 1 %}{% else %}s{% endif %}

+{% endif %} + +{% if views %} +

Views

+ +{% endif %} + +{% if queries %} +

Queries

+ +{% endif %} + + +{% if allow_execute_sql %} +
+

Requête SQL personnalisée

+

+

+ + +

+
+{% endif %} + +{% if allow_download %} +

Download SQLite DB: {{ database }}.db {{ format_bytes(size) }}

+{% endif %} + +{% include "_codemirror_foot.html" %} + +{% endblock %} diff --git a/datasette/templates/error.html b/datasette/templates/error.html new file mode 100644 index 0000000..3aa13ea --- /dev/null +++ b/datasette/templates/error.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block title %}{% if title %}{{ title }}{% else %}Error {{ status }}{% endif %}{% endblock %} + +{% block nav %} +

+ accueil +

+ {{ super() }} +{% endblock %} + +{% block content %} + +

{% if title %}{{ title }}{% else %}Erreur {{ status }}{% endif %}

+ +
{{ error }}
+ +{% endblock %} diff --git a/datasette/templates/index.html b/datasette/templates/index.html new file mode 100644 index 0000000..f382bfd --- /dev/null +++ b/datasette/templates/index.html @@ -0,0 +1,38 @@ +{% extends "base.html" %} + +{% block title %}{{ metadata.title or "Datasette" }}: {% for database in databases %}{{ database.name }}{% if not loop.last %}, {% endif %}{% endfor %}{% endblock %} + +{% block body_class %}index{% endblock %} + +{% block content %} +

{{ metadata.title or "Datasette" }}{% if private %} 🔒{% endif %}

+ +{% block description_source_license %}{% include "_description_source_license.html" %}{% endblock %} + +

Explorer les données

+ +

Présentation / FAQ / discussions

+ +

Notes de version

+ +

Se tenir informé des nouveautés de decp.info

+ +

colin+decp@maudry.com

+ + + +{% endblock %} diff --git a/datasette/templates/logout.html b/datasette/templates/logout.html new file mode 100644 index 0000000..9873867 --- /dev/null +++ b/datasette/templates/logout.html @@ -0,0 +1,25 @@ +{% extends "base.html" %} + +{% block title %}Log out{% endblock %} + +{% block nav %} +

+ home +

+ {{ super() }} +{% endblock %} + +{% block content %} + +

Log out

+ +

You are logged in as {{ display_actor(actor) }}

+ +
+
+ + +
+
+ +{% endblock %} diff --git a/datasette/templates/messages_debug.html b/datasette/templates/messages_debug.html new file mode 100644 index 0000000..e0ab9a4 --- /dev/null +++ b/datasette/templates/messages_debug.html @@ -0,0 +1,27 @@ +{% extends "base.html" %} + +{% block title %}Debug messages{% endblock %} + +{% block content %} + +

Debug messages

+ +

Set a message:

+ +
+
+ +
+ +
+ + +
+
+ +{% endblock %} diff --git a/datasette/templates/pages/inscription.html b/datasette/templates/pages/inscription.html new file mode 100644 index 0000000..e68dd42 --- /dev/null +++ b/datasette/templates/pages/inscription.html @@ -0,0 +1,240 @@ +{% extends "base.html" %} +{% block title %}Se tenir informé{% endblock %} +{% block nav %} +

+ accueil +

+ {{ super() }} +{% endblock %} +{% block content %} + +

Se tenir informé des nouveautés de decp.info

+ +

Mentions légales et politique de confidentialité

+ + + + + + + + +
+
+
+
+ + + + + Il y a eu un problème lors de votre inscription. + +
+
+
+
+
+ + + + + Votre inscription à la lettre d'information de decp.info est confirmée ! + +
+
+
+
+
+
+
+
+

Inscrivez-vous à la lettre d'information de decp.info afin d'être informé·e de l'ajout de nouvelles fonctionnalités (2 mails par mois maximum).

+
+
+
+
+
+
+
+ + +
+ +
+
+ + +
+
+
+
+
+
+
+ + +
+ +
+
+ + +
+
+
+
+
+
+
+ + +
+ +
+
+ + +
+
+
+
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ + + + + + + + + + +
+

+ Nous utilisons Sendinblue en tant que plateforme marketing. En soumettant ce formulaire, vous reconnaissez que les informations que vous allez fournir seront transmises à Sendinblue en sa qualité de processeur de données; et ce conformément à ses + conditions générales d'utilisation. +

+
+ +
+
+
+ +
+
+ + + +
+
+
+
+ + + + + + + + + + +{% endblock %} diff --git a/datasette/templates/pages/mentions-legales.html b/datasette/templates/pages/mentions-legales.html new file mode 100644 index 0000000..8ed79c7 --- /dev/null +++ b/datasette/templates/pages/mentions-legales.html @@ -0,0 +1,53 @@ +{% extends "base.html" %} +{% block title %}Mentions légales{% endblock %} +{% block nav %} +

+ accueil +

+ {{ super() }} +{% endblock %} +{% block content %} + +
+ +

Mentions légales

+ +

Le site decp.info est édité par Colin Maudry, inscrit au répertoire SIRENE sous le numéro 812 231 132, dont le siège social est situé à Rennes, et dont l'adresse email est colin@maudry.com.

+

Le site est hébergé en France par :

+ +

Scaleway par ONLINE, SAS, au capital de 214 410,50 Euros
+Siège social : 8 rue de la ville l'Evêque-75008 PARIS
+RCS Paris B 433 115 904, TVA FR35433115904
+https://www.scaleway.com

+ +

Les icônes de la page d'accueil ont été dessinées par Gregor Cresnar de www.flaticon.com

+ + +

Vie privée

+ +

Les cookies

+ + +

Ce site dépose un petit fichier texte (un « cookie ») sur votre ordinateur lorsque vous le consultez (Wikipédia). Cela me permet de mesurer le nombre de visites et de distinguer les nouveaux visiteurs des utilisateurs réguliers.

+ +
+ +

Ce site n’affiche pas de bannière de consentement aux cookies, pourquoi ?

+ +

C’est vrai, vous n’avez pas eu à cliquer sur un bloc qui recouvre la moitié de la page pour dire que vous êtes d’accord avec le dépôt de cookies.

+ +

Rien d’exceptionnel, je respecte simplement la loi, qui dit que certains outils de suivi d’audience, correctement configurés pour respecter la vie privée, sont exemptés d’autorisation préalable.

+ +

J’utilise pour cela Matomo, un outil libre, paramétré pour être en conformité avec la recommandation « Cookies » de la CNIL. Cela signifie que votre adresse IP, par exemple, est anonymisée avant d’être enregistrée. Il m’est donc impossible d’associer vos visites sur ce site à votre personne.

+

La lettre d'information et conformité RGPD

+ +Ce site vous propose de vous inscrire à une lettre d'information. Pour ce faire, vous devez donner votre accord par deux fois : au moment de remplir le formulaire, et en cliquant sur un lien dans le mail de confirmation. + +Tous les emails qui vous sont envoyés dans le cadre de cette lettre d'information comportent un lien de désinscription. + +Votre adresse email est stockée en France chez Sendinblue, entreprise française. +
+ + + +{% endblock %} diff --git a/datasette/templates/pages/versions.html b/datasette/templates/pages/versions.html new file mode 100644 index 0000000..a2ce7ba --- /dev/null +++ b/datasette/templates/pages/versions.html @@ -0,0 +1,14 @@ +{% extends "base.html" %} +{% block title %}Mentions légales{% endblock %} +{% block nav %} +

+ accueil +

+ {{ super() }} +{% endblock %} +{% block content %} + +
+

Notes de version

+ +
\ No newline at end of file diff --git a/datasette/templates/patterns.html b/datasette/templates/patterns.html new file mode 100644 index 0000000..3f9b5a1 --- /dev/null +++ b/datasette/templates/patterns.html @@ -0,0 +1,495 @@ + + + + Datasette: Pattern Portfolio + + + + + + + +
+ +
+

Pattern Portfolio

+
+ + + + +

Header for /database/table/row and Messages

+ +
+ +
+ +

Example message

+

Example message

+

Example message

+ +

.bd for /

+
+

Datasette Fixtures

+ +

+ Data license: + Apache License 2.0 + · + Data source: + + tests/fixtures.py + · + About: + + About Datasette +

+

fixtures

+

+ 1,258 rows in 24 tables, 206 rows in 5 hidden tables, 4 views +

+

compound_three_primary_keys, sortable, facetable, roadside_attraction_characteristics, simple_primary_key, ...

+

data

+

+ 6 rows in 2 tables +

+

names, foo

+
+ +

.bd for /database

+
+ + + +

+ Data license: + Apache License 2.0 + · + Data source: + + tests/fixtures.py + · + About: + + About Datasette +

+
+

Custom SQL query

+

+

+ + +

+
+
+

123_starts_with_digits

+

content

+

0 rows

+
+
+

Table With Space In Name

+

pk, content

+

0 rows

+
+
+

attraction_characteristic

+

pk, name

+

2 rows

+
+
+ +

.bd for /database/table

+ +
+ + +

+ Data license: + Apache License 2.0 + · + Data source: + + tests/fixtures.py + · + About: + + About Datasette +

+

3 rows + where characteristic_id = 2 +

+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+ + +
+
+ +
+

2 extra where clauses

+ +
+ +

View and edit SQL

+ + + +

+ Suggested facets: tags, created (date), tags (array) +

+ +
+ +
+

+ tags (array) + + + +

+ +
+ +
+

+ created + + + +

+ +
+ +
+

+ city_id + + + +

+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Link + + rowid ▼ + + attraction_id + + characteristic_id +
1The Mystery Spot 1Paranormal 2
2Winchester Mystery House 2Paranormal 2
3Bigfoot Discovery Museum 4Paranormal 2
+
+

Advanced export

+

JSON shape: + default, + array, + newline-delimited +

+
+

+ CSV options: + + + + + +

+
+
+
CREATE TABLE roadside_attraction_characteristics (
+    attraction_id INTEGER REFERENCES roadside_attractions(pk),
+    characteristic_id INTEGER REFERENCES attraction_characteristic(pk)
+);
+
+ +

.bd for /database/table/row

+
+

roadside_attractions: 2

+

This data as json

+ + + + + + + + + + + + + + + + + + + +
+ pk + + name + + address + + latitude + + longitude +
2Winchester Mystery House525 South Winchester Boulevard, San Jose, CA 9512837.3184-121.9511
+

Links from other tables

+ +
+ +

.ft

+ + + +{% include "_close_open_menus.html" %} + + + diff --git a/datasette/templates/permissions_debug.html b/datasette/templates/permissions_debug.html new file mode 100644 index 0000000..d898ea8 --- /dev/null +++ b/datasette/templates/permissions_debug.html @@ -0,0 +1,55 @@ +{% extends "base.html" %} + +{% block title %}Debug permissions{% endblock %} + +{% block extra_head %} + +{% endblock %} + +{% block nav %} +

+ home +

+ {{ super() }} +{% endblock %} + +{% block content %} + +

Recent permissions checks

+ +{% for check in permission_checks %} +
+

+ {{ check.action }} + checked at + {{ check.when }} + {% if check.result %} + + {% else %} + + {% endif %} + {% if check.used_default %} + (used default) + {% endif %} +

+

Actor: {{ check.actor|tojson }}

+ {% if check.resource %} +

Resource: {{ check.resource }}

+ {% endif %} +
+{% endfor %} + +{% endblock %} diff --git a/datasette/templates/query.html b/datasette/templates/query.html new file mode 100644 index 0000000..9b3fff2 --- /dev/null +++ b/datasette/templates/query.html @@ -0,0 +1,87 @@ +{% extends "base.html" %} + +{% block title %}{{ database }}{% if query and query.sql %}: {{ query.sql }}{% endif %}{% endblock %} + +{% block extra_head %} +{{ super() }} +{% if columns %} + +{% endif %} +{% include "_codemirror.html" %} +{% endblock %} + +{% block body_class %}query db-{{ database|to_css_class }}{% if canned_query %} query-{{ canned_query|to_css_class }}{% endif %}{% endblock %} + +{% block nav %} +

+ home / + {{ database }} +

+ {{ super() }} +{% endblock %} + +{% block content %} + +

{{ metadata.title or database }}{% if canned_query and not metadata.title %}: {{ canned_query }}{% endif %}{% if private %} 🔒{% endif %}

+ +{% block description_source_license %}{% include "_description_source_license.html" %}{% endblock %} + +
+

Custom SQL query{% if display_rows %} returning {% if truncated %}more than {% endif %}{{ "{:,}".format(display_rows|length) }} row{% if display_rows|length == 1 %}{% else %}s{% endif %}{% endif %} {% if hide_sql %}(show){% else %}(hide){% endif %}

+ {% if not hide_sql %} + {% if editable and allow_execute_sql %} +

+ {% else %} +
{% if query %}{{ query.sql }}{% endif %}
+ {% endif %} + {% else %} + + + {% endif %} + {% if named_parameter_values %} +

Query parameters

+ {% for name, value in named_parameter_values.items() %} +

+ {% endfor %} + {% endif %} +

+ + {% if canned_write %}{% endif %} + + {% if canned_query and edit_sql_url %}Edit SQL{% endif %} +

+
+ +{% if display_rows %} + +
+ + + {% for column in columns %}{% endfor %} + + + + {% for row in display_rows %} + + {% for column, td in zip(columns, row) %} + + {% endfor %} + + {% endfor %} + +
{{ column }}
{{ td }}
+{% else %} + {% if not canned_write %} +

0 results

+ {% endif %} +{% endif %} + +{% include "_codemirror_foot.html" %} + +{% endblock %} diff --git a/datasette/templates/row.html b/datasette/templates/row.html new file mode 100644 index 0000000..5823110 --- /dev/null +++ b/datasette/templates/row.html @@ -0,0 +1,49 @@ +{% extends "base.html" %} + +{% block title %}{{ database }}: {{ table }}{% endblock %} + +{% block extra_head %} +{{ super() }} + +{% endblock %} + +{% block body_class %}row db-{{ database|to_css_class }} table-{{ table|to_css_class }}{% endblock %} + +{% block nav %} +

+ accueil / + {{ database }} / + {{ table }} +

+ {{ super() }} +{% endblock %} + +{% block content %} +

{{ table }}: {{ ', '.join(primary_key_values) }}

+ +{% block description_source_license %}{% include "_description_source_license.html" %}{% endblock %} + +

Télcharger ces données au format {% for name, url in renderers.items() %}{{ name }}{{ ", " if not loop.last }}{% endfor %}

+ +{% include custom_table_templates %} + +{% if foreign_key_tables %} +

Liens depuis d'autres tables

+ +{% endif %} + +{% endblock %} diff --git a/datasette/templates/show_json.html b/datasette/templates/show_json.html new file mode 100644 index 0000000..fd88756 --- /dev/null +++ b/datasette/templates/show_json.html @@ -0,0 +1,19 @@ +{% extends "base.html" %} + +{% block title %}{{ filename }}{% endblock %} + +{% block body_class %}show-json{% endblock %} + +{% block nav %} +

+ home +

+ {{ super() }} +{% endblock %} + +{% block content %} +

{{ filename }}

+ +
{{ data_json }}
+ +{% endblock %} diff --git a/datasette/templates/table.html b/datasette/templates/table.html new file mode 100644 index 0000000..c2baa94 --- /dev/null +++ b/datasette/templates/table.html @@ -0,0 +1,216 @@ +{% extends "base.html" %} + +{% block title %}{{ database }}: {{ table }}: {% if filtered_table_rows_count or filtered_table_rows_count == 0 %}{{ "{:,}".format(filtered_table_rows_count) }} ligne{% if filtered_table_rows_count == 1 %}{% else %}s{% endif %}{% endif %} + {% if human_description_en %}où {{ human_description_en }}{% endif %}{% endblock %} + +{% block extra_head %} +{{ super() }} + + +{% endblock %} + + +{% block body_class %}table db-{{ database|to_css_class }} table-{{ table|to_css_class }}{% endblock %} + +{% block nav %} +

+ accueil / + {{ database }} +

+ {{ super() }} +{% endblock %} + +{% block content %} + + +{% block description_source_license %}{% include "_description_source_license.html" %}{% endblock %} + +{% if filtered_table_rows_count or human_description_en %} +

{% if filtered_table_rows_count or filtered_table_rows_count == 0 %}{{ "{:,}".format(filtered_table_rows_count) }} ligne{% if filtered_table_rows_count == 1 %}{% else %}s{% endif %}{% endif %} + {% if human_description_en %}{{ human_description_en }}{% endif %} +

+{% endif %} + +
+ {% if supports_search %} +
+ {% endif %} + {% for column, lookup, value in filters.selections() %} +
+
+ +
+ +
+
+ {% endfor %} +
+
+ +
+ +
+
+
+ {% if is_sortable %} +
+ +
+ + {% endif %} + {% for key, value in form_hidden_args %} + + {% endfor %} + +
+
+ +{% if extra_wheres_for_ui %} +
+

{{ extra_wheres_for_ui|length }} extra where clause{% if extra_wheres_for_ui|length != 1 %}s{% endif %}

+ +
+{% endif %} + + + + + + + +{% include custom_table_templates %} + +{% if next_url %} +

Page suivante

+{% endif %} + + + + + +{% endblock %} diff --git a/scripts/start-datasette.sh b/scripts/start-datasette.sh new file mode 100755 index 0000000..8e1df31 --- /dev/null +++ b/scripts/start-datasette.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +echo "Get data..." +wget -nv https://www.data.gouv.fr/fr/datasets/r/c6b08d03-7aa4-4132-b5b2-fd76633feecc -O datasette/db.db + +datasette inspect datasette/*.db --inspect-file=datasette/inspect-data.json + +echo "Starting datasette..." +datasette datasette/ --port 9090 --cors | grep -v "/static/"