Skip to content

Instantly share code, notes, and snippets.

@rjurney
Created June 9, 2022 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjurney/a89e7f4d586c349ec276d15993f7d9ab to your computer and use it in GitHub Desktop.
Save rjurney/a89e7f4d586c349ec276d15993f7d9ab to your computer and use it in GitHub Desktop.
Example of a GraphletBaseClass interface for serializing plain old python objects as DataFrames to encapsulate ETL logic inside a reusable class
class GitRepo(GraphletBaseClass):
"""A GitRepo is a source code repository in a knowledge graph about the open source ecosystem."""
structure = "node"
name = "repo"
def __init__(self, name, url, description, platform):
"""Instantiate a Git Repo given its properties"""
self._id = uuid.uuid4()
self._name = name
self._url = url
self._description = description
self._platform = platform
@graphlet.property("string", 1)
def name(self):
"""Parse a name and return it"""
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment