Skip to main content

A small example package with Nim module

Project description

Example Package with Nim

This is a simple example package with Nim module.

Build steps

NOTE: These build steps are using Linux/macOS or similar. For Windows, the Nim module will be compiled to mymodule.pyd instead of mymodule.so.

cd py_module_nim/example_pkg/
nimble install nimpy
nim compile --threads:on --app:lib --out:mymodule.so mymodule
cd ..
virtualenv venv
source venv/bin/activate
python setup.py sdist bdist_wheel

Publish steps

cd py_module_nim/
pip install twine
twine upload dist/*

Example using package

Write the following Python script to file named try.py:

from example_nim_pkg import mymodule
print(mymodule.greet("World"))

Install the example-nim-pkg-stever package and run the script:

pip install example-nim-pkg-stever
python try.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

example_nim_pkg_stever-0.0.3-cp37-cp37m-win_amd64.whl (147.9 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page