{"id":31782331,"url":"https://github.com/zopefoundation/products.btreefolder2","last_synced_at":"2025-10-10T09:18:51.832Z","repository":{"id":7124505,"uuid":"8419477","full_name":"zopefoundation/Products.BTreeFolder2","owner":"zopefoundation","description":"A BTree based implementation for Zope's OFS.","archived":false,"fork":false,"pushed_at":"2025-03-17T07:49:37.000Z","size":357,"stargazers_count":3,"open_issues_count":0,"forks_count":8,"subscribers_count":64,"default_branch":"master","last_synced_at":"2025-09-22T04:47:56.454Z","etag":null,"topics":["maintained"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zopefoundation.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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":"2013-02-25T22:14:11.000Z","updated_at":"2025-03-17T07:49:41.000Z","dependencies_parsed_at":"2024-06-14T17:29:42.611Z","dependency_job_id":null,"html_url":"https://github.com/zopefoundation/Products.BTreeFolder2","commit_stats":{"total_commits":99,"total_committers":15,"mean_commits":6.6,"dds":0.595959595959596,"last_synced_commit":"541d261c6b1945f3af95e4a24940642ce3634154"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/zopefoundation/Products.BTreeFolder2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2FProducts.BTreeFolder2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2FProducts.BTreeFolder2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2FProducts.BTreeFolder2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2FProducts.BTreeFolder2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zopefoundation","download_url":"https://codeload.github.com/zopefoundation/Products.BTreeFolder2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zopefoundation%2FProducts.BTreeFolder2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003410,"owners_count":26083581,"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-10-10T02:00:06.843Z","response_time":62,"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":["maintained"],"created_at":"2025-10-10T09:18:50.616Z","updated_at":"2025-10-10T09:18:51.821Z","avatar_url":"https://github.com/zopefoundation.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Overview\n========\n\nBTreeFolder2 is a Zope product that acts like a Zope 2 OFS folder but can\nstore many more items.\n\nWhen you fill a Zope folder with too many items, both Zope and your\nbrowser get overwhelmed.  Zope has to load and store a large folder\nobject, and the browser has to render large HTML tables repeatedly.\nZope can store a lot of objects, but it has trouble storing a lot of\nobjects in a single standard folder.\n\nZope Corporation once had an extensive discussion on the subject.  It\nwas decided that we would expand standard folders to handle large\nnumbers of objects gracefully.  Unfortunately, Zope folders are used\nand extended in so many ways today that it would be difficult to\nmodify standard folders in a way that would be compatible with all\nZope products.\n\nSo the BTreeFolder product was born.  It stored all subobjects in a\nZODB BTree, a structure designed to allow many items without loading\nthem all into memory.  It also rendered the contents of the folder as\na simple select list rather than a table.  Most browsers have no\ntrouble rendering large select lists.\n\nBut there was still one issue remaining.  BTreeFolders still stored\nthe ID of all subobjects in a single database record.  If you put tens\nof thousands of items in a single BTreeFolder, you would still be\nloading and storing a multi-megabyte folder object.  Zope can do this,\nbut not quickly, and not without bloating the database.\n\nBTreeFolder2 solves this issue.  It stores not only the subobjects but\nalso the IDs of the subobjects in a BTree.  It also batches the list\nof items in the UI, showing only 1000 items at a time.  So if you\nwrite your application carefully, you can use a BTreeFolder2 to store\nas many items as will fit in physical storage.\n\nThere are products that depend on the internal structure of the\noriginal BTreeFolder, however.  So rather than risk breaking those\nproducts, the product has been renamed.  You can have both products\ninstalled at the same time.  If you're developing new applications,\nyou should use BTreeFolder2.\n\n\nUsage\n=====\n\nThe BTreeFolder2 user interface shows a list of items rather than a\nseries of checkboxes. To visit an item, select it in the list and\nclick the \"edit\" button.\n\nBTreeFolder2 objects provide Python dictionary-like methods to make them\neasier to use in Python code than standard folders::\n\n    has_key(key)\n    keys()\n    values()\n    items()\n    get(key, default=None)\n    __len__()\n\nkeys(), values(), and items() return sequences, but not necessarily\ntuples or lists.  Use len(folder) to call the __len__() method.  The\nobjects returned by values() and items() have acquisition wrappers.\n\nBTreeFolder2 also provides a method for generating unique,\nnon-overlapping IDs::\n\n    generateId(prefix='item', suffix='', rand_ceiling=999999999)\n\nThe ID returned by this method is guaranteed to not clash with any\nother ID in the folder.  Use the returned value as the ID for new\nobjects.  The generated IDs tend to be sequential so that objects that\nare likely related in some way get loaded together.\n\nBTreeFolder2 implements the full Folder interface, with the exception\nthat the superValues() method does not return any items.  To implement\nthe method in the way the Zope codebase expects would undermine the\nperformance benefits gained by using BTreeFolder2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopefoundation%2Fproducts.btreefolder2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzopefoundation%2Fproducts.btreefolder2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzopefoundation%2Fproducts.btreefolder2/lists"}