{"id":17550752,"url":"https://github.com/tmcclintock/cffi_example","last_synced_at":"2025-09-17T09:31:14.297Z","repository":{"id":98895968,"uuid":"99762494","full_name":"tmcclintock/cffi_example","owner":"tmcclintock","description":"This is a working example of how to use cffi when you have a bunch of already written .h and .c files that you want to bundle into some python code without using ctypes.","archived":false,"fork":false,"pushed_at":"2018-10-19T15:35:47.000Z","size":6,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-01T22:16:56.229Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmcclintock.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-08-09T03:45:59.000Z","updated_at":"2019-12-13T11:13:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"7dc0845c-d06c-4545-ac82-005a2a0fab6b","html_url":"https://github.com/tmcclintock/cffi_example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tmcclintock/cffi_example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcclintock%2Fcffi_example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcclintock%2Fcffi_example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcclintock%2Fcffi_example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcclintock%2Fcffi_example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmcclintock","download_url":"https://codeload.github.com/tmcclintock/cffi_example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmcclintock%2Fcffi_example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275568558,"owners_count":25488493,"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-09-17T02:00:09.119Z","response_time":84,"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":[],"created_at":"2024-10-21T04:24:05.742Z","updated_at":"2025-09-17T09:31:14.018Z","avatar_url":"https://github.com/tmcclintock.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cffi_example\nThis is a working example of how to use cffi when you have a bunch of already written `.h` and `.c` files that you want to bundle into some Python code without using ctypes.\n\nThis repo should be used as a template for anyone that wants to write faster code or wrap their C code, but doesn't want to deal with following the regular cffi examples or fiddling with ctypes.\n\nThe gist is the following:\n1) Have a directory structure similar to this one, with a `src`, `include`, and `project` directory.\n2) Use `setup.py` to compile everything and link the python package with the `.so` file created.\n3) Use `__init__.py` to access your library when you do an import.\n\nThat's it. In this project you can get everything working immediately by changing `mycffi` to whatever project name you need.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmcclintock%2Fcffi_example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmcclintock%2Fcffi_example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmcclintock%2Fcffi_example/lists"}