A Ruby library that enables direct calling of Python functions and modules with automatic type conversion.
PyCall is a Ruby gem that enables direct calling of Python functions and modules from Ruby code. It solves the problem of Ruby developers needing to access Python's vast ecosystem of libraries (like NumPy, pandas, or machine learning frameworks) by providing seamless interoperability with automatic type conversion between the two languages.
Ruby developers who need to integrate Python libraries for data science, machine learning, scientific computing, or any task where Python's ecosystem offers superior tools.
Developers choose PyCall because it provides the most straightforward and Ruby-idiomatic way to call Python code, with automatic type conversion, support for keyword arguments, and intuitive mapping of Python constructs to Ruby syntax, without requiring complex bindings or external processes.
Calling Python functions from the Ruby language
Allows importing any Python module as a Ruby module, making functions callable with minimal syntax, as shown in the README example with math.sin.
Handles conversions for basic types like numbers, strings, arrays, and hashes without manual intervention, simplifying cross-language data passing.
Maps Python constructors to .new and callables to .(), with keyword arguments using Ruby hash syntax, making Python code feel natural in Ruby.
Provides PyCall.without_gvl to release Ruby's GVL during long Python calls, improving concurrency in blocking operations, as documented in the usage section.
Officially does not support multi-threaded use, as admitted in the README, limiting scalability in concurrent applications.
Requires rebuilding Python with --enable-shared for pyenv users, an extra non-default step that complicates installation.
Callable attributes cannot be accessed directly; requires using PyCall.getattr as a workaround, adding syntactic friction.
ID3-based implementation of the ML Decision Tree algorithm
Data Analysis in RUby
Tools for scientific computation in Ruby
Official gem repository: Ruby kernel for Jupyter/IPython Notebook
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.