{"id":14977831,"url":"https://github.com/root-11/tablite","last_synced_at":"2025-10-28T07:30:31.506Z","repository":{"id":41327126,"uuid":"275381874","full_name":"root-11/tablite","owner":"root-11","description":"multiprocessing enabled out-of-memory data analysis library for tabular data.","archived":false,"fork":false,"pushed_at":"2024-04-22T11:57:02.000Z","size":26368,"stargazers_count":36,"open_issues_count":4,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-22T12:05:55.858Z","etag":null,"topics":["data-analysis","data-science","datatype","disk","etl","excel","filereader","pandas","pivot-tables","python","table","tabular-data"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/root-11.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2020-06-27T13:51:07.000Z","updated_at":"2024-05-10T11:35:14.372Z","dependencies_parsed_at":"2023-02-14T16:16:10.519Z","dependency_job_id":"e05849af-0408-4759-b7cd-7c6a37f00c6a","html_url":"https://github.com/root-11/tablite","commit_stats":{"total_commits":1411,"total_committers":11,"mean_commits":"128.27272727272728","dds":0.5492558469170801,"last_synced_commit":"97af15a40f2ed31f6acdeeae2361888021ddf1bf"},"previous_names":[],"tags_count":101,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/root-11%2Ftablite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/root-11%2Ftablite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/root-11%2Ftablite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/root-11%2Ftablite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/root-11","download_url":"https://codeload.github.com/root-11/tablite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238608262,"owners_count":19500347,"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":["data-analysis","data-science","datatype","disk","etl","excel","filereader","pandas","pivot-tables","python","table","tabular-data"],"created_at":"2024-09-24T13:56:24.329Z","updated_at":"2025-10-28T07:30:31.499Z","avatar_url":"https://github.com/root-11.png","language":"Python","readme":"# Tablite\n\n![Build status](https://github.com/root-11/tablite/actions/workflows/python-test.yml/badge.svg)\n[![codecov](https://codecov.io/gh/root-11/tablite/branch/master/graph/badge.svg?token=A0QEWGO9R6)](https://codecov.io/gh/root-11/tablite)\n[![Downloads](https://pepy.tech/badge/tablite)](https://pepy.tech/project/tablite)\n[![Downloads](https://pepy.tech/badge/tablite/month)](https://pepy.tech/project/tablite)\n[![PyPI version](https://badge.fury.io/py/tablite.svg)](https://badge.fury.io/py/tablite)\n\n--------------\n\n## Contents\n\n- [introduction](#introduction)\n- [installation](#installation)\n- [feature overview](#feature_overview)\n- [api](#api)\n- [tutorial](#tutorial)\n- [latest updates](#latest_updates)\n- [credits](#credits)\n\n## \u003ca name=\"introduction\"\u003e\u003c/a\u003eIntroduction \n\n`Tablite` seeks to be the go-to library for manipulating tabular data with an api that is as close in syntax to pure python as possible. \n\n\n### Even smaller memory footprint\n\nTablite uses [numpys fileformat](https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html) as a backend with strong abstraction, so that copy, append \u0026 repetition of data is handled in pages. This is imperative for [incremental data processing](https://raw.githubusercontent.com/root-11/tablite/74e7b44cfc314950b7a769316cb48d67cce725d0/images/incremental_dataprocessing.svg).\n\nTablite tests [for memory footprint](https://github.com/root-11/tablite/blob/master/tests/test_memory_footprint.py). One test compares the memory footprint of 10,000,000 integers where `tablite` will use \u003c 1 Mb RAM in contrast to python which will require around 133.7 Mb of RAM (1M lists with 10 integers). Tablite also tests to assure that working with [1Tb of data](https://github.com/root-11/tablite/blob/9bb6e572538a85aee31ef8a4a60c0945a6f857a4/tests/test_filereader_performance.py#L104) is tolerable.\n\nTablite achieves this minimal memory footprint by using a temporary storage set in `config.Config.workdir` as `tempfile.gettempdir()/tablite-tmp`.\nIf your OS (windows/linux/mac) sits on a SSD this will benefit from high IOPS and permit slices of [9,000,000,000 rows in less than a second](https://github.com/root-11/tablite/blob/master/images/1TB_test.png?raw=true).\n\n### Multiprocessing enabled by default\n\nTablite uses numpy whereever possible and applies multiprocessing for bypassing the GIL on all major operations. \nCSV import is performed in C through using `nim`s compiler and is as fast the hardware allows.\n\n### All algorithms have been reworked to respect memory limits\n\nTablite respects the limits of free memory by tagging the free memory and defining task size before each memory intensive task is initiated (join, groupby, data import, etc).\nIf you still run out of memory you may try to reduce the `config.Config.PAGE_SIZE` and rerun your program.\n\n### 100% support for all python datatypes\n\nTablite wants to make it easy for you to work with data. `tablite.Table's` behave like a dict with lists:\n\n`my_table[column name] = [... data ...]`.\n\nTablite uses datatype mapping to native numpy types where possible and uses type mapping for non-native types such as timedelta, None, date, time… e.g. what you put in, is what you get out. This is inspired by [bank python](https://calpaterson.com/bank-python.html).\n\n### Light weight\n\nTablite is ~400 kB.\n\n### Helpful\n\nTablite wants you to be productive, so a number of helpers are available. \n\n- `Table.import_file` to import csv*, tsv, txt, xls, xlsx, xlsm, ods, zip and logs. There is automatic type detection (see [tutorial.ipynb](https://nbviewer.org/github/root-11/tablite/blob/master/tutorial.ipynb) )\n- To peek into any supported file use `get_headers` which shows the first 10 rows.\n- Use `mytable.rows` and `mytable.columns` to iterate over rows or columns.\n- Create multi-key `.index` for quick lookups.\n- Perform multi-key `.sort`,\n- Filter using `.any` and `.all` to select specific rows.\n- use multi-key `.lookup` and `.join` to find data across tables.\n- Perform `.groupby` and reorganise data as a `.pivot` table with max, min, sum, first, last, count, unique, average, st.deviation, median and mode\n- Append / concatenate tables with `+=` which automatically sorts out the columns - even if they're not in perfect order.\n- Should you tables be similar but not the identical you can use `.stack` to \"stack\" tables on top of each other\n\nIf you're still missing something add it to the [wishlist](https://github.com/root-11/tablite/issues)\n\n\n---------------\n\n## \u003ca name=\"installation\"\u003e\u003c/a\u003eInstallation\n\nGet it from pypi: [![PyPI version](https://badge.fury.io/py/tablite.svg)](https://badge.fury.io/py/tablite)\n\nInstall: `pip install tablite`  \nUsage:  `\u003e\u003e\u003e from tablite import Table`  \n\n## \u003ca name=\"build \u0026 test\"\u003e\u003c/a\u003eBuild \u0026 test\n\ninstall nim \u003e= 2.0.0\n\nrun: `chmod +x ./build_nim.sh`\nrun: `./build_nim.sh`\n\nShould the default nim not be your desired taste, please use `nims` environment manager (`atlas`) and run `source nim-2.0.0/activate.sh` on UNIX or `nim-2.0.0/activate.bat` on windows.\n\n```\ninstall python \u003e= 3.8\npython -m venv /your/venv/dir\nactivate /your/venv/dir\npip install -r requirements.txt\npip install -r requirements_for_testing.py\npytest ./tests\n```\n\n## \u003ca name=\"feature_overview\"\u003e\u003c/a\u003eFeature overview\n\n|want to...| this way... |\n|---|---|\n|loop over rows| `[ row for row in table.rows ]`|\n|loop over columns| `[ table[col_name] for col_name in table.columns ]`|\n|slice | `myslice = table['A', 'B', slice(0,None,15)]`|\n|get column by name | `my_table['A']` |\n|get row by index | `my_table[9_000_000_001]` |\n|value update| `mytable['A'][2] = new value` |\n|update w. list comprehension | `mytable['A'] = [ x*x for x in mytable['A'] if x % 2 != 0 ]`|\n|join| `a_join = numbers.join(letters, left_keys=['colour'], right_keys=['color'], left_columns=['number'], right_columns=['letter'], kind='left')`|\n| lookup| `travel_plan = friends.lookup(bustable, (DataTypes.time(21, 10), \"\u003c=\", 'time'), ('stop', \"==\", 'stop'))`|\n| groupby| `group_by = table.groupby(keys=['C', 'B'], functions=[('A', gb.count)])`|\n| pivot table | `my_pivot = t.pivot(rows=['C'], columns=['A'], functions=[('B', gb.sum), ('B', gb.count)], values_as_rows=False)`|\n| index| `indices = old_table.index(*old_table.columns)`|\n| sort| `lookup1_sorted = lookup_1.sort(**{'time': True, 'name':False, \"sort_mode\":'unix'})`|\n| filter    | `true, false = unfiltered.filter( [{\"column1\": 'a', \"criteria\":\"\u003e=\", 'value2':3}, ... more criteria ... ], filter_type='all' )`|\n| find any  | `any_even_rows = mytable.any('A': lambda x : x%2==0, 'B': lambda x \u003e 0)`|\n| find all  | `all_even_rows = mytable.all('A': lambda x : x%2==0, 'B': lambda x \u003e 0)`|\n| to json   | `json_str = my_table.to_json()`|\n| from json | `Table.from_json(json_str)`|\n\n## \u003ca name=\"api\"\u003e\u003c/a\u003eAPI\n\nTo view the detailed API see [api](https://root-11.github.io/tablite/latest/)\n\n## \u003ca name=\"tutorial\"\u003e\u003c/a\u003eTutorial\n\nTo learn more see the [tutorial.ipynb](https://github.com/root-11/tablite/blob/master/tutorial.ipynb) (Jupyter notebook)\n\n\n## \u003ca name=\"latest_updates\"\u003e\u003c/a\u003eLatest updates\n\nSee [changelog.md](https://github.com/root-11/tablite/blob/master/changelog.md)\n\n\n## \u003ca name=\"credits\"\u003e\u003c/a\u003eCredits\n\n- [Eugene Antonov](https://github.com/Jetman80) - the api documentation.\n- [Audrius Kulikajevas](https://github.com/realratchet) - Edge case testing / various bugs, Jupyter notebook integration.\n- [Ovidijus Grigas](https://github.com/omenSi) - various bugs, documentation.\n- Martynas Kaunas - GroupBy functionality.\n- Sergej Sinkarenko - various bugs.\n- Lori Cooper - spell checking.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froot-11%2Ftablite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froot-11%2Ftablite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froot-11%2Ftablite/lists"}