guide

Simple object to navigate complex python objects

https://github.com/thorwhalen/guide

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (5.9%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Simple object to navigate complex python objects

Basic Info
  • Host: GitHub
  • Owner: thorwhalen
  • License: apache-2.0
  • Language: Python
  • Default Branch: master
  • Size: 29.3 KB
Statistics
  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • Open Issues: 1
  • Releases: 0
Created over 5 years ago · Last pushed almost 2 years ago
Metadata Files
Readme License

README.md

guide

Simple object to navigate complex python objects

To install: pip install guide

Examples

Object that provides a mapping interface to the attributes of python object.

The keys will be the names of the attributes and the values will be Attrs instances of said attributes.

```pydocstring

import guide from guide import Attrs a = Attrs(guide) sorted(a) # you would usually use list instead of sorted but the latter is used for test consistency ['Attrs', 'ObjReader', 'base', 'util'] aa = a['Attrs'] sorted(aa) ['get', 'head', 'items', 'keys', 'modulefrompath', 'updatekeyscache', 'values'] ```

Here's how you could implement a generator of paths (tuples) of internal module of a given module:

```python from guide import Attrs import inspect

def internalmodules(module, path=()): if not isinstance(module, Attrs): module = Attrs(module) prefix = module.src.name_ for k, v in module.items(): if inspect.ismodule(v.src) and v.src.name.startswith(prefix): yield path + (k,) yield from internal_modules(v, path=path + (k,)) ```

```pydocstring

import guide for path in internalmodules(guide): ... print(path) ('tools',) ('tests',) ('tests', 'simpletests') ('base',) ('util',) ```

Recursively collecting objects from modules, submodules, attributes...

The base function for this is guide.tools.recollect. The following submodule_callables is simply constructed from recollect.

```pydocstring

import guide print(*sorted(set(x.name for x in guide.tools.submodulecallables(guide))), sep='\n') Attrs ObjReader copyattrs internalmodules isanobjofmodule ishashable notunderscoreprefixed recollect submodule_callables ```

Owner

  • Name: Thor Whalen
  • Login: thorwhalen
  • Kind: user
  • Location: Mountain View, CA
  • Company: Analog Devices

R&D in Machine Learning Systems

GitHub Events

Total
Last Year

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 16
  • Total Committers: 1
  • Avg Commits per committer: 16.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Thor Whalen t****1@g****m 16

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 0
  • Total pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • dannys0401 (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 152 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 4
  • Total versions: 8
  • Total maintainers: 1
pypi.org: guide

Simple object to navigate complex python objects

  • Versions: 8
  • Dependent Packages: 1
  • Dependent Repositories: 4
  • Downloads: 152 Last month
Rankings
Dependent repos count: 7.5%
Dependent packages count: 10.0%
Average: 20.7%
Downloads: 24.2%
Forks count: 29.8%
Stargazers count: 31.9%
Maintainers (1)
Last synced: 11 months ago

Dependencies

setup.py pypi