{"id":14985563,"url":"https://github.com/jean-philippe-martin/lcdio","last_synced_at":"2026-03-09T19:37:42.054Z","repository":{"id":255540076,"uuid":"852032307","full_name":"jean-philippe-martin/lcdio","owner":"jean-philippe-martin","description":"Lowest Common Denominator IO. Everything is a list of dictionaries!","archived":false,"fork":false,"pushed_at":"2024-09-04T22:04:48.000Z","size":380,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T10:21:54.676Z","etag":null,"topics":["csv","json","parquet","python3","sqlite","toml","tsv","yaml"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jean-philippe-martin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-04T05:31:58.000Z","updated_at":"2025-02-01T19:02:35.000Z","dependencies_parsed_at":"2024-09-06T01:01:21.415Z","dependency_job_id":"c5893d58-a4a1-4ca7-9683-80f2560170ab","html_url":"https://github.com/jean-philippe-martin/lcdio","commit_stats":null,"previous_names":["jean-philippe-martin/lcdio"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jean-philippe-martin%2Flcdio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jean-philippe-martin%2Flcdio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jean-philippe-martin%2Flcdio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jean-philippe-martin%2Flcdio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jean-philippe-martin","download_url":"https://codeload.github.com/jean-philippe-martin/lcdio/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239785278,"owners_count":19696742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csv","json","parquet","python3","sqlite","toml","tsv","yaml"],"created_at":"2024-09-24T14:11:13.022Z","updated_at":"2026-02-01T19:30:14.424Z","avatar_url":"https://github.com/jean-philippe-martin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lowest Common Denominator I/O\n\n\"Everything is a list of dictionaries!\"\n\nLCDIO lets you read through the records in the same way for \na variety of file formats:\n\n- csv\n- tsv\n- json\n- jsonl\n- parquet\n- field-separated text\n- SQLite\n- toml\n- yaml\n\n\n## Usage\n\nFor files with named columns: The file is a list of dictionaries (key is the column name).\n\n```python\nimport lcdio\n\nfile = lcdio.open('testdata/planets.parquet')\nfor row in file:\n  print(f'Planet {row[\"name\"]} is {row[\"distance\"]} light-seconds away from the sun.')\n```\n\nFor files without named columns: The file is a list of dictionaries (key is the column number).\n\n```python\nimport lcdio\n\nfile = lcdio.open('testdata/planets.csv')\nfor row in file:\n  print(f'Planet {row[0]} is {row[1]} light-seconds away from the sun.')\n```\n\n### Additional features\n\nThe rows returned by LCDIO are dict-like, but they have a few other features:\n\n- You can read multiple columns at a time (with slicing):\n\n```python\nimport lcdio\n\nfile = lcdio.open('testdata/planets.csv')\nfor row in file:\n  print(f'The first two columns are {row[0:2]}')\n```\n\nThis includes all the slicing syntax, such as skipping every other item (`row[::2]`), skipping the first one (`row[1:]`), skipping the last one (`row[:-1]`) etc.\n\n- You can use column index (and slices) even when the columns are named:\n\n```python\nimport lcdio\n\nfile = lcdio.open('testdata/planets.parquet')\nfor row in file:\n  print(f'Planet {row[0]}')\n```\n\n- If the row contains an array, you can access it by adding an argument:\n\n```python\n\u003e\u003e\u003e row['days_in_office']\n['monday', 'wednesday']\n\u003e\u003e\u003e row['days_in_office', 0]\n'monday'\n```\n\n- If the row contains a JSON object, you can access members by adding arguments:\n\n```python\n\u003e\u003e\u003e row[0]\n{'age': 30, 'secrets': {'password': 'foo', 'closet': '2 skeletons'}}\n\u003e\u003e\u003e row[0, 'secrets', 'password']\n'foo'\n```\n\n\n### Philosophy\n\nThis is not about making the most performant or the most featureful reader for these formats.\n\nWhat this is about is making the library that is the easiest to use for reading a bunch of formats.\nYou don't need to remember the names of all the specific libraries to import. You don't need to remember\neach of their syntax. \nYou only need to remember one thing: \"everything is a list of dictionaries.\"\n\n\n## Other options\n\nthe `open` method has a `mode` argument to tell it what format to read the file as (if it can't be guessed from the file extension, say), and a `has_header` argument to flag whether the `csv` has a header row or not.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjean-philippe-martin%2Flcdio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjean-philippe-martin%2Flcdio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjean-philippe-martin%2Flcdio/lists"}