{"id":20984293,"url":"https://github.com/okawo80085/lose","last_synced_at":"2025-08-11T21:06:37.446Z","repository":{"id":62576914,"uuid":"206877077","full_name":"okawo80085/lose","owner":"okawo80085","description":"A helper package for data handling","archived":false,"fork":false,"pushed_at":"2022-01-09T20:53:07.000Z","size":67,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-26T16:25:15.451Z","etag":null,"topics":["data-management","data-processing","data-science","python"],"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/okawo80085.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}},"created_at":"2019-09-06T21:32:08.000Z","updated_at":"2022-01-09T20:53:10.000Z","dependencies_parsed_at":"2022-11-03T19:07:13.409Z","dependency_job_id":null,"html_url":"https://github.com/okawo80085/lose","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/okawo80085/lose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okawo80085%2Flose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okawo80085%2Flose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okawo80085%2Flose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okawo80085%2Flose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okawo80085","download_url":"https://codeload.github.com/okawo80085/lose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okawo80085%2Flose/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269956371,"owners_count":24503155,"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","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-management","data-processing","data-science","python"],"created_at":"2024-11-19T05:53:00.976Z","updated_at":"2025-08-11T21:06:37.400Z","avatar_url":"https://github.com/okawo80085.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://github.com/okawo80085/lose/workflows/unit%20tests/badge.svg)\n# lose\n\nwrapper for `PyTables`, has 3 classes rn:\n\n`Loser` - base data handler, run `help()` for more info\n\n`HumanIterator` - iterator, run `help()` for more info\n\n`LOSE` - a mistake\n\n```python\n\u003e\u003e\u003e import lose\n(;^ω^)\n\u003e\u003e\u003e # base data handler class\n\u003e\u003e\u003e l = lose.Loser('test.h5', verboseRepr=True)\n\u003e\u003e\u003e l\n\u003close.dataHandler.Loser fname=\"test.h5\", fast_active=False, verboseRepr=True at 0x7fe872fe8730\u003e\ntest.h5 (File) ''\nLast modif.: '2022-01-09T20:15:03+00:00'\nObject Tree: \n/ (RootGroup) ''\n/x (EArray(100, 640, 480)) ''\n/y (EArray(100, 2)) ''\n\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e # allows loading data\n\u003e\u003e\u003e l.load('x', 'y')\n# list of [array of x, array of y], i.e. a bunch of data\n\u003e\u003e\u003e # as well as saving data\n\u003e\u003e\u003e l.save(x=np.ones((400, 640, 480)), y=np.ones((300, 2)))\n\u003e\u003e\u003e l\n\u003close.dataHandler.Loser fname=\"test.h5\", fast_active=False, verboseRepr=True at 0x7fe872fe8730\u003e\ntest.h5 (File) ''\nLast modif.: '2022-01-09T20:20:23+00:00'\nObject Tree: \n/ (RootGroup) ''\n/x (EArray(500, 640, 480)) ''\n/y (EArray(400, 2)) ''\n\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e # as well as creating new labels\n\u003e\u003e\u003e l.new_group(z=(15,), k=(21, 3))\n\u003e\u003e\u003e l\n\u003close.dataHandler.Loser fname=\"test.h5\", fast_active=False, verboseRepr=True at 0x7fe872fe8730\u003e\ntest.h5 (File) ''\nLast modif.: '2022-01-09T20:22:02+00:00'\nObject Tree: \n/ (RootGroup) ''\n/k (EArray(0, 21, 3)) ''\n/x (EArray(500, 640, 480)) ''\n/y (EArray(400, 2)) ''\n/z (EArray(0, 15)) ''\n\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e # after a new label was created it can be used for saving arrays\n\u003e\u003e\u003e l.save(z=np.zeros((10, 15)), k=np.zeros((50, 21, 3)))\n\u003e\u003e\u003e l\n\u003close.dataHandler.Loser fname=\"test.h5\", fast_active=False, verboseRepr=True at 0x7fe872fe8730\u003e\ntest.h5 (File) ''\nLast modif.: '2022-01-09T20:23:56+00:00'\nObject Tree: \n/ (RootGroup) ''\n/k (EArray(50, 21, 3)) ''\n/x (EArray(500, 640, 480)) ''\n/y (EArray(400, 2)) ''\n/z (EArray(10, 15)) ''\n\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e # labels can be removed\n\u003e\u003e\u003e l.remove_group('y', 'z')\n\u003e\u003e\u003e l\n\u003close.dataHandler.Loser fname=\"test.h5\", fast_active=False, verboseRepr=True at 0x7f343a4e2730\u003e\ntest.h5 (File) ''\nLast modif.: '2022-01-09T20:26:41+00:00'\nObject Tree: \n/ (RootGroup) ''\n/k (EArray(50, 21, 3)) ''\n/x (EArray(500, 640, 480)) ''\n\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e # as well as renamed\n\u003e\u003e\u003e l.rename_group(x='input', k='output')\n\u003e\u003e\u003e l\n\u003close.dataHandler.Loser fname=\"test.h5\", fast_active=False, verboseRepr=True at 0x7f343a4e2730\u003e\ntest.h5 (File) ''\nLast modif.: '2022-01-09T20:28:07+00:00'\nObject Tree: \n/ (RootGroup) ''\n/input (EArray(500, 640, 480)) ''\n/output (EArray(50, 21, 3)) ''\n\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e# and to get shapes of labels call l.get_shapes\n\u003e\u003e\u003e l.get_shapes('input', 'output')\n[(500, 640, 480), (50, 21, 3)]\n\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e # load, save and get_shape methods work in \"fast\" mode, \"fast\" mode allows the file open lifetime to be handled outside of the load/save/get_shape calls, to enter \"fast\" mode pass your data handler instance to a context manger, recommended to be used when performing a lot of iterations over the stored data, here is an example:\n\u003e\u003e\u003e with l:\n...     for _ in range(200):\n...             l.load('input', 'output')\n# *a bunch of data*\n\n\u003e\u003e\u003e\n\u003e\u003e\u003e\n\u003e\u003e\u003e # there is also an iterator, for more info on it's arguments, checkout help(lose.HumanIterator)\n\u003e\u003e\u003e iter = lose.HumanIterator('test.h5', 'input', 'output', limit=40)\n\n\u003e\u003e\u003e for i in iter:\n...     print(i)\n# i on each step will be [batch from 'input' array, batch from 'output' array], these batches depend on the initial iterator parameters\n```\n\n## installation\n```\npip install lose\n```\n\nor\n\n```\npip install -e .\n```\n\nor \n\n```\npip install git+https://github.com/okawo80085/lose\n```\n\n## docs\n\ncode comments and doc strings\n\n## issues/contributions/what ever\njust do it\n\n\n[change log](changeLog.md)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokawo80085%2Flose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokawo80085%2Flose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokawo80085%2Flose/lists"}