Skip to content

Centralize Public API into dedicated API module #648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Jul 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bump.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ bumpver("pyproject.toml", "version = \"{}\"\n", oldver, newver)
bumpver("pysrc/juliacall/__init__.py", "__version__ = '{}'\n", oldver, newver)
bumpver("pysrc/juliacall/juliapkg.json", "\"version\": \"={}\"", oldver, newver)
bumpver("pysrc/juliacall/juliapkg-dev.json", "\"version\": \"={}\"", oldver, newver)
bumpver("src/PythonCall.jl", "VERSION = v\"{}\"", oldver, newver)
bumpver("src/API/API.jl", "VERSION = v\"{}\"", oldver, newver)
bumpver("src/Core/Core.jl", "VERSION = v\"{}\"", oldver, newver)
bump("docs/src/releasenotes.md", "## Unreleased", "## $newver ($(today()))")
8 changes: 8 additions & 0 deletions src/API/API.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"The version of PythonCall."
const VERSION = v"0.9.26"

include("types.jl")
include("functions.jl")
include("macros.jl")
include("exports.jl")
include("publics.jl")
141 changes: 141 additions & 0 deletions src/API/exports.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Core
export @py
export @pyconst
export @pyeval
export @pyexec
export ispy
export Py
export pyabs
export pyadd
export pyall
export pyand
export pyany
export pyascii
export pybool
export pybuiltins
export pybytes
export pycall
export pycallable
export pycollist
export pycompile
export pycomplex
export pycontains
export pydate
export pydatetime
export pydelattr
export pydelitem
export pydict
export pydir
export pydivmod
export pyeq
export pyeval
export PyException
export pyexec
export pyfloat
export pyfloordiv
export pyfraction
export pyfrozenset
export pyge
export pygetattr
export pygetitem
export pygt
export pyhasattr
export pyhash
export pyhasitem
export pyhelp
export pyiadd
export pyiand
export pyifloordiv
export pyilshift
export pyimatmul
export pyimod
export pyimport
export pyimul
export pyin
export pyindex
export pyint
export pyinv
export pyior
export pyipow
export pyirshift
export pyis
export pyisinstance
export pyissubclass
export pyisub
export pyiter
export pyitruediv
export pyixor
export pyle
export pylen
export pylist
export pylshift
export pylt
export pymatmul
export pymod
export pymul
export pyne
export pyneg
export pynext
export pynot
export pyor
export pypos
export pypow
export pyprint
export pyrange
export pyrepr
export pyrowlist
export pyrshift
export pyset
export pysetattr
export pysetitem
export pyslice
export pystr
export pysub
export pytime
export pytruediv
export pytruth
export pytuple
export pytype
export pywith
export pyxor

# Convert
export @pyconvert
export pyconvert
export pyconvert_add_rule
export PYCONVERT_PRIORITY_ARRAY
export PYCONVERT_PRIORITY_CANONICAL
export PYCONVERT_PRIORITY_FALLBACK
export PYCONVERT_PRIORITY_NORMAL
export PYCONVERT_PRIORITY_WRAP
export pyconvert_return
export pyconvert_unconverted

# Wrap
export PyArray
export PyDict
export PyIO
export PyIterable
export PyList
export PyPandasDataFrame
export PySet
export PyTable

# JlWrap
export pybinaryio
export pyclassmethod
export pyfunc
export pyisjl
export pyjl
export pyjlraw
export pyjltype
export pyjlvalue
export PyObjectArray
export PyObjectMatrix
export PyObjectVector
export pyproperty
export pystaticmethod
export pytextio

# Compat
export pytable
130 changes: 130 additions & 0 deletions src/API/functions.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# C
function python_executable_path end
function python_library_handle end
function python_library_path end
function python_version end

# Core
function getptr end
function ispy end
function pyabs end
function pyadd end
function pyall end
function pyand end
function pyany end
function pyascii end
function pybool end
function pybytes end
function pycall end
function pycallable end
function pycollist end
function pycompile end
function pycomplex end
function pycontains end
function pycopy! end
function pydate end
function pydatetime end
function pydel! end
function pydelattr end
function pydelitem end
function pydict end
function pydir end
function pydivmod end
function pyeq end
function pyeval end
function pyexec end
function pyfloat end
function pyfloordiv end
function pyfraction end
function pyfrozenset end
function pyge end
function pygetattr end
function pygetitem end
function pygt end
function pyhasattr end
function pyhash end
function pyhasitem end
function pyhelp end
function pyiadd end
function pyiand end
function pyifloordiv end
function pyilshift end
function pyimatmul end
function pyimod end
function pyimport end
function pyimul end
function pyin end
function pyindex end
function pyint end
function pyinv end
function pyior end
function pyipow end
function pyirshift end
function pyis end
function pyisinstance end
function pyisnull end
function pyissubclass end
function pyisub end
function pyiter end
function pyitruediv end
function pyixor end
function pyle end
function pylen end
function pylist end
function pylshift end
function pylt end
function pymatmul end
function pymod end
function pymul end
function pyne end
function pyneg end
function pynew end
function pynext end
function pynot end
function pyor end
function pypos end
function pypow end
function pyprint end
function pyrange end
function pyrepr end
function pyrowlist end
function pyrshift end
function pyset end
function pysetattr end
function pysetitem end
function pyslice end
function pystr end
function pysub end
function pytime end
function pytruediv end
function pytruth end
function pytuple end
function pytype end
function pywith end
function pyxor end
function unsafe_pynext end

# Convert
function pyconvert end
function pyconvert_add_rule end
function pyconvert_return end
function pyconvert_unconverted end

# JlWrap
function pybinaryio end
function pyclassmethod end
function pyfunc end
function pyisjl end
function pyjl end
function pyjlraw end
function pyjltype end
function pyjlvalue end
function pyproperty end
function pystaticmethod end
function pytextio end

# Compat
function event_loop_off end
function event_loop_on end
function fix_qt_plugin_path end
function pytable end
10 changes: 10 additions & 0 deletions src/API/macros.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Core
macro pyconst end
macro pyeval end
macro pyexec end

# Convert
macro pyconvert end

# PyMacro
macro py end
29 changes: 29 additions & 0 deletions src/API/publics.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
if Base.VERSION ≥ v"1.11"
eval(Meta.parse("""
public
GC,
GIL,
VERSION,

# C
python_executable_path,
python_library_handle,
python_library_path,
python_version,

# Core
CONFIG,
getptr,
pycopy!,
pydel!,
pyisnull,
pynew,
PyNULL,
unsafe_pynext,

# Compat
event_loop_off,
event_loop_on,
fix_qt_plugin_path
"""))
end
Loading
Loading