{"id":39061522,"url":"https://github.com/iplitharas/pycompile","last_synced_at":"2026-01-17T18:06:23.328Z","repository":{"id":176368437,"uuid":"606729665","full_name":"iplitharas/pycompile","owner":"iplitharas","description":"A CLI tool for compiling and benchmarking python source code using Cython or Nuitka","archived":false,"fork":false,"pushed_at":"2025-10-27T00:09:20.000Z","size":5678,"stargazers_count":5,"open_issues_count":5,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-01T17:13:02.532Z","etag":null,"topics":["benchmark","cli","compiling","cython","nuitka","pytest","python"],"latest_commit_sha":null,"homepage":"https://iplitharas.github.io/pycompile/","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/iplitharas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2023-02-26T11:51:00.000Z","updated_at":"2025-09-18T21:01:18.000Z","dependencies_parsed_at":"2024-10-28T13:40:36.049Z","dependency_job_id":"d3173326-7c87-49a9-a8d4-bc2154397181","html_url":"https://github.com/iplitharas/pycompile","commit_stats":null,"previous_names":["iplitharas/pycompile"],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/iplitharas/pycompile","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iplitharas%2Fpycompile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iplitharas%2Fpycompile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iplitharas%2Fpycompile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iplitharas%2Fpycompile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iplitharas","download_url":"https://codeload.github.com/iplitharas/pycompile/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iplitharas%2Fpycompile/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28514940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T17:57:59.192Z","status":"ssl_error","status_checked_at":"2026-01-17T17:57:52.527Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["benchmark","cli","compiling","cython","nuitka","pytest","python"],"created_at":"2026-01-17T18:06:22.612Z","updated_at":"2026-01-17T18:06:23.322Z","avatar_url":"https://github.com/iplitharas.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pycompile\n\n```python\n\"\"\"                                        _ _\n    _ __  _   _  ___ ___  _ __ ___  _ __ (_) | ___\n   | '_ \\| | | |/ __/ _ \\| '_ ` _ \\| '_ \\| | |/ _ \\\n   | |_) | |_| | (_| (_) | | | | | | |_) | | |  __/\n   | .__/ \\__, |\\___\\___/|_| |_| |_| .__/|_|_|\\___|\n   |_|    |___/                    |_|\n   \n\"\"\"\n```\nA CLI tool for compiling and benchmarking python source code using [Cython](https://cython.org/)  or\n[Nuitka](https://nuitka.net/).\n\n![PyPI](https://img.shields.io/pypi/v/pycompile)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/pycompile)\n![PyPI - License](https://img.shields.io/pypi/l/pycompile)\n[![Tests](https://github.com/iplitharas/pycompile/actions/workflows/test.yaml/badge.svg)](https://github.com/iplitharas/pycompile/actions/workflows/test.yaml)\n![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)\n![PyPI - Implementation](https://img.shields.io/pypi/implementation/pycompile)\n\n\n### Latest docs 📝\n[here](https://iplitharas.github.io/pycompile/)\n\n## Table of contents\n1. [Installation 🔨](#installation)\n2. [Compile](#compile)\n3. [Benchmark](#benchmark)\n4. [Dry run](#dry-run)\n5. [Local-development 💻🏭](#local-development)\n\n\n### Installation \n```bash\npip install pycompile\n```\n\n### Compile\n\n```bash\nUsage: pycompile compile [OPTIONS]\n\n  Compile the python files using `cython` or `nuitka`.\n\nOptions:\n  -i, --input-path PATH           Specify the file/folder input path, by\n                                  default it will exclude any `test` and\n                                  `__init__.py` files  [required]\n  -ex, --exclude-glob-paths TEXT  glob files patterns of the files to be\n                                  excluded, example: **/ignore_this_module.py\n  -v, --verbose                   verbose level\n  -e, --engine [cython|nuitka]    CompilerWrapper to be used, defaults to:\n                                  `cython`\n  -cs, --clean-source             Clean source (.py) files\n  -kb, --keep-builds              Keep temporary build files\n  -ce, --clean-executables        Clean final executables (.so) files\n  --help                          Show this message and exit.\n```\n\n```bash\npycompile compile -i your_python_files --clean-source --engine nuitka \n```\n\n![cython_compile.gif](data/cython_compile.gif) or \n\nAfter the compilation the `input` dir will have the following structure.\n\n```text\nexamples\n    ├── fib.py.py                           \n    ├── fib.cpython-310-darwin.so                      \n    ├── test_fib.py                   \n```\n\n### Benchmark\n\n```bash\nUsage: pycompile benchmark [OPTIONS]\n\n  Run a memory and cpu benchmark.\n\nOptions:\n  -i, --input-path PATH           Specify the file/folder input path\n                                  [required]\n  -e, --engine [cython|nuitka|both|none]\n                                  compiler wrapper(s) to be used for the\n                                  benchmark, defaults to `both`.\n  -t, --type [memory|cpu|both]    type of benchmark to execute, defaults to\n                                  `both`.\n  -p, --profile_func_pattern TEXT\n                                  function name pattern for profiling,\n                                  defaults to `benchmark`. All the functions\n                                  with a name that matches this pattern will\n                                  be decorated with `@profile` from: `memory-\n                                  profiler`, in addition their module needs to\n                                  follow  the pattern\n                                  (`something_prof_func_name.py` to be\n                                  excluded from compilation).\n  -v, --verbose                   verbose level\n  --help                          Show this message and exit.\n```\n\nIt starts a `memory` and a `cpu` benchmark, starting with \n* `python`,\n* `cython` and,\n* `nuitka`\n\n\n```bash\npycompile benchmark -i src/examples -vvv\n```\n\n![benchmark_cython_python.gif](data/benchmark_cython_python.gif)\n\n\n\u003e [!IMPORTANT]\n\u003e The python package must have a `test_module.py` because both benchmark types are invoked \n\u003e with `pytest` runs\n\n\nThe following structure is required for the `benchmark` subcommand.\n\n```text\n module\n    ├── sample_funcs.py                        # implementation\n    ├── main.py                                # entrypoint with a `main` function, during compilation will be excluded\n    ├── test_sample_funcs.py                   # test cases\n```\n\n\n### Dry run\n\n```bash\npycompile dry_run -i ./src\n```\n\n![dry_run.gif](data/dry_run.gif)\n\n\n### Local-development\nFor local development run the following command\n\n```bash\nmake setup-local-dev\n```\n\nAll available `make` commands\n```bash\nmake help\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiplitharas%2Fpycompile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiplitharas%2Fpycompile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiplitharas%2Fpycompile/lists"}