github_custom_module v1.0.0
github_custom_package
Experimental Python Package to be published in npm.
Contents
It contains a single module called cust_mod.py
Functions
- dbx_API() :
Classes
- 'Folder_Path':
- set_folder_path(): set the path
- retval_path() : return the variable newPath
- 'db_conn':
- init: instance in order to cycle over dict_keys
- db_conn() : connection to MySQL
Notes
There are huge differences between classes and modules in Python.
Classes are blueprints that allow you to create instances with attributes and bound functionality. Classes support inheritance, metaclasses, and descriptors.
Modules can't do any of this, modules are essentially singleton instances of an internal module class, and all their globals are attributes on the module instance. You can manipulate those attributes as needed (add, remove and update), but take into account that these still form the global namespace for all code defined in that module.
Modules can contain more than just one class however; functions and any the result of any other Python expression can be globals in a module too.
So as a general ballpark guideline:
- Use classes as blueprints for objects that model your problem domain.
- Use modules to collect functionality into logical units.
Then store data where it makes sense to your application. Global state goes in modules (and functions and classes are just as much global state, loaded at the start). Everything else goes into other data structures, including instances of classes.
Github Usage
To update a npm package is sufficient to update the version in the .yaml file associated to the workflow.
2 years ago