Skip to main content

PythonCall.jl logo
PythonCall & JuliaCall

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Stable Documentation Dev Documentation Tests Codecov PkgEval

Bringing Python® and Julia together in seamless harmony:

  • Call Python code from Julia and Julia code from Python via a symmetric interface.
  • Simple syntax, so the Python code looks like Python and the Julia code looks like Julia.
  • Intuitive and flexible conversions between Julia and Python: anything can be converted, you are in control.
  • Fast non-copying conversion of numeric arrays in either direction: modify Python arrays (e.g. bytes, array.array, numpy.ndarray) from Julia or Julia arrays from Python.
  • Helpful wrappers: interpret Python sequences, dictionaries, arrays, dataframes and IO streams as their Julia counterparts, and vice versa.
  • Beautiful stack-traces.
  • Supports modern systems: tested on Windows, MacOS and Linux, 64-bit, Julia 1.6.1 upwards and Python 3.8 upwards.

⭐ If you like this, a GitHub star would be lovely thank you. ⭐

To get started, read the documentation.

Example 1: Calling Python from Julia

In this example, we use the Julia module PythonCall from a Pluto notebook to inspect the Iris dataset:

  • We load the Iris dataset as a Julia DataFrame using RDatasets.
  • We use pytable(df) to convert it to a Python Pandas DataFrame.
  • We use the Python package Seaborn to produce a pair-plot, which is automatically displayed.

Seaborn example screenshot

Example 2: Calling Julia from Python

In this example we use the Python module JuliaCall from an IPython notebook to train a simple neural network:

  • We generate some random training data using Python's Numpy.
  • We construct and train a neural network model using Julia's Flux.
  • We plot some sample output from the model using Python's MatPlotLib.

Flux example screenshot

What about PyCall?

The existing package PyCall is another similar interface to Python. Here we note some key differences:.

  • PythonCall supports a wider range of conversions between Julia and Python, and the conversion mechanism is extensible.
  • PythonCall by default never copies mutable objects when converting, but instead directly wraps the mutable object. This means that modifying the converted object modifies the original, and conversion is faster.
  • PythonCall does not usually automatically convert results to Julia values, but leaves them as Python objects. This makes it easier to do Pythonic things with these objects (e.g. accessing methods) and is type-stable.
  • PythonCall installs dependencies into a separate Conda environment for each Julia project using CondaPkg. This means each Julia project can have an isolated set of Python dependencies.

Release files for juliacall 0.9.23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for juliacall 0.9.23
File Size Uploaded
juliacall-0.9.23.tar.gz 12.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for juliacall 0.9.23
File Interpreter ABI Platform
juliacall-0.9.23-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / juliacall-0.9.23.tar.gz

Download URL juliacall-0.9.23.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
536f2e0f4ccfd34920322121b4353079029123eae81b7200ed1787e49d8053d2
BLAKE2b-256 checksum
How to use checksums
14f6c9f3f925d0a5c518aaea9ad2c5668764ef002082b8c7e035d09898b112a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release files / juliacall-0.9.23-py3-none-any.whl

Download URL juliacall-0.9.23-py3-none-any.whl
Size 12.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67689bdeadf8438f4b302cbe88b31610ee8b345577b4df04328d67c4e66f5e62
BLAKE2b-256 checksum
How to use checksums
94c377fd3da267a3d748e91a575f2c876cfeb680bebfc9181a1b6c1357921f0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.9

Release history Release notifications | RSS feed

0.9.36

2 release files

0.9.34

2 release files

0.9.33

2 release files

0.9.32

2 release files

0.9.31

2 release files

0.9.30

2 release files

0.9.29

2 release files

0.9.28

2 release files

0.9.27

2 release files

0.9.26

2 release files

0.9.25

2 release files

0.9.24

2 release files

This release

0.9.23 This release

2 release files

0.9.21

2 release files

0.9.19

2 release files

0.9.18

2 release files

0.9.17

2 release files

0.9.16

2 release files

0.9.15

2 release files

0.9.14

2 release files

0.9.13

2 release files

0.9.12

2 release files

0.9.11

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page