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()
from jovian.utils import api, git
filename = _parse_filename(get_notebook_name())
res = api.create_gist_simple(filename)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-13-e2bed322f5c0> in <module>
10 from jovian.utils import api, git
11 filename = _parse_filename(get_notebook_name())
---> 12 res = api.create_gist_simple(filename)
~/miniconda3/envs/jovian-py-dev/lib/python3.5/site-packages/jovian/utils/api.py in create_gist_simple(filename, gist_slug, privacy, title, version_title)
66 auth_headers = _h()
67
---> 68 with open(filename, 'rb') as f:
69 nb_file = (filename, f)
70 log('Uploading notebook..')
TypeError: invalid file: None
1+1
2