# Calling Cython

**URL:** <https://discourse.julialang.org/t/calling-cython/8934>\
**Category:** General Usage\
**Created:** [February 9, 2018, 12:44am UTC](https://discourse.julialang.org/t/calling-cython/8934 "2018-02-09T00:44:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [February 9, 2018, 12:44am UTC](https://discourse.julialang.org/t/calling-cython/8934/1 "2018-02-09T00:44:33Z")

</div>

I had some thoughts about wrapping [SpaCy](https://github.com/explosion/spaCy),

SpaCy is a python library for NLP.  
Its 90% Cython, rather than actually being python.  
So I have a bunch of `.so` compiled shared objects.

I am wondering if I can `ccall` into functions in those `.so`s rather than PyCalling into the package.  
And if so, if it would give a performance advantage.

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihnorton/32/26_2.png) [@ihnorton](https://discourse.julialang.org/u/ihnorton)\
**Post date:** [February 9, 2018, 3:13am UTC](https://discourse.julialang.org/t/calling-cython/8934/2 "2018-02-09T03:13:21Z")

</div>

There is a spacy c++ wrapper, which from a quick glance wraps PyObjects. So I suspect they don’t provide a non-CPython/c-ext API (I haven’t heard of Cython projects which do so). While you could call exports from the .so objects directly, doing so would replicate PyCall with no particular advantage.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [February 9, 2018, 3:13am UTC](https://discourse.julialang.org/t/calling-cython/8934/3 "2018-02-09T03:13:51Z")

</div>

If it provides C-API (which IIRC is possiblle for cython) then yes. If there’s no C-API then no.
