SIOC Post profile for "AI3:::Adaptive Information"
type: Document
description: A SIOC profile describes the structure and contents of a weblog in a machine readable form. For more information please refer to http://sioc-project.org/.
primary topic: CWPK #34: A Python Module, Part II: Packaging and The Structure Extractor
generator agent: http://rdfs.org/sioc/wp-sioc.php

CWPK #34: A Python Module, Part II: Packaging and The Structure Extractor
type: Post
has container: weblog
has creator: Mike Bergman
maker: Mike Bergman
created: 2020-09-11T15:27:12Z
content: Moving from Notebook to Package Proved Perplexing This installment of the Cooking with Python and KBpedia series is the second of a three-part mini-series on writing and packaging a formal Python project. The previous installment described a DRY (don't repeat yourself) approach to how to generalize our annotation extraction routine. This installment describes how to transition that code from Jupyter Notebook interactive code to a formally organized Python package. We also extend our generalized approach to the structure extractor. In this installment I am working with the notebook and the Spyder IDE in tandem. The notebook is the source of the initial prototype code. It is also the testbed for seeing if the package may be imported and is working properly. We use Spyder for all of the final code development, including moving into functions and classes and organizing by files. We also start to learn some of its IDE features, such as auto-complete, which is a nice way to test questions about namespaces and local and global variables. As noted in earlier installments, a Python 'module' is a single script file (in the form of my_file.py) that itself may contain multiple functions, variable declarations, class (object) definitions, and the like, kept in this single file because of their related functionality. A 'package' in Python is a directory with at least one module and (generally) a standard __init__.py file that informs Python a package is available and its name. Python packages and modules are named with lower case. A package name is best when short and without underscores. A module may use underscores to better convey its purpose, such as do_something.py. For our project based on Cooking with Python and KBpedia (CWPK), we will pick up on this acronym and name our project 'cowpoke'. The functional module we are starting the project with is extract.py, the module for the extraction routines we have been developing over the past few installments.. Perplexing Question…
encoded: Moving from Notebook to Package Proved Perplexing This installment of the Cooking with Python and KBpedia series is the second of a three-part mini-series on writing and packaging a formal Python project. The previous installment described a DRY (don’t repeat yourself) approach to how to generalize our annotation extraction routine. This installment describes how to transition that code from Jupyter Notebook interactive code to a formally organized Python package. We also extend our generalized approach to the structure extractor. In this installment I am working with the notebook and the Spyder IDE in tandem. The notebook is the source of the initial prototype code. It is also the testbed for seeing if the package may be imported and is working properly. We use Spyder for all of the final code development, including moving into functions and classes and organizing by files. We also start to learn some of its IDE features, such as auto-complete, which is a nice way to test questions about namespaces and local and global variables. As noted in earlier installments, a Python ‘module’ is a single script file (in the form of my_file.py) that itself may contain multiple functions, variable declarations, class (object) definitions, and the like, kept in this single file because of their related functionality. A ‘package’ in Python is a directory with at least one module and (generally) a standard __init__.py file that informs Python a package is available and its name. Python packages and modules are named with lower case. A package name is best when short and without underscores. A module may use underscores to better convey its purpose, such as do_something.py. For our project based on Cooking with Python and KBpedia (CWPK), we will pick up on this acronym and name our project ‘cowpoke‘. The functional module we are starting the project with is extract.py, the module for the extraction routines we have been developing over the past few installments.. Perplexing Question…
topic: CWPK
topic: KBpedia
topic: Semantic Web Tools
has reply: comment-507583
has reply: comment-507584
has reply: comment-507912
links to: Cooking with Python and KBpedia
links to: DRY
links to: Jupyter Notebook
links to: Spyder
links to: IDE
links to: Python
links to: CWPK #9
links to: #11
links to: cb1-1
links to: cb1-2
links to: CWPK #33
links to: cb2-1
links to: cb2-2
links to: cb3-1
links to: cb3-2
links to: cb4-1
links to: cb4-2
links to: cb4-3
links to: cb4-4
links to: cb4-5
links to: cb4-6
links to: cb4-7
links to: cb4-8
links to: cb4-9
links to: cb4-10
links to: cb4-11
links to: cb4-12
links to: cb4-13
links to: cb4-14
links to: cb4-15
links to: cb4-16
links to: cb4-17
links to: CWPK #32
links to: cb5-1
links to: cb5-2
links to: cb5-3
links to: cb5-4
links to: cb5-5
links to: cb5-6
links to: cb5-7
links to: cb5-8
links to: cb5-9
links to: cb5-10
links to: cb5-11
links to: cb5-12
links to: cb5-13
links to: cb5-14
links to: cb5-15
links to: cb5-16
links to: cb5-17
links to: cb5-18
links to: cb5-19
links to: cb5-20
links to: cb5-21
links to: cb5-22
links to: cb5-23
links to: cb5-24
links to: cb5-25
links to: cb5-26
links to: cb5-27
links to: cb5-28
links to: cb5-29
links to: cb5-30
links to: cb5-31
links to: cb5-32
links to: cb5-33

Mike Bergman
type: User

Mike Bergman
type: Person

Cooking with Python and KBpedia
label: CWPK listing

Class and Instance Variable

Understanding self in Python

The self variable in python explained

class v instance variables

self in Python, Demystified

What is __main__.py?

using sets to find unique items

KBpedia

direct download

notify me