{"id":16026993,"url":"https://github.com/alexpdev/piecelength","last_synced_at":"2025-10-14T12:56:10.391Z","repository":{"id":38849457,"uuid":"389847669","full_name":"alexpdev/piecelength","owner":"alexpdev","description":"Calculating Ideal Piece Length for .torrent files","archived":false,"fork":false,"pushed_at":"2022-10-25T06:04:14.000Z","size":25,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T06:51:25.123Z","etag":null,"topics":["bencode","bittorrent-protocol","torrent-files"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexpdev.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}},"created_at":"2021-07-27T04:26:36.000Z","updated_at":"2023-02-09T11:18:45.000Z","dependencies_parsed_at":"2022-09-18T03:55:59.427Z","dependency_job_id":null,"html_url":"https://github.com/alexpdev/piecelength","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpdev%2Fpiecelength","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpdev%2Fpiecelength/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpdev%2Fpiecelength/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexpdev%2Fpiecelength/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexpdev","download_url":"https://codeload.github.com/alexpdev/piecelength/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243901090,"owners_count":20366251,"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":["bencode","bittorrent-protocol","torrent-files"],"created_at":"2024-10-08T20:04:32.638Z","updated_at":"2025-10-14T12:56:05.371Z","avatar_url":"https://github.com/alexpdev.png","language":"Python","readme":"# Piece Length\n\nCalculate ideal piece length for .torrent files.\n\nPiece Length(`piecelength`) is a simple package that sole purpose is to calculate\nthe ideal piece length for the Bittorrent protocol based on the total size of\nthe torrent contents.  Results are returned in integer form, and will always\nbe a perfect power of 2.\n\n## Install\n\nThe `piecelength` package can be installed from git:\n\n```sh\ngit clone https://github.com/alexpdev/piecelength.git\ncd piecelength\npip install .\n```\n\nIt is also available on PyPi:\n\n```sh\npip install piecelength\n```\n\n## Usage\n\nTo use the package as library:\n\n```python\nfrom piecelength import piece_length\n\nsize = 100000000 # some integer value\nresult = piece_length(size)\n```\n\nIt can also be used from the command line:\n\n```sh\npiecelength 3456677434645\n```\n\n## License\n\nLicensed with BSD 3 see the LICENSE file for more details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpdev%2Fpiecelength","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexpdev%2Fpiecelength","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexpdev%2Fpiecelength/lists"}