Made a quick and dirty 1st attempt at generated python library and shell CLI


The API description page looked structured enough so I had a go at it with my api generator to make a python library and a shell CLI:

I had to do some manual editing that should either be fixed for consistency in the docs, patched out, or put into the scraper code.

>>> from pipedreamer import Pipedream
>>> pd = Pipedream(pipedreamer_oauth='MYOAUTH')
>>> pd.
pd.auto_subscription_create(  pd.component_show(            pd.orgs_subscriptions_list(   pd.source_events_delete(      pd.users_me(                  pd.webhook_delete(                      pd.components_registry_show(  pd.pipedreamer_oauth          pd.source_update(             pd.users_me_sources_(         pd.workflow_event_summaries(
pd.client                     pd.headers                    pd.retry_on                   pd.sources__create(           pd.users_me_subscriptions(
pd.client_args                pd.max_retries                pd.source_delete(             pd.subscription_create(       pd.users_me_webhooks(
pd.component_create(          pd.orgs_sources_list(         pd.source_event_summaries(    pd.subscriptions_delete(      pd.webhook_create(
>>> pd.users_me()
{'data': {'id': 'u_5MhdrRJ', 'username': 'fprimex', 'orgs': [], 'email': '', 'daily_compute_time_quota': 1800000, 'daily_compute_time_used': 0, 'daily_invocations_quota': 333, 'daily_invocations_used': 0}}

$ cd local/bin
$ ln -s ~/code/pd-cli/bin/pd 
$ cd 
$ . code/pd-cli/lib/completions.bash 
$ pd config -oauth MYOAUTH
$ cat ~/.pd/pdrc 
$ pd 
auto-subscription  components         source             subscription       users              workflow           
component          orgs               sources            subscriptions      webhook            
$ pd users me 

If this seems useful or of community interest I can tighten it up so everything is actually there and usable, otherwise I’ll probably just let it die on the vine.


Brent W.

Here’s the generator: GitHub - fprimex/apigen at pipedream