{"id":16689850,"url":"https://github.com/eddieantonio/crimes","last_synced_at":"2026-05-01T02:34:25.378Z","repository":{"id":208538183,"uuid":"720909953","full_name":"eddieantonio/crimes","owner":"eddieantonio","description":"Import C files into Python, illegally.","archived":false,"fork":false,"pushed_at":"2025-06-13T23:39:07.000Z","size":82,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-01T02:34:22.173Z","etag":null,"topics":["c","ctypes","do-not-use-in-production","python"],"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/eddieantonio.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-11-20T00:12:10.000Z","updated_at":"2025-06-13T23:39:10.000Z","dependencies_parsed_at":"2023-11-22T02:28:14.966Z","dependency_job_id":"3d25458c-e259-4961-9f9f-972aaa32f44f","html_url":"https://github.com/eddieantonio/crimes","commit_stats":null,"previous_names":["eddieantonio/crimes"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eddieantonio/crimes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddieantonio%2Fcrimes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddieantonio%2Fcrimes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddieantonio%2Fcrimes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddieantonio%2Fcrimes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eddieantonio","download_url":"https://codeload.github.com/eddieantonio/crimes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eddieantonio%2Fcrimes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32483406,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["c","ctypes","do-not-use-in-production","python"],"created_at":"2024-10-12T15:49:34.469Z","updated_at":"2026-05-01T02:34:25.117Z","avatar_url":"https://github.com/eddieantonio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Crimes\n\nBlur the line between C and Python.\n\nFirst, write some C code:\n\n```c\n/* hello.c */\n#include \u003cstdio.h\u003e\n\nvoid hello(void) {\n    printf(\"Hello world from C!\\n\");\n}\n```\n\nThen import that C code into Python:\n\n```python\nimport crimes\n\ncrimes.commit()\n\nfrom hello import hello\n\nhello()  # prints \"Hello world from C!\"\n```\n\nAll you had to do is call `crimes.commit()`!\n\n## What if I am a terrible C programmer?\n\nNot to worry! `crimes` will print your syntax errors as part of the normal Python traceback:\n\n```c\n/* hello.c */\n#include \u003cstdio.h\u003e\n\n/* missing ')' on the next line: */\nvoid hello(void {\n    printf(\"Hello world from C!\\n\");\n}\n```\n\n```python\nimport crimes\n\ncrimes.commit()\n\nfrom hello import hello  # raises an error here\n```\n\nGives you this error:\n\n```\nTraceback (most recent call last):\n  File \"/tmp/example.py\", line 6, in \u003cmodule\u003e\n    from hello import hello  # type: ignore\n    ^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/tmp/hello.c\", line 5, in hello.c\n    void hello(void {\n                    ^\ncrimes.exceptions.CCompileError: expected ';', ',' or ')' before '{' token\n```\n\n# Install\n\n\u003e [!WARNING]\n\u003e This is currently pretty hacky.\n\u003e I provide absolutely no guarantee that this will work on your machine.\n\u003e Here's how I got it working on my machine, which running macOS.\n\u003e I highly doubt this library works at all on Windows.\n\nFirst, install the library:\n\n```sh\npip install crimes\n```\n\nNext, make sure you have a compatible version of GCC.\nAny version of GCC 9.0 or greater should work. On most Linux distros,\nyou probably already have this installed. On macOS though... Apple\nthought it was a good idea to symlink `gcc` to `clang`. This does not\nwork. So first, install _actual_ GCC using brew:\n\n```sh\nbrew install gcc@13\n```\n\nNext, before using this module, make sure that `CC` is set to use\n`gcc-13`. You can do this universally like this:\n\n```sh\nexport CC=gcc-13\n```\n\n...but I prefer to do it per-process:\n\n```sh\nenv CC=gcc-13 python3 my-program-that-commits-crimes.py\n```\n\n\n# Copying\n\nCopyright © 2023 Eddie Antonio Santos. Apache-2.0 licensed. See\n`LICENSE` for details. _Especially_ the Disclaimer of Warranty!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddieantonio%2Fcrimes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feddieantonio%2Fcrimes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feddieantonio%2Fcrimes/lists"}