{"id":20614379,"url":"https://github.com/cnstr/cnstr.py","last_synced_at":"2025-04-15T07:25:13.166Z","repository":{"id":43194752,"uuid":"439983017","full_name":"cnstr/cnstr.py","owner":"cnstr","description":"The official library for interacting with Canister in Python.","archived":false,"fork":false,"pushed_at":"2022-03-14T05:26:39.000Z","size":83,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T17:57:20.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cnstr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-19T22:35:40.000Z","updated_at":"2023-07-29T00:27:19.000Z","dependencies_parsed_at":"2022-08-31T15:11:14.051Z","dependency_job_id":null,"html_url":"https://github.com/cnstr/cnstr.py","commit_stats":null,"previous_names":["cnstr/canister.py"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnstr%2Fcnstr.py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnstr%2Fcnstr.py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnstr%2Fcnstr.py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cnstr%2Fcnstr.py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cnstr","download_url":"https://codeload.github.com/cnstr/cnstr.py/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248570614,"owners_count":21126474,"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":[],"created_at":"2024-11-16T11:12:35.706Z","updated_at":"2025-04-15T07:25:13.129Z","avatar_url":"https://github.com/cnstr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cnstr.py\n\n[![Downloads](https://img.shields.io/pypi/dm/cnstr)](https://pypi.org/project/cnstr/)\n[![License](https://img.shields.io/github/license/cnstr/canister.py)](https://github.com/cnstr/cnstr.py/blob/main/LICENSE)\n\nThe official library to interact with the Canister API in Python!\u003cbr\u003e\nFor more information about Canister, see our [website](https://canister.me/) and [documentation](https://docs.canister.me/)\n\n### Installation\n\nThe library is available as a wheel from [PyPi](https://pypi.org/project/cnstr/) and can be installed using `pip`\n\n```\npip install -U cnstr\n```\n\n### Documentation\n\nSee [here](./DOCUMENTATION.md) for all cnstr.py documentation.\n\n### Example Usage\n\nBelow is a goood example of how to use `cnstr.py`\n\n```py\n# Imports\nimport asyncio\n\nfrom canisterpy import (\n    Canister,\n    Package,\n    PackageSearchFields\n)\nfrom typing import List\n\nasync def main(package: str) -\u003e List[Package]:\n    # Setup a client (user agent is always required)\n    # so that we're capable of monitoring API calls\n    client = Canister(user_agent='Canister.py Example')\n\n    # Create and correctly setup search fields\n    fields = PackageSearchFields()\n    fields.set('name', True).set('author', True)\n\n    # Search for the given package query\n    # then, close the Canister client instance\n    packages = await client.search_package(package, fields)\n    await client.close()\n    \n    # Return the results of the Canister query\n    return packages\n    \nprint(asyncio.run(main('test')))\n```\n\n### Contributing\n\nSee [here](./CONTRIBUTING.md) for instructions on how to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnstr%2Fcnstr.py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcnstr%2Fcnstr.py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcnstr%2Fcnstr.py/lists"}