Skip to content

Commit 8633733

Browse files
author
Christopher Doris
committed
partial work creating central api
1 parent 0a7d49f commit 8633733

File tree

18 files changed

+558
-253
lines changed

18 files changed

+558
-253
lines changed

src/API/API.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"The version of PythonCall."
2+
const VERSION = v"0.9.25"
3+
4+
include("types.jl")
5+
include("functions.jl")
6+
include("macros.jl")
7+
include("exports.jl")
8+
include("publics.jl")

src/API/exports.jl

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Core
2+
export pyis
3+
export pyrepr
4+
export pyascii
5+
export pyhasattr
6+
export pygetattr
7+
export pysetattr
8+
export pydelattr
9+
export pyissubclass
10+
export pyisinstance
11+
export pyhash
12+
export pytruth
13+
export pynot
14+
export pylen
15+
export pyhasitem
16+
export pygetitem
17+
export pysetitem
18+
export pydelitem
19+
export pydir
20+
export pycall
21+
export pyeq
22+
export pyne
23+
export pyle
24+
export pylt
25+
export pyge
26+
export pygt
27+
export pycontains
28+
export pyin
29+
export pyneg
30+
export pypos
31+
export pyabs
32+
export pyinv
33+
export pyindex
34+
export pyadd
35+
export pysub
36+
export pymul
37+
export pymatmul
38+
export pyfloordiv
39+
export pytruediv
40+
export pymod
41+
export pydivmod
42+
export pylshift
43+
export pyrshift
44+
export pyand
45+
export pyxor
46+
export pyor
47+
export pyiadd
48+
export pyisub
49+
export pyimul
50+
export pyimatmul
51+
export pyifloordiv
52+
export pyitruediv
53+
export pyimod
54+
export pyilshift
55+
export pyirshift
56+
export pyiand
57+
export pyixor
58+
export pyior
59+
export pypow
60+
export pyipow
61+
export pyiter
62+
export pynext
63+
export pybool
64+
export pystr
65+
export pybytes
66+
export pyint
67+
export pyfloat
68+
export pycomplex
69+
export pytype
70+
export pyslice
71+
export pyrange
72+
export pytuple
73+
export pylist
74+
export pycollist
75+
export pyrowlist
76+
export pyset
77+
export pyfrozenset
78+
export pydict
79+
export pydate
80+
export pytime
81+
export pydatetime
82+
export pyfraction
83+
export pyeval
84+
export pyexec
85+
export pywith
86+
export pyimport
87+
export pyprint
88+
export pyhelp
89+
export pyall
90+
export pyany
91+
export pycallable
92+
export pycompile
93+
export @pyeval
94+
export @pyexec
95+
96+
# Convert
97+
export pyconvert
98+
export @pyconvert
99+
export pyconvert_add_rule
100+
export pyconvert_return
101+
export pyconvert_unconverted
102+
export PYCONVERT_PRIORITY_WRAP
103+
export PYCONVERT_PRIORITY_ARRAY
104+
export PYCONVERT_PRIORITY_CANONICAL
105+
export PYCONVERT_PRIORITY_NORMAL
106+
export PYCONVERT_PRIORITY_FALLBACK

src/API/functions.jl

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# C
2+
function python_executable_path end
3+
function python_library_path end
4+
function python_library_handle end
5+
function python_version end
6+
7+
# Core
8+
function pynew end
9+
function pyisnull end
10+
function pycopy! end
11+
function getptr end
12+
function pydel! end
13+
function unsafe_pynext end
14+
15+
function pyis end
16+
function pyrepr end
17+
function pyascii end
18+
function pyhasattr end
19+
function pygetattr end
20+
function pysetattr end
21+
function pydelattr end
22+
function pyissubclass end
23+
function pyisinstance end
24+
function pyhash end
25+
function pytruth end
26+
function pynot end
27+
function pylen end
28+
function pyhasitem end
29+
function pygetitem end
30+
function pysetitem end
31+
function pydelitem end
32+
function pydir end
33+
function pycall end
34+
function pyeq end
35+
function pyne end
36+
function pyle end
37+
function pylt end
38+
function pyge end
39+
function pygt end
40+
function pycontains end
41+
function pyin end
42+
function pyneg end
43+
function pypos end
44+
function pyabs end
45+
function pyinv end
46+
function pyindex end
47+
function pyadd end
48+
function pysub end
49+
function pymul end
50+
function pymatmul end
51+
function pyfloordiv end
52+
function pytruediv end
53+
function pymod end
54+
function pydivmod end
55+
function pylshift end
56+
function pyrshift end
57+
function pyand end
58+
function pyxor end
59+
function pyor end
60+
function pyiadd end
61+
function pyisub end
62+
function pyimul end
63+
function pyimatmul end
64+
function pyifloordiv end
65+
function pyitruediv end
66+
function pyimod end
67+
function pyilshift end
68+
function pyirshift end
69+
function pyiand end
70+
function pyixor end
71+
function pyior end
72+
function pypow end
73+
function pyipow end
74+
function pyiter end
75+
function pynext end
76+
function pybool end
77+
function pystr end
78+
function pybytes end
79+
function pyint end
80+
function pyfloat end
81+
function pycomplex end
82+
function pytype end
83+
function pyslice end
84+
function pyrange end
85+
function pytuple end
86+
function pylist end
87+
function pycollist end
88+
function pyrowlist end
89+
function pyset end
90+
function pyfrozenset end
91+
function pydict end
92+
function pydate end
93+
function pytime end
94+
function pydatetime end
95+
function pyfraction end
96+
function pyeval end
97+
function pyexec end
98+
function pywith end
99+
function pyimport end
100+
function pyprint end
101+
function pyhelp end
102+
function pyall end
103+
function pyany end
104+
function pycallable end
105+
function pycompile end
106+
107+
108+
# Convert
109+
function pyconvert end
110+
function pyconvert_add_rule end
111+
function pyconvert_return end
112+
function pyconvert_unconverted end
113+
114+
# Compat
115+
function event_loop_on end
116+
function event_loop_off end
117+
function fix_qt_plugin_path end

src/API/macros.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Core
2+
macro pyeval end
3+
macro pyexec end
4+
5+
# Convert
6+
macro pyconvert end

src/API/publics.jl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
if Base.VERSION v"1.11"
2+
eval(
3+
Expr(
4+
:public,
5+
:VERSION,
6+
:GIL,
7+
:GC,
8+
# C
9+
:python_executable_path,
10+
:python_library_path,
11+
:python_library_handle,
12+
:python_version,
13+
# Core
14+
:pynew,
15+
:pyisnull,
16+
:pycopy!,
17+
:getptr,
18+
:pydel!,
19+
:unsafe_pynext,
20+
:PyNULL,
21+
:CONFIG,
22+
# Compat
23+
:event_loop_on,
24+
:event_loop_off,
25+
:fix_qt_plugin_path,
26+
),
27+
)
28+
end

src/API/types.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Convert
2+
3+
@enum PyConvertPriority begin
4+
PYCONVERT_PRIORITY_WRAP = 400
5+
PYCONVERT_PRIORITY_ARRAY = 300
6+
PYCONVERT_PRIORITY_CANONICAL = 200
7+
PYCONVERT_PRIORITY_NORMAL = 0
8+
PYCONVERT_PRIORITY_FALLBACK = -100
9+
end
10+

src/C/C.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ using Requires: @require
1313
using Libdl:
1414
dlpath, dlopen, dlopen_e, dlclose, dlsym, dlsym_e, RTLD_LAZY, RTLD_DEEPBIND, RTLD_GLOBAL
1515

16+
import ..PythonCall: python_executable_path, python_library_path, python_library_handle, python_version
17+
18+
1619
include("consts.jl")
1720
include("pointers.jl")
1821
include("extras.jl")

src/Compat/Compat.jl

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,22 @@
44
Misc bits and bobs for compatibility.
55
"""
66
module Compat
7-
using ..PythonCall: PythonCall # needed for docstring cross-refs
7+
8+
using ..PythonCall
9+
using ..Utils
10+
using ..C
811
using ..Core
9-
using ..Core:
10-
Core,
11-
C,
12-
Utils,
13-
pynew,
14-
incref,
15-
getptr,
16-
pycopy!,
17-
pymodulehooks,
18-
pyisnull,
19-
pybytes_asvector,
20-
pysysmodule,
21-
pyosmodule,
22-
pystr_fromUTF8
23-
using ..Convert: pyconvert, @pyconvert
24-
using ..Wrap: PyArray, PyPandasDataFrame
12+
using ..Wrap
13+
2514
using Serialization: Serialization, AbstractSerializer, serialize, deserialize
2615
using Tables: Tables
2716
using Requires: @require
2817

18+
import ..PythonCall:
19+
event_loop_on,
20+
event_loop_off,
21+
fix_qt_plugin_path
22+
2923
include("gui.jl")
3024
include("ipython.jl")
3125
include("multimedia.jl")
@@ -39,4 +33,5 @@ function __init__()
3933
init_tables()
4034
@require PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" init_pycall(PyCall)
4135
end
36+
4237
end

0 commit comments

Comments
 (0)