Learn practical skills, build real-world projects, and advance your career
Created 4 years ago
import json
with open('.jovianrc') as f:
jovianrc = json.load(f) # now this a python dict you can get info according to the keys
# use the `jovianrc` variable inside with to get all the required info
jovianrc
{'notebooks': {'Untitled.ipynb': {'slug': '2a8cf05781e14d189a457896874b5424'},
'livedemo.ipynb': {'slug': '37d3c7eee26d4199b6cc2f466520f146'},
'reset_jovian.ipynb': {'slug': '933617264c4042b795801cecf70d239e'},
'test.ipynb': {'slug': '4a9f67c670054eb4a5d66c1bedef1994'},
'test_see-if=it,works.ipynb': {'slug': 'd88233dd02d7488f9fea43c902cde840'}}}
from jovian.utils.jupyter import get_notebook_name
from jovian.utils.jupyter import get_notebook_history
from jovian.utils.jupyter import set_notebook_name
from jovian.utils.jupyter import get_notebook_path
from jovian.utils.credentials import read_webapp_url
i = get_notebook_name()
import json
with open('.jovianrc') as f:
jovianrc = json.load(f)
lib = jovianrc['notebooks']
x = lib[i]
x2 = x['slug']
i2 = i[:-6]
URL = 'https://jovian.ml/'+i2+'/'+x2
print(URL)
print(get_notebook_path())
https://jovian.ml/test/addb53c9b9144b3382f1386dabcdbee3
/home/bendesu/workspace/senior_design/test.ipynb
def _parse_filename(filename):
"""Perform the required checks and get the final filename"""
# Get the filename of the notebook (if not provided)
if filename is None:
if in_script():
filename = get_script_filename()
elif in_notebook():
filename = get_notebook_name()
return filename
from jovian.utils import api, git
filename = _parse_filename(get_notebook_name())
res = api.create_gist_simple(filename)
print(res['title'])
[jovian] Uploading notebook..
test-0ae5f
1+1
2