Convenience functions related to modules and importing.
Latest release 20210123: module_attributes: skip values from other modules if we know the module (computed values like tuples have no module and still need to be returned).
Function direct_imports(src_filename, module_name=None)
Crudely parse src_filename for import statements.
Return the set of directly imported module names.
If module_name is not None,
resolve relative imports against it.
Otherwise, relative import names are returned unresolved.
This is a very simple minded source parse.
Function import_module_from_file(module_name, source_file, sys_path=None)
Import a specific file as a module instance, return the module instance.
Parameters:
module_name: the name to assign to the modulesource_file: the source file to loadsys_path: optional list of paths to set assys.pathfor the duration of this import; the default is the current value ofsys.path
Note that this is a "bare" import;
the module instance is not inserted into sys.modules.
Warning: sys.path is modified for the duration of this function,
which may affect multithreaded applications.
Function import_module_name(module_name, name, path=None, lock=None)
Import module_name and return the value of name within it.
Parameters:
module_name: the module name to import.name: the name within the module whose value is returned; ifnameisNone, return the module itself.path: an array of paths to use as sys.path during the import.lock: a lock to hold during the import (recommended).
Function module_attributes(M)
Generator yielding the names and values of attributes from a module which were defined in the module.
Function module_files(M)
Generator yielding .py pathnames involved in a module.
Function module_names(M)
Return a list of the names of attributes from a module which were defined in the module.
Release Log
Release 20210123: module_attributes: skip values from other modules if we know the module (computed values like tuples have no module and still need to be returned).
Release 20200521:
- New import_module_from_file function to import a Python file as a module instance.
- New direct_imports(src_filename,module_name=None) returning the set of directly imports module names.
Release 20190101: New functions: module_names, module_attributes.
Release 20160918:
- New generator function module_files yielding pathnames.
- import_module_name: accept name=None, just return the module.
- Add empty "install_requires" for DISTINFO completeness.
Release 20150116: Initial PyPI release.
Metadata
Release files for cs-py-modules 20210123
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cs.py.modules-20210123.tar.gz | 4.3 kB | Without provenance | Details for cs.py.modules-20210123.tar.gz |
Release files / cs.py.modules-20210123.tar.gz
| Download URL | cs.py.modules-20210123.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d4a31baf8a7ab6756efca0e91dd4e5436a772d18b82559950bb7a17bf59b8fd
|
|
BLAKE2b-256 checksum How to use checksums |
08608ad188630ac73c0c45bcec2f6556cbb4381c7ec12a167d7d21afa37d679d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.9.1
|
Security for cs-py-modules 20210123
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.