{"id":10758,"date":"2023-09-01T18:50:00","date_gmt":"2023-09-01T16:50:00","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=10758"},"modified":"2023-09-01T08:53:10","modified_gmt":"2023-09-01T06:53:10","slug":"using-csv-file-as-data-storage-and-access","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2023\/09\/01\/using-csv-file-as-data-storage-and-access\/","title":{"rendered":"Using CSV File as data storage and access"},"content":{"rendered":"\n<p>Thanks <a class=\"\" href=\"https:\/\/forum.djangoproject.com\/u\/adamchainz\">adamchainz<\/a>!<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>You can use \u201cCSV\u201d table storage in (at least) these database backends:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>SQLite: <a href=\"https:\/\/www.sqlite.org\/csv.html\">https:\/\/www.sqlite.org\/csv.html 42<\/a><\/li>\n\n\n\n<li>MySQL\/MariaDB via the \u201cCSV\u201d storage engine: <a href=\"https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/csv-storage-engine.html\">https:\/\/dev.mysql.com\/doc\/refman\/8.0\/en\/csv-storage-engine.html 15<\/a> . Or MariaDB via the CONNECT storage engine: <a href=\"https:\/\/mariadb.com\/kb\/en\/connect\/\">https:\/\/mariadb.com\/kb\/en\/connect\/ 1<\/a><\/li>\n<\/ul>\n\n\n\n<p>However these will be slow though. Changes to CSV based tables require a lot of parsing and re-saving.<\/p>\n\n\n\n<p>It\u2019s probably better to import the CSV into a table with an optimized storage engine, and export it again later. django-import-export can help with that: <a href=\"https:\/\/pypi.org\/project\/django-import-export\/\">https:\/\/pypi.org\/project\/django-import-export\/<\/a><\/p>\n\n\n\n<p><\/p>\n<cite>Source: <em><a href=\"https:\/\/forum.djangoproject.com\/t\/using-csv-file-as-data-storage-and-access\/1695\">Using CSV File as data storage and access<\/a><\/em><\/cite><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Thanks adamchainz!<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2023\/09\/01\/using-csv-file-as-data-storage-and-access\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[229,113,278],"tags":[],"class_list":["post-10758","post","type-post","status-publish","format-standard","hentry","category-django","category-python","category-tricks"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-2Nw","jetpack-related-posts":[{"id":9720,"url":"https:\/\/monodes.com\/predaelli\/2022\/10\/15\/uniform-exchange-format-uxf\/","url_meta":{"origin":10758,"position":0},"title":"Uniform eXchange Format (uxf)","author":"Paolo Redaelli","date":"2022-10-15","format":false,"excerpt":"Uniform eXchange Format (uxf) is a plain text human readable optionally typed storage format that supports custom types. It may serve as a convenient alternative to csv, ini, json, sqlite, toml, xml, or yaml. https:\/\/github.com\/mark-summerfield\/uxf Looks smart and interesting! Expecially this part: Implmenting a UXF pretty printer whould be doable\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/monodes.com\/predaelli\/category\/software\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9252,"url":"https:\/\/monodes.com\/predaelli\/2022\/04\/07\/hyperfine\/","url_meta":{"origin":10758,"position":1},"title":"hyperfine","author":"Paolo Redaelli","date":"2022-04-07","format":false,"excerpt":"hyperfine A command-line benchmarking tool. Demo: Benchmarking fd and find: Features Statistical analysis across multiple runs.Support for arbitrary shell commands.Constant feedback about the benchmark progress and current estimates.Warmup runs can be executed before the actual benchmark.Cache-clearing commands can be set up before each timing run.Statistical outlier detection to detect interference\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/monodes.com\/predaelli\/category\/software\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9674,"url":"https:\/\/monodes.com\/predaelli\/2022\/09\/28\/10-powerful-python-one-liners\/","url_meta":{"origin":10758,"position":2},"title":"10 Powerful Python One-Liners.","author":"Paolo Redaelli","date":"2022-09-28","format":false,"excerpt":"I shall Eiffellize those, one day or another: 10 Powerful Python One-Liners. Python one-liners can be just as\u2026 | by Ishaan Gupta | Sep, 2022 | Python in Plain English 10 Powerful Python One-Liners Python one-liners can be just as powerful as a long and tedious program written in another\u2026","rel":"","context":"In &quot;Agenda&quot;","block_context":{"text":"Agenda","link":"https:\/\/monodes.com\/predaelli\/category\/agenda\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2022\/09\/1jLSxNQvNqsYr02VB_wr96A.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2022\/09\/1jLSxNQvNqsYr02VB_wr96A.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2022\/09\/1jLSxNQvNqsYr02VB_wr96A.jpeg?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":11170,"url":"https:\/\/monodes.com\/predaelli\/2024\/01\/10\/unknown-pearls\/","url_meta":{"origin":10758,"position":3},"title":"Unknown pearls","author":"Paolo Redaelli","date":"2024-01-10","format":false,"excerpt":"I already knew many of the software listed in 40 Must-Have Free Open Source Applications for 2024 but of course, one never stop learning, so I discovered some interesting pearls unknown to me: Jaspersoft Studio is a report designer program that allows you to create simple and sophisticated reports as\u2026","rel":"","context":"In &quot;Software Libero&quot;","block_context":{"text":"Software Libero","link":"https:\/\/monodes.com\/predaelli\/category\/software\/software-libero\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2020\/02\/system-software-install.png?fit=256%2C256&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]},{"id":9404,"url":"https:\/\/monodes.com\/predaelli\/2022\/05\/30\/in-a-single-file\/","url_meta":{"origin":10758,"position":4},"title":"In a single file!","author":"Paolo Redaelli","date":"2022-05-30","format":false,"excerpt":"Adminer \u00ad A full-featured database management tool written in PHP, in a single PHP file Adminer is available for MySQL, MariaDB, PostgreSQL, SQLite, MS SQL, Oracle, Elasticsearch, MongoDB and others via plugin.","rel":"","context":"In &quot;PHP&quot;","block_context":{"text":"PHP","link":"https:\/\/monodes.com\/predaelli\/category\/php\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8190,"url":"https:\/\/monodes.com\/predaelli\/2021\/02\/21\/typeorm\/","url_meta":{"origin":10758,"position":5},"title":"Typeorm","author":"Paolo Redaelli","date":"2021-02-21","format":"link","excerpt":"typeorm.io is Object\u2013relational mapping for TypeScript and JavaScript (ES7, ES6, ES5). Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.","rel":"","context":"In &quot;Javascript&quot;","block_context":{"text":"Javascript","link":"https:\/\/monodes.com\/predaelli\/category\/javascript\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/10758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=10758"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/10758\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=10758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=10758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=10758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}