# CythonBuilder: automated compiling and packaging of Cython code
![coverage](https://img.shields.io/codecov/c/github/mike-huls/cythonbuilder)
![Tests](https://github.com/mike-huls/cythonbuilder/actions/workflows/tests.yml/badge.svg)
![version](https://img.shields.io/pypi/v/cythonbuilder?color=%2334D058&label=pypi%20package)
![dependencies](https://img.shields.io/librariesio/release/pypi/cythonbuilder)
![PyPI Downloads](https://img.shields.io/pypi/dm/cythonbuilder.svg?label=PyPI%20downloads)
![versions](https://img.shields.io/pypi/pyversions/cythonbuilder.svg?color=%2334D058)
<br>
![tweet](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fmike-huls%2Fcythonbuilder) ![xfollow](https://img.shields.io/twitter/follow/mike_huls?style=social)
CythonBuilder makes it easy to use Cython in your Python project by automating the building process.
You can use CythonBuilder from the commandline or import it as a package in Python.
Generated files can be imported in Python directly
```sh
pip install cythonbuilder
```
### Normal
Add `-v` (verbose) for more information
1. Listing files with and without filter
```commandline
cybuilder list
cybuilder list --files file1 file2.pyx
```
2. Build with and without optional build arguments
```commandline
cybuilder build
cybuilder build --include-numpy --no-annotation --no-cleanup
```
3. Clean
```commandline
cybuilder clean
cybuilder clean --no-cleanup
```
<hr>
### With Python
1. Listing files with and without filter
```python
import cythonbuilder
print(cythonbuilder.cy_list()) # without a filter
print(cythonbuilder.cy_list(target_files=['some_name.pyx'])) # with a filter
```
2. Build with and without optional build arguments (cleans automatically afterwards)
```python
import cythonbuilder
cythonbuilder.cy_build()
found_files = cythonbuilder.cy_build(target_files=['some_name'])
cythonbuilder.cy_build(target_files=found_files, include_numpy=False, create_annotations=False)
```
3. Clean
```python
import cythonbuilder
cythonbuilder.cy_clean()
found_files = cythonbuilder.cy_build(target_files=['some_name'])
cythonbuilder.cy_clean(target_files=['some_name'])
```
4. Setting debug level for verbose logging
```python
import logging
from . import logger
logger.setLevel(logging.DEBUG)
```
### In-depth, step by step Explanation
I've written a few articles that explain why Python is slow, why Cython can be a solution and how CythonBuilder helps us develop fast code easily:
- [Why Python is so slow and how to speed it up](https://mikehuls.com/why-is-python-so-slow-and-how-to-speed-it-up-6720e14a1ca260001b1c0cba)
- [Getting started with Cython; how to perform >1.7 billion calculations per second with Python](https://mikehuls.com/getting-started-with-cython-how-to-perform-1-7-billion-calculations-per-second-in-python-6720e14a1ca260001b1c0ccf)
- [Cython for data science: 6 steps to make this Pandas dataframe operation over 100x faster](https://mikehuls.com/cython-for-data-science-6-steps-to-make-this-pandas-dataframe-operation-over-100x-faster-6720e14a1ca260001b1c0d07/)
Raw data
{
"_id": null,
"home_page": null,
"name": "cythonbuilder",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "pypi, Cython, setup, packaging, compilation",
"author": null,
"author_email": "Mike Huls <mikehuls42@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/30/a7/f8cd045f2245267624d9c8e9321c4445865fda3740d38ca66069824b4494/cythonbuilder-0.1.24.tar.gz",
"platform": null,
"description": "# CythonBuilder: automated compiling and packaging of Cython code\n![coverage](https://img.shields.io/codecov/c/github/mike-huls/cythonbuilder)\n![Tests](https://github.com/mike-huls/cythonbuilder/actions/workflows/tests.yml/badge.svg)\n![version](https://img.shields.io/pypi/v/cythonbuilder?color=%2334D058&label=pypi%20package)\n![dependencies](https://img.shields.io/librariesio/release/pypi/cythonbuilder)\n![PyPI Downloads](https://img.shields.io/pypi/dm/cythonbuilder.svg?label=PyPI%20downloads)\n![versions](https://img.shields.io/pypi/pyversions/cythonbuilder.svg?color=%2334D058)\n<br>\n![tweet](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fmike-huls%2Fcythonbuilder) ![xfollow](https://img.shields.io/twitter/follow/mike_huls?style=social) \n\n\nCythonBuilder makes it easy to use Cython in your Python project by automating the building process.\nYou can use CythonBuilder from the commandline or import it as a package in Python. \nGenerated files can be imported in Python directly\n\n```sh\npip install cythonbuilder\n```\n\n\n### Normal\nAdd `-v` (verbose) for more information \n1. Listing files with and without filter\n```commandline\ncybuilder list\ncybuilder list --files file1 file2.pyx\n```\n\n2. Build with and without optional build arguments \n```commandline\ncybuilder build\ncybuilder build --include-numpy --no-annotation --no-cleanup\n```\n\n3. Clean\n```commandline\ncybuilder clean \ncybuilder clean --no-cleanup\n```\n\n<hr>\n\n### With Python\n1. Listing files with and without filter\n\n```python\nimport cythonbuilder\n\nprint(cythonbuilder.cy_list()) # without a filter\nprint(cythonbuilder.cy_list(target_files=['some_name.pyx'])) # with a filter\n```\n\n2. Build with and without optional build arguments (cleans automatically afterwards)\n\n```python\nimport cythonbuilder\n\ncythonbuilder.cy_build()\n\nfound_files = cythonbuilder.cy_build(target_files=['some_name'])\ncythonbuilder.cy_build(target_files=found_files, include_numpy=False, create_annotations=False)\n```\n\n3. Clean\n\n```python\nimport cythonbuilder\n\ncythonbuilder.cy_clean()\n\nfound_files = cythonbuilder.cy_build(target_files=['some_name'])\ncythonbuilder.cy_clean(target_files=['some_name'])\n```\n\n4. Setting debug level for verbose logging\n\n```python\nimport logging\nfrom . import logger\n\nlogger.setLevel(logging.DEBUG)\n```\n\n### In-depth, step by step Explanation\nI've written a few articles that explain why Python is slow, why Cython can be a solution and how CythonBuilder helps us develop fast code easily:\n- [Why Python is so slow and how to speed it up](https://mikehuls.com/why-is-python-so-slow-and-how-to-speed-it-up-6720e14a1ca260001b1c0cba)\n- [Getting started with Cython; how to perform >1.7 billion calculations per second with Python](https://mikehuls.com/getting-started-with-cython-how-to-perform-1-7-billion-calculations-per-second-in-python-6720e14a1ca260001b1c0ccf)\n- [Cython for data science: 6 steps to make this Pandas dataframe operation over 100x faster](https://mikehuls.com/cython-for-data-science-6-steps-to-make-this-pandas-dataframe-operation-over-100x-faster-6720e14a1ca260001b1c0d07/)\n",
"bugtrack_url": null,
"license": null,
"summary": "CythonBuilder; automated compiling and packaging of Cython code",
"version": "0.1.24",
"project_urls": {
"Bug Tracker": "https://github.com/mike-huls/cythonbuilder/issues",
"Documentation": "https://github.com/mike-huls/cythonbuilder/blob/main/README.md/",
"Homepage": "https://github.com/mike-huls/cythonbuilder",
"Say Thanks!": "https://www.buymeacoffee.com/mikehuls",
"Source": "https://github.com/mike-huls/cythonbuilder/"
},
"split_keywords": [
"pypi",
" cython",
" setup",
" packaging",
" compilation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2aeebf9d8ff26e22b4b05515f9143ee36f4b2fe7e6202e645b392c1f9500f9c7",
"md5": "988638477c2edde2c2cebd7b5c5bb597",
"sha256": "aa5e7a697be568c0f072039904ed39536b0e7d69074151e069f086be7fc06318"
},
"downloads": -1,
"filename": "cythonbuilder-0.1.24-py3-none-any.whl",
"has_sig": false,
"md5_digest": "988638477c2edde2c2cebd7b5c5bb597",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 13784,
"upload_time": "2024-11-04T14:00:05",
"upload_time_iso_8601": "2024-11-04T14:00:05.596859Z",
"url": "https://files.pythonhosted.org/packages/2a/ee/bf9d8ff26e22b4b05515f9143ee36f4b2fe7e6202e645b392c1f9500f9c7/cythonbuilder-0.1.24-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "30a7f8cd045f2245267624d9c8e9321c4445865fda3740d38ca66069824b4494",
"md5": "0061011fe84b1a956fe3bfc7ba0a9d7a",
"sha256": "d740d7efbc4f8f0612e64dfadf1a4e99a7031a43dbecfa6de054ffaaef1fbc92"
},
"downloads": -1,
"filename": "cythonbuilder-0.1.24.tar.gz",
"has_sig": false,
"md5_digest": "0061011fe84b1a956fe3bfc7ba0a9d7a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 14693,
"upload_time": "2024-11-04T14:00:06",
"upload_time_iso_8601": "2024-11-04T14:00:06.723795Z",
"url": "https://files.pythonhosted.org/packages/30/a7/f8cd045f2245267624d9c8e9321c4445865fda3740d38ca66069824b4494/cythonbuilder-0.1.24.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-04 14:00:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mike-huls",
"github_project": "cythonbuilder",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "cythonbuilder"
}