diff --git a/.gitignore b/.gitignore index 3997bea..ff28d7e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,7 @@ -*.db \ No newline at end of file +*.db +*.egg-info +__pycache__ +.idea +.venv +build +.env diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..bd6e4d4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-ast + - id: check-case-conflict + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black + args: [ --config=pyproject.toml ] + - repo: https://github.com/psf/black + rev: 23.3.0 + hooks: + - id: black-jupyter + args: [ --config=pyproject.toml ] + - repo: https://github.com/pre-commit/mirrors-prettier + rev: v2.5.1 + hooks: + - id: prettier + files: \.(js|css|html|json|md)$ diff --git a/.template.env b/.template.env new file mode 100644 index 0000000..5cbcdfa --- /dev/null +++ b/.template.env @@ -0,0 +1,3 @@ +DATA_FILE_PARQUET_PATH=https://www.data.gouv.fr/fr/datasets/r/11cea8e8-df3e-4ed1-932b-781e2635e432 +PORT=8050 +DEVELOPMENT=True diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 2b7a2c8..0000000 --- a/Pipfile +++ /dev/null @@ -1,14 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -datasette = "*" -openpyxl = "*" -datasette-cluster-map = {git = "https://github.com/ColinMaudry/datasette-cluster-map.git"} - -[dev-packages] - -[requires] -python_version = "3" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index e003c26..0000000 --- a/Pipfile.lock +++ /dev/null @@ -1,348 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "f41809c4a9d8321eb4b3ab4af7c59601e3066356ff054e612e3cdcd2a06a98be" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "aiofiles": { - "hashes": [ - "sha256:1142fa8e80dbae46bb6339573ad4c8c0841358f79c6eb50a493dceca14621bad", - "sha256:9107f1ca0b2a5553987a94a3c9959fe5b491fdf731389aa5b7b1bd0733e32de6" - ], - "markers": "python_version >= '3.7' and python_version < '4.0'", - "version": "==22.1.0" - }, - "anyio": { - "hashes": [ - "sha256:25ea0d673ae30af41a0c442f81cf3b38c7e79fdc7b60335a4c14e05eb0947421", - "sha256:fbbe32bd270d2a2ef3ed1c5d45041250284e31fc0a4df4a5a6071842051a51e3" - ], - "markers": "python_full_version >= '3.6.2'", - "version": "==3.6.2" - }, - "asgi-csrf": { - "hashes": [ - "sha256:6e9d3bddaeac1a8fd33b188fe2abc8271f9085ab7be6e1a7f4d3c9df5d7f741a", - "sha256:e974cffb8a4ab84a28a0088acbf7a4ecc5be4a64f08dcbe19c60dea103da01c0" - ], - "version": "==0.9" - }, - "asgiref": { - "hashes": [ - "sha256:71e68008da809b957b7ee4b43dbccff33d1b23519fb8344e33f049897077afac", - "sha256:9567dfe7bd8d3c8c892227827c41cce860b368104c3431da67a0c5a65a949506" - ], - "markers": "python_version >= '3.7'", - "version": "==3.6.0" - }, - "certifi": { - "hashes": [ - "sha256:35824b4c3a97115964b408844d64aa14db1cc518f6562e8d7261699d1350a9e3", - "sha256:4ad3232f5e926d6718ec31cfc1fcadfde020920e278684144551c91769c7bc18" - ], - "markers": "python_version >= '3.6'", - "version": "==2022.12.7" - }, - "click": { - "hashes": [ - "sha256:7682dc8afb30297001674575ea00d1814d808d6a36af415a82bd481d37ba7b8e", - "sha256:bb4d8133cb15a609f44e8213d9b391b0809795062913b383c62be0ee95b1db48" - ], - "markers": "python_version >= '3.7'", - "version": "==8.1.3" - }, - "click-default-group-wheel": { - "hashes": [ - "sha256:1599b0b6e0ff63ee806c2cb76593cb8cc73e723cd53532c92bc496dc6fc90e5c", - "sha256:e90da42d92c03e88a12ed0c0b69c8a29afb5d36e3dc8d29c423ba4219e6d7747" - ], - "version": "==1.2.2" - }, - "datasette": { - "hashes": [ - "sha256:7253c244ab35b537b2aa5ac239d24fd101af4a46caef11ee06a727b1db4e64ca", - "sha256:ca30c37e515400b3ba1b07dfe51093238e33baca75ccf3d163645cf5b3c80fd5" - ], - "index": "pypi", - "version": "==0.64.1" - }, - "datasette-cluster-map": { - "git": "https://github.com/ColinMaudry/datasette-cluster-map.git", - "ref": "ab9c0d79448efbd737d9487bfcee227246ef3b87" - }, - "datasette-leaflet": { - "hashes": [ - "sha256:8fd4e634304be392ae6f7de770d4f22b95a37caecd676a35faeb6200da9423bc", - "sha256:fd88c25666e7680b25b4c6e5546bd02c9f5836bbc0fee61042dbb6b93d4139f0" - ], - "markers": "python_version >= '3.6'", - "version": "==0.2.2" - }, - "et-xmlfile": { - "hashes": [ - "sha256:8eb9e2bc2f8c97e37a2dc85a09ecdcdec9d8a396530a6d5a33b30b9a92da0c5c", - "sha256:a2ba85d1d6a74ef63837eed693bcb89c3f752169b0e3e7ae5b16ca5e1b3deada" - ], - "markers": "python_version >= '3.6'", - "version": "==1.1.0" - }, - "h11": { - "hashes": [ - "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d", - "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761" - ], - "markers": "python_version >= '3.7'", - "version": "==0.14.0" - }, - "httpcore": { - "hashes": [ - "sha256:c5d6f04e2fc530f39e0c077e6a30caa53f1451096120f1f38b954afd0b17c0cb", - "sha256:da1fb708784a938aa084bde4feb8317056c55037247c787bd7e19eb2c2949dc0" - ], - "markers": "python_version >= '3.7'", - "version": "==0.16.3" - }, - "httpx": { - "hashes": [ - "sha256:9818458eb565bb54898ccb9b8b251a28785dd4a55afbc23d0eb410754fe7d0f9", - "sha256:a211fcce9b1254ea24f0cd6af9869b3d29aba40154e947d2a07bb499b3e310d6" - ], - "markers": "python_version >= '3.7'", - "version": "==0.23.3" - }, - "hupper": { - "hashes": [ - "sha256:15c11bd775d8f98095b745b4e658a17c25c86e3b73275cae896ac1c8d533cb18", - "sha256:2ae554e0fb7daf4cbd37a8c7e0419f6974614095a41a4529ad35fe3067b408a4" - ], - "markers": "python_version >= '3.7'", - "version": "==1.11" - }, - "idna": { - "hashes": [ - "sha256:814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4", - "sha256:90b77e79eaa3eba6de819a0c442c0b4ceefc341a7a2ab77d7562bf49f425c5c2" - ], - "version": "==3.4" - }, - "itsdangerous": { - "hashes": [ - "sha256:2c2349112351b88699d8d4b6b075022c0808887cb7ad10069318a8b0bc88db44", - "sha256:5dbbc68b317e5e42f327f9021763545dc3fc3bfe22e6deb96aaf1fc38874156a" - ], - "markers": "python_version >= '3.7'", - "version": "==2.1.2" - }, - "janus": { - "hashes": [ - "sha256:2596ea5482711c1ee3ef2df6c290aaf370a13c55a007826e8f7c32d696d1d00a", - "sha256:df976f2cdcfb034b147a2d51edfc34ff6bfb12d4e2643d3ad0e10de058cb1612" - ], - "markers": "python_version >= '3.7'", - "version": "==1.0.0" - }, - "jinja2": { - "hashes": [ - "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852", - "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61" - ], - "markers": "python_version >= '3.7'", - "version": "==3.1.2" - }, - "markupsafe": { - "hashes": [ - "sha256:0576fe974b40a400449768941d5d0858cc624e3249dfd1e0c33674e5c7ca7aed", - "sha256:085fd3201e7b12809f9e6e9bc1e5c96a368c8523fad5afb02afe3c051ae4afcc", - "sha256:090376d812fb6ac5f171e5938e82e7f2d7adc2b629101cec0db8b267815c85e2", - "sha256:0b462104ba25f1ac006fdab8b6a01ebbfbce9ed37fd37fd4acd70c67c973e460", - "sha256:137678c63c977754abe9086a3ec011e8fd985ab90631145dfb9294ad09c102a7", - "sha256:1bea30e9bf331f3fef67e0a3877b2288593c98a21ccb2cf29b74c581a4eb3af0", - "sha256:22152d00bf4a9c7c83960521fc558f55a1adbc0631fbb00a9471e097b19d72e1", - "sha256:22731d79ed2eb25059ae3df1dfc9cb1546691cc41f4e3130fe6bfbc3ecbbecfa", - "sha256:2298c859cfc5463f1b64bd55cb3e602528db6fa0f3cfd568d3605c50678f8f03", - "sha256:28057e985dace2f478e042eaa15606c7efccb700797660629da387eb289b9323", - "sha256:2e7821bffe00aa6bd07a23913b7f4e01328c3d5cc0b40b36c0bd81d362faeb65", - "sha256:2ec4f2d48ae59bbb9d1f9d7efb9236ab81429a764dedca114f5fdabbc3788013", - "sha256:340bea174e9761308703ae988e982005aedf427de816d1afe98147668cc03036", - "sha256:40627dcf047dadb22cd25ea7ecfe9cbf3bbbad0482ee5920b582f3809c97654f", - "sha256:40dfd3fefbef579ee058f139733ac336312663c6706d1163b82b3003fb1925c4", - "sha256:4cf06cdc1dda95223e9d2d3c58d3b178aa5dacb35ee7e3bbac10e4e1faacb419", - "sha256:50c42830a633fa0cf9e7d27664637532791bfc31c731a87b202d2d8ac40c3ea2", - "sha256:55f44b440d491028addb3b88f72207d71eeebfb7b5dbf0643f7c023ae1fba619", - "sha256:608e7073dfa9e38a85d38474c082d4281f4ce276ac0010224eaba11e929dd53a", - "sha256:63ba06c9941e46fa389d389644e2d8225e0e3e5ebcc4ff1ea8506dce646f8c8a", - "sha256:65608c35bfb8a76763f37036547f7adfd09270fbdbf96608be2bead319728fcd", - "sha256:665a36ae6f8f20a4676b53224e33d456a6f5a72657d9c83c2aa00765072f31f7", - "sha256:6d6607f98fcf17e534162f0709aaad3ab7a96032723d8ac8750ffe17ae5a0666", - "sha256:7313ce6a199651c4ed9d7e4cfb4aa56fe923b1adf9af3b420ee14e6d9a73df65", - "sha256:7668b52e102d0ed87cb082380a7e2e1e78737ddecdde129acadb0eccc5423859", - "sha256:7df70907e00c970c60b9ef2938d894a9381f38e6b9db73c5be35e59d92e06625", - "sha256:7e007132af78ea9df29495dbf7b5824cb71648d7133cf7848a2a5dd00d36f9ff", - "sha256:835fb5e38fd89328e9c81067fd642b3593c33e1e17e2fdbf77f5676abb14a156", - "sha256:8bca7e26c1dd751236cfb0c6c72d4ad61d986e9a41bbf76cb445f69488b2a2bd", - "sha256:8db032bf0ce9022a8e41a22598eefc802314e81b879ae093f36ce9ddf39ab1ba", - "sha256:99625a92da8229df6d44335e6fcc558a5037dd0a760e11d84be2260e6f37002f", - "sha256:9cad97ab29dfc3f0249b483412c85c8ef4766d96cdf9dcf5a1e3caa3f3661cf1", - "sha256:a4abaec6ca3ad8660690236d11bfe28dfd707778e2442b45addd2f086d6ef094", - "sha256:a6e40afa7f45939ca356f348c8e23048e02cb109ced1eb8420961b2f40fb373a", - "sha256:a6f2fcca746e8d5910e18782f976489939d54a91f9411c32051b4aab2bd7c513", - "sha256:a806db027852538d2ad7555b203300173dd1b77ba116de92da9afbc3a3be3eed", - "sha256:abcabc8c2b26036d62d4c746381a6f7cf60aafcc653198ad678306986b09450d", - "sha256:b8526c6d437855442cdd3d87eede9c425c4445ea011ca38d937db299382e6fa3", - "sha256:bb06feb762bade6bf3c8b844462274db0c76acc95c52abe8dbed28ae3d44a147", - "sha256:c0a33bc9f02c2b17c3ea382f91b4db0e6cde90b63b296422a939886a7a80de1c", - "sha256:c4a549890a45f57f1ebf99c067a4ad0cb423a05544accaf2b065246827ed9603", - "sha256:ca244fa73f50a800cf8c3ebf7fd93149ec37f5cb9596aa8873ae2c1d23498601", - "sha256:cf877ab4ed6e302ec1d04952ca358b381a882fbd9d1b07cccbfd61783561f98a", - "sha256:d9d971ec1e79906046aa3ca266de79eac42f1dbf3612a05dc9368125952bd1a1", - "sha256:da25303d91526aac3672ee6d49a2f3db2d9502a4a60b55519feb1a4c7714e07d", - "sha256:e55e40ff0cc8cc5c07996915ad367fa47da6b3fc091fdadca7f5403239c5fec3", - "sha256:f03a532d7dee1bed20bc4884194a16160a2de9ffc6354b3878ec9682bb623c54", - "sha256:f1cd098434e83e656abf198f103a8207a8187c0fc110306691a2e94a78d0abb2", - "sha256:f2bfb563d0211ce16b63c7cb9395d2c682a23187f54c3d79bfec33e6705473c6", - "sha256:f8ffb705ffcf5ddd0e80b65ddf7bed7ee4f5a441ea7d3419e861a12eaf41af58" - ], - "markers": "python_version >= '3.7'", - "version": "==2.1.2" - }, - "mergedeep": { - "hashes": [ - "sha256:0096d52e9dad9939c3d975a774666af186eda617e6ca84df4c94dec30004f2a8", - "sha256:70775750742b25c0d8f36c55aed03d24c3384d17c951b3175d898bd778ef0307" - ], - "markers": "python_version >= '3.6'", - "version": "==1.3.4" - }, - "openpyxl": { - "hashes": [ - "sha256:24d7d361025d186ba91eff58135d50855cf035a84371b891e58fb6eb5125660f", - "sha256:eccedbe1cdd8b2494057e73959b496821141038dbb7eb9266ea59e3f34208231" - ], - "index": "pypi", - "version": "==3.1.0" - }, - "pint": { - "hashes": [ - "sha256:387cf04078dc7dfe4a708033baad54ab61d82ab06c4ee3d4922b1e45d5626067", - "sha256:68afe65665542ee3ec99f69f043b1d39bfe7c6d61b786940157138fd08b838fb" - ], - "markers": "python_version >= '3.8'", - "version": "==0.20.1" - }, - "pluggy": { - "hashes": [ - "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159", - "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3" - ], - "markers": "python_version >= '3.6'", - "version": "==1.0.0" - }, - "python-multipart": { - "hashes": [ - "sha256:f7bb5f611fc600d15fa47b3974c8aa16e93724513b49b5f95c81e6624c83fa43" - ], - "version": "==0.0.5" - }, - "pyyaml": { - "hashes": [ - "sha256:01b45c0191e6d66c470b6cf1b9531a771a83c1c4208272ead47a3ae4f2f603bf", - "sha256:0283c35a6a9fbf047493e3a0ce8d79ef5030852c51e9d911a27badfde0605293", - "sha256:055d937d65826939cb044fc8c9b08889e8c743fdc6a32b33e2390f66013e449b", - "sha256:07751360502caac1c067a8132d150cf3d61339af5691fe9e87803040dbc5db57", - "sha256:0b4624f379dab24d3725ffde76559cff63d9ec94e1736b556dacdfebe5ab6d4b", - "sha256:0ce82d761c532fe4ec3f87fc45688bdd3a4c1dc5e0b4a19814b9009a29baefd4", - "sha256:1e4747bc279b4f613a09eb64bba2ba602d8a6664c6ce6396a4d0cd413a50ce07", - "sha256:213c60cd50106436cc818accf5baa1aba61c0189ff610f64f4a3e8c6726218ba", - "sha256:231710d57adfd809ef5d34183b8ed1eeae3f76459c18fb4a0b373ad56bedcdd9", - "sha256:277a0ef2981ca40581a47093e9e2d13b3f1fbbeffae064c1d21bfceba2030287", - "sha256:2cd5df3de48857ed0544b34e2d40e9fac445930039f3cfe4bcc592a1f836d513", - "sha256:40527857252b61eacd1d9af500c3337ba8deb8fc298940291486c465c8b46ec0", - "sha256:432557aa2c09802be39460360ddffd48156e30721f5e8d917f01d31694216782", - "sha256:473f9edb243cb1935ab5a084eb238d842fb8f404ed2193a915d1784b5a6b5fc0", - "sha256:48c346915c114f5fdb3ead70312bd042a953a8ce5c7106d5bfb1a5254e47da92", - "sha256:50602afada6d6cbfad699b0c7bb50d5ccffa7e46a3d738092afddc1f9758427f", - "sha256:68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2", - "sha256:77f396e6ef4c73fdc33a9157446466f1cff553d979bd00ecb64385760c6babdc", - "sha256:81957921f441d50af23654aa6c5e5eaf9b06aba7f0a19c18a538dc7ef291c5a1", - "sha256:819b3830a1543db06c4d4b865e70ded25be52a2e0631ccd2f6a47a2822f2fd7c", - "sha256:897b80890765f037df3403d22bab41627ca8811ae55e9a722fd0392850ec4d86", - "sha256:98c4d36e99714e55cfbaaee6dd5badbc9a1ec339ebfc3b1f52e293aee6bb71a4", - "sha256:9df7ed3b3d2e0ecfe09e14741b857df43adb5a3ddadc919a2d94fbdf78fea53c", - "sha256:9fa600030013c4de8165339db93d182b9431076eb98eb40ee068700c9c813e34", - "sha256:a80a78046a72361de73f8f395f1f1e49f956c6be882eed58505a15f3e430962b", - "sha256:afa17f5bc4d1b10afd4466fd3a44dc0e245382deca5b3c353d8b757f9e3ecb8d", - "sha256:b3d267842bf12586ba6c734f89d1f5b871df0273157918b0ccefa29deb05c21c", - "sha256:b5b9eccad747aabaaffbc6064800670f0c297e52c12754eb1d976c57e4f74dcb", - "sha256:bfaef573a63ba8923503d27530362590ff4f576c626d86a9fed95822a8255fd7", - "sha256:c5687b8d43cf58545ade1fe3e055f70eac7a5a1a0bf42824308d868289a95737", - "sha256:cba8c411ef271aa037d7357a2bc8f9ee8b58b9965831d9e51baf703280dc73d3", - "sha256:d15a181d1ecd0d4270dc32edb46f7cb7733c7c508857278d3d378d14d606db2d", - "sha256:d4b0ba9512519522b118090257be113b9468d804b19d63c71dbcf4a48fa32358", - "sha256:d4db7c7aef085872ef65a8fd7d6d09a14ae91f691dec3e87ee5ee0539d516f53", - "sha256:d4eccecf9adf6fbcc6861a38015c2a64f38b9d94838ac1810a9023a0609e1b78", - "sha256:d67d839ede4ed1b28a4e8909735fc992a923cdb84e618544973d7dfc71540803", - "sha256:daf496c58a8c52083df09b80c860005194014c3698698d1a57cbcfa182142a3a", - "sha256:dbad0e9d368bb989f4515da330b88a057617d16b6a8245084f1b05400f24609f", - "sha256:e61ceaab6f49fb8bdfaa0f92c4b57bcfbea54c09277b1b4f7ac376bfb7a7c174", - "sha256:f84fbc98b019fef2ee9a1cb3ce93e3187a6df0b2538a651bfb890254ba9f90b5" - ], - "markers": "python_version >= '3.6'", - "version": "==6.0" - }, - "rfc3986": { - "extras": [ - "idna2008" - ], - "hashes": [ - "sha256:270aaf10d87d0d4e095063c65bf3ddbc6ee3d0b226328ce21e036f946e421835", - "sha256:a86d6e1f5b1dc238b218b012df0aa79409667bb209e58da56d0b94704e712a97" - ], - "version": "==1.5.0" - }, - "six": { - "hashes": [ - "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926", - "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", - "version": "==1.16.0" - }, - "sniffio": { - "hashes": [ - "sha256:e60305c5e5d314f5389259b7f22aaa33d8f7dee49763119234af3755c55b9101", - "sha256:eecefdce1e5bbfb7ad2eeaabf7c1eeb404d7757c379bd1f7e5cce9d8bf425384" - ], - "markers": "python_version >= '3.7'", - "version": "==1.3.0" - }, - "typing-extensions": { - "hashes": [ - "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa", - "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e" - ], - "markers": "python_version >= '3.7'", - "version": "==4.4.0" - }, - "uvicorn": { - "hashes": [ - "sha256:a4e12017b940247f836bc90b72e725d7dfd0c8ed1c51eb365f5ba30d9f5127d8", - "sha256:c3ed1598a5668208723f2bb49336f4509424ad198d6ab2615b7783db58d919fd" - ], - "markers": "python_version >= '3.7'", - "version": "==0.20.0" - } - }, - "develop": {} -} diff --git a/README.md b/README.md index a1d5bee..ba10c99 100644 --- a/README.md +++ b/README.md @@ -7,16 +7,22 @@ Outil d'exploration et de téléchargement des données essentielles de la comma ## Installation et lancement ```shell -pipenv install -pipenv run scripts/start-datasette.sh +python -m venv .venv +source .venv/bin/activate +pip install . +gunicorn app:server ``` ## Dépôts de code connexes -- [decp-table-schema-utils](https://github.com/ColinMaudry/decp-table-schema-utils) (traitement et publication des données) +- [decp-processing](https://github.com/ColinMaudry/decp-processing) (traitement et publication des données) - [decp-table-schema](https://github.com/ColinMaudry/decp-table-schema) (schéma de données tabulaire) ## Notes de version +### 2.0.0-alpha + +- Data table fonctionnelle + ### 1.5.0 (28/01/2023 - fixation des dépendances Python pour plus de stabilité en cas de réinstallation (Pipfile) diff --git a/datasette/inspect-data.json b/datasette/inspect-data.json deleted file mode 100644 index e37c02e..0000000 --- a/datasette/inspect-data.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "db": { - "hash": "e9fe2958f1e9fb97d9b35868dd9985b127f36fb70b75a6f34a7e97769a1cb40d", - "size": 599478272, - "file": "datasette/db.db", - "tables": { - "decp": { - "count": 603271 - }, - "decp-sans-titulaires": { - "count": 527600 - }, - "decp-titulaires": { - "count": 295857 - } - } - } -} \ No newline at end of file diff --git a/datasette/metadata.yaml b/datasette/metadata.yaml deleted file mode 100644 index c92bde0..0000000 --- a/datasette/metadata.yaml +++ /dev/null @@ -1,146 +0,0 @@ ---- -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 - column_labels: - id: Identifiant - uid: Identifiant unique - acheteur.id: SIRET acheteur - acheteur.nom: Nom de l'acheteur - procedure: Procédure d'achat - nature: Nature - dureeMois: Durée du marché (mois) - dateNotification: Date de notification - datePublicationDonnees: Date de publication des données - montant: Montant - objet: Objet - codeCPV: Code CPV - formePrix: Forme du prix - lieuExecution.code: Code du lieu d'exécution - lieuExecution.typeCode: Code du lieu d'exécution (type) - lieuExecution.nom: Nom du lieu d'exécution - titulaire.id: Identifiant du titulaire - titulaire.typeIdentifiant: Identifiant du titulaire (type) - titulaire.denominationSociale: Nom du titulaire - objetModification: Objet de la modification - source: Source des données - donneesActuelles: Données actuelles ? - anomalies: Anomalies - operation_labels: - exact: est égal à - not: est différent de - contains: contient - endswith: finit par - startswith: commence par - gt: est supérieur à (>) - lt: est inférieur à (<) - lte: est inférieur ou égal à (<=) - gte: est supérieur ou égal à (>=) - isnull__1: est vide - notnull__1: n'est pas vide - 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 - column_labels: - id: Identifiant - uid: Identifiant unique - acheteur.id: SIRET acheteur - acheteur.nom: Nom de l'acheteur - procedure: Procédure d'achat - nature: Nature - dureeMois: Durée du marché (mois) - dateNotification: Date de notification - datePublicationDonnees: Date de publication des données - montant: Montant - objet: Objet - codeCPV: Code CPV - formePrix: Forme du prix - lieuExecution.code: Code du lieu d'exécution - lieuExecution.typeCode: Code du lieu d'exécution (type) - lieuExecution.nom: Nom du lieu d'exécution - objetModification: Objet de la modification - source: Source des données - donneesActuelles: Données actuelles ? - anomalies: Anomalies - operation_labels: - exact: est égal à - not: est différent de - contains: contient - endswith: finit par - startswith: commence par - gt: est supérieur à (>) - lt: est inférieur à (<) - lte: est inférieur ou égal à (<=) - gte: est supérieur ou égal à (>=) - isnull__1: est vide - notnull__1: n'est pas vide - decp-titulaires: - title: Données sur les titulaires et géolocalisation - description_html: Données détaillées sur les titulaires ayant un numéro SIRET, 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 - column_labels: - id: Identifiant - uid: Identifiant unique - acheteur.id: SIRET acheteur - acheteur.nom: Nom de l'acheteur - procedure: Procédure d'achat - nature: Nature - dureeMois: Durée du marché (mois) - dateNotification: Date de notification - datePublicationDonnees: Date de publication des données - montant: Montant - objet: Objet - codeCPV: Code CPV - formePrix: Forme du prix - lieuExecution.code: Code du lieu d'exécution - lieuExecution.typeCode: Code du lieu d'exécution (type) - lieuExecution.nom: Nom du lieu d'exécution - objetModification: Objet de la modification - source: Source des données - donneesActuelles: Données actuelles ? - anomalies: Anomalies - codeAPE: Code APE - departement: Département - categorie: Catégorie - categorieJuridique: Catégorie juridique - categorieJuridiqueLibelle1: Catégorie juridique niveau 1 - categorieJuridiqueLibelle2: Catégorie juridique niveau 2 - etatEtablissement: État établissement - etatEntreprise: État entreprise - longitude: Longitude - latitude: Latitude - titulaire.id: Identifiant du titulaire - titulaire.typeIdentifiant: Identifiant du titulaire (type) - titulaire.denominationSociale: Nom du titulaire - operation_labels: - exact: est égal à - not: est différent de - contains: contient - endswith: finit par - startswith: commence par - gt: est supérieur à (>) - lt: est inférieur à (<) - lte: est inférieur ou égal à (<=) - gte: est supérieur ou égal à (>=) - isnull__1: est vide - notnull__1: n'est pas vide \ No newline at end of file diff --git a/datasette/plugins/menu.py b/datasette/plugins/menu.py deleted file mode 100644 index ddf0b9a..0000000 --- a/datasette/plugins/menu.py +++ /dev/null @@ -1,12 +0,0 @@ -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 deleted file mode 100644 index 88bf4dd..0000000 --- a/datasette/plugins/xlsx.py +++ /dev/null @@ -1,75 +0,0 @@ -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 deleted file mode 100644 index 72aee1e..0000000 --- a/datasette/settings.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "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 -} diff --git a/datasette/static/custom.css b/datasette/static/custom.css deleted file mode 100644 index 041a6c7..0000000 --- a/datasette/static/custom.css +++ /dev/null @@ -1,178 +0,0 @@ -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; -} - - -.versions ul ul { - margin-left: 22px; -} - -div.select-wrapper { - width: 160px; -} - -div.select-wrapper.filter-op { - width: 160px; -} - - -/* -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 deleted file mode 100644 index d5f80f6..0000000 Binary files a/datasette/static/font/Flaticon.eot and /dev/null differ diff --git a/datasette/static/font/Flaticon.svg b/datasette/static/font/Flaticon.svg deleted file mode 100644 index b679e84..0000000 --- a/datasette/static/font/Flaticon.svg +++ /dev/null @@ -1,445 +0,0 @@ - - - - - -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 deleted file mode 100644 index 399bb49..0000000 Binary files a/datasette/static/font/Flaticon.ttf and /dev/null differ diff --git a/datasette/static/font/Flaticon.woff b/datasette/static/font/Flaticon.woff deleted file mode 100644 index 6bbf5e6..0000000 Binary files a/datasette/static/font/Flaticon.woff and /dev/null differ diff --git a/datasette/static/font/_flaticon.scss b/datasette/static/font/_flaticon.scss deleted file mode 100644 index 102084f..0000000 --- a/datasette/static/font/_flaticon.scss +++ /dev/null @@ -1,139 +0,0 @@ - /* - 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 deleted file mode 100644 index 1d54a8c..0000000 --- a/datasette/static/font/flaticon.css +++ /dev/null @@ -1,81 +0,0 @@ - /* - 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 deleted file mode 100644 index f638216..0000000 --- a/datasette/static/font/flaticon.html +++ /dev/null @@ -1,705 +0,0 @@ - - - - - - - - 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 deleted file mode 100644 index 524f1b5..0000000 Binary files a/datasette/static/icons/1024.png and /dev/null differ diff --git a/datasette/static/icons/favicon.ico b/datasette/static/icons/favicon.ico deleted file mode 100644 index 93135a5..0000000 Binary files a/datasette/static/icons/favicon.ico and /dev/null differ diff --git a/datasette/static/icons/icon-192x192.png b/datasette/static/icons/icon-192x192.png deleted file mode 100644 index 3ed8591..0000000 Binary files a/datasette/static/icons/icon-192x192.png and /dev/null differ diff --git a/datasette/static/icons/icon-256x256.png b/datasette/static/icons/icon-256x256.png deleted file mode 100644 index 805a4cf..0000000 Binary files a/datasette/static/icons/icon-256x256.png and /dev/null differ diff --git a/datasette/static/icons/icon-384x384.png b/datasette/static/icons/icon-384x384.png deleted file mode 100644 index 7f96df3..0000000 Binary files a/datasette/static/icons/icon-384x384.png and /dev/null differ diff --git a/datasette/static/icons/icon-512x512.png b/datasette/static/icons/icon-512x512.png deleted file mode 100644 index 91f8938..0000000 Binary files a/datasette/static/icons/icon-512x512.png and /dev/null differ diff --git a/datasette/static/manifest.webmanifest b/datasette/static/manifest.webmanifest deleted file mode 100644 index a7c389a..0000000 --- a/datasette/static/manifest.webmanifest +++ /dev/null @@ -1,33 +0,0 @@ -{ - "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 deleted file mode 100644 index 65eebdd..0000000 --- a/datasette/templates/_close_open_menus.html +++ /dev/null @@ -1,16 +0,0 @@ - diff --git a/datasette/templates/_codemirror.html b/datasette/templates/_codemirror.html deleted file mode 100644 index a17eaf9..0000000 --- a/datasette/templates/_codemirror.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - diff --git a/datasette/templates/_codemirror_foot.html b/datasette/templates/_codemirror_foot.html deleted file mode 100644 index ee09cff..0000000 --- a/datasette/templates/_codemirror_foot.html +++ /dev/null @@ -1,38 +0,0 @@ - diff --git a/datasette/templates/_description_source_license.html b/datasette/templates/_description_source_license.html deleted file mode 100644 index c24f321..0000000 --- a/datasette/templates/_description_source_license.html +++ /dev/null @@ -1,30 +0,0 @@ -{% 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 deleted file mode 100644 index 8e83afc..0000000 --- a/datasette/templates/_footer.html +++ /dev/null @@ -1,23 +0,0 @@ -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 deleted file mode 100644 index b10bae4..0000000 --- a/datasette/templates/_table.html +++ /dev/null @@ -1,34 +0,0 @@ -{% if display_rows %} -
- - - - {% for column in display_columns %} - - {% endfor %} - - - - {% for row in display_rows %} - - {% for cell in row %} - - {% endfor %} - - {% endfor %} - -
- {% if not column.sortable %} - {{ metadata.column_labels[column.name] }} - {% else %} - {% if column.name == sort %} - {{ metadata.column_labels[column.name] }} ▼ - {% else %} - {{ metadata.column_labels[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 deleted file mode 100644 index 290fd9d..0000000 --- a/datasette/templates/about.html +++ /dev/null @@ -1,3 +0,0 @@ -{% extends "base.html" %} - -

Coucou

diff --git a/datasette/templates/allow_debug.html b/datasette/templates/allow_debug.html deleted file mode 100644 index 0f1b30f..0000000 --- a/datasette/templates/allow_debug.html +++ /dev/null @@ -1,58 +0,0 @@ -{% 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 deleted file mode 100644 index dbf99e5..0000000 --- a/datasette/templates/base.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - {% 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 deleted file mode 100644 index 97a99cb..0000000 --- a/datasette/templates/database.html +++ /dev/null @@ -1,113 +0,0 @@ -{% 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 deleted file mode 100644 index 3aa13ea..0000000 --- a/datasette/templates/error.html +++ /dev/null @@ -1,18 +0,0 @@ -{% 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 deleted file mode 100644 index ddda39b..0000000 --- a/datasette/templates/index.html +++ /dev/null @@ -1,38 +0,0 @@ -{% 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 %}

- - -

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 deleted file mode 100644 index 9873867..0000000 --- a/datasette/templates/logout.html +++ /dev/null @@ -1,25 +0,0 @@ -{% 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 deleted file mode 100644 index e0ab9a4..0000000 --- a/datasette/templates/messages_debug.html +++ /dev/null @@ -1,27 +0,0 @@ -{% 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 deleted file mode 100644 index e68dd42..0000000 --- a/datasette/templates/pages/inscription.html +++ /dev/null @@ -1,240 +0,0 @@ -{% 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 deleted file mode 100644 index 8ed79c7..0000000 --- a/datasette/templates/pages/mentions-legales.html +++ /dev/null @@ -1,53 +0,0 @@ -{% 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 deleted file mode 100644 index dc05133..0000000 --- a/datasette/templates/pages/versions.html +++ /dev/null @@ -1,98 +0,0 @@ -{% extends "base.html" %} -{% block title %}Notes de version{% endblock %} -{% block nav %} -

- accueil -

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

Notes de version

- - -

1.4.1 (14/06/2021)

- - - -

1.4.0 (14/06/2021)

- - - -

1.3.0 (03/06/2021)

- - - - -

1.2.0 (28/05/2021)

- - - -

1.1.0 (25/05/2021)

- - - -

1.0.0

- - - -
- -{% endblock %} \ No newline at end of file diff --git a/datasette/templates/patterns.html b/datasette/templates/patterns.html deleted file mode 100644 index 3f9b5a1..0000000 --- a/datasette/templates/patterns.html +++ /dev/null @@ -1,495 +0,0 @@ - - - - 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 deleted file mode 100644 index d898ea8..0000000 --- a/datasette/templates/permissions_debug.html +++ /dev/null @@ -1,55 +0,0 @@ -{% 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 deleted file mode 100644 index 9b3fff2..0000000 --- a/datasette/templates/query.html +++ /dev/null @@ -1,87 +0,0 @@ -{% 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 deleted file mode 100644 index 5823110..0000000 --- a/datasette/templates/row.html +++ /dev/null @@ -1,49 +0,0 @@ -{% 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 deleted file mode 100644 index fd88756..0000000 --- a/datasette/templates/show_json.html +++ /dev/null @@ -1,19 +0,0 @@ -{% 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 deleted file mode 100644 index a4a1fae..0000000 --- a/datasette/templates/table.html +++ /dev/null @@ -1,221 +0,0 @@ -{% 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 %} - -

-{% 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/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..835bb7f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,20 @@ +[project] +name = "decp.info" +description = "" +version = "2.0.0" +requires-python = ">= 3.10" +authors = [ + { name = "Colin Maudry", email = "colin+decp@maudry.com" } +] +dependencies = [ + "dash", + "polars", + "gunicorn", + "dash-bootstrap-components", + "python-dotenv", +] + +[project.optional-dependencies] +dev = [ + "pre-commit", +] diff --git a/run.py b/run.py new file mode 100644 index 0000000..0c750a9 --- /dev/null +++ b/run.py @@ -0,0 +1,9 @@ +from os import getenv +from src.app import app + +# To use `gunicorn run:server` (prod) +server = app.server + +# To use `python run.py` (dev) +if __name__ == "__main__": + app.run(debug=True) diff --git a/scripts/start-datasette.sh b/scripts/start-datasette.sh deleted file mode 100755 index 49b8d54..0000000 --- a/scripts/start-datasette.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -echo "Getting data from data.gouv.fr..." -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/" diff --git a/src/__init__.py b/src/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/app.py b/src/app.py new file mode 100644 index 0000000..878302a --- /dev/null +++ b/src/app.py @@ -0,0 +1,68 @@ +from dash import Dash, html, page_container, page_registry, dcc +import dash_bootstrap_components as dbc + + +app = Dash(external_stylesheets=[dbc.themes.UNITED], title="decp.info", use_pages=True) + +app.index_string = """ + + + + {%metas%} + {%title%} + {%favicon%} + {%css%} + + + {%app_entry%} + +