Skip to content

Codehub CLI tool written in Python (Paste within your Python projects with no pain)

License

Notifications You must be signed in to change notification settings

codehub-ir/codehub-cli

Repository files navigation

CodeHub-CLI

SimpleCodeHubcommand-line client program uses API services. Start editing themain.pyfile, then try to make your queries and run them up.

Get a Snippet ⇒main.py
fromcomponentsimportGetSnippet

snippet=GetSnippet('<SID>')# GetSnippet Obj
data=snippet.get()# Data retrievement
print(data)
Push a Snippet ⇒main.py
fromcomponentsimportGetSnippet,PushSnippet,Language

configs={
'title':'TITLE',
'script':'SCRIPT',
'language':'go',
}

snippet=PushSnippet(**configs).push()
print(snippet)

Optionals

There are some fields you are able to leave them empty.detailanderrorfields are the optional parameters you may not want to fill them up, so you use the exact keywords to give other parameters the values you want.

fromcomponentsimportGetSnippet,PushSnippet,Language

configs={
'title':'TITLE',
# 'details': 'DETAILS', Optional
'script':'SCRIPT',
# 'error': 'ERROR', Optional
'language':'go',
}

snippet=PushSnippet(**configs).push()
print(snippet)
Custom Language Model

You can also useLanguageclass to use the default languages of the program. You might use a language which is not listed in theLanguageclass, so write it by yourself.Up to 500 languages are available now.

fromcomponentsimportPushSnippet,Language

lang=Language()
snippet=PushSnippet(...,lang.Python)# Or PushSnippet(..., ' Python ')
snippet.push()

Develop it

Make changes in the main file or carry up the classes in your program. Don't forget theGPL-3.0.Develop it for free:)