Skip to content
This repository has been archived by the owner on Jun 7, 2018. It is now read-only.

pybel/pybel-test-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pybel-test-extension

An example of a PyBEL extension.

Warning: PyBEL v0.11.2 is the last version of PyBEL to support extension loading; the functionality was removed in commit c845c66 on 4 June 2018. In place of the pybel.ext namespace, just create your extensions as normal packages and import them under their own names. This repository will remain, in its deprecated state, for historical preservation and to ensure any old tests remain functional.

Usage

This package has not been uploaded to PyPI, so you'll have to get it from GitHub.

$ git clone https://github.com/pybel/pybel-test-extension.git
$ cd pybel-test-extension
$ pip install .

or

pip install git+https://github.com/pybel/pybel-test-extension.git@master

Once installed, all you need to do to access the extension is import pybel:

>>> import pybel
>>> pybel.ext.test.an_extension_function()
42

Creating Your Own Extension

The magic happens in your setup.py:

setuptools.setup(
    ...
    entry_points = {
        'pybel.ext':
            ['name_of_extension = package.module']
    }
    ...
)

The group pybel.ext must be used in order for the extension to be recognized by PyBEL. You can name your extension whatever you want, but attempt to avoid name collisions. The string after the equals sign must point to an importable module which contains your extension--it works just like the standard console_scripts entry point.

About

An example of a PyBEL extension.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages