Quickstart
Step by step
1 | 2 |
---|---|
Review your inbox and confirm account | |
![]() | ![]() |
3 | 4 |
---|---|
Click on "Return to Sign In section" and sign in with your credentials | Click your Profile button on the top right and go to "Settings". Inside "Information for developers" click on "Create" to generate your API Token and save this information, the "Universe ID" and the "Business ID" also known as Workspace ID. |
![]() | ![]() |
To use Shimoku’s API first install our SDK library
See it from Github at:
And in your
Python +3.9
install itpip install shimoku-api-python
If you want to install versions prior to v.0.13.3 (this one included), you'll need to install the following requirements first:
pandas==1.5.2
requests==2.28.1
datetime==4.9
json5==0.9.10
shimoku-components-catalog==0.2
Go ahead and copy paste to see
🪄
from os import getenv
import shimoku_api_python as Shimoku
access_token = getenv('SHIMOKU_TOKEN')
universe_id: str = getenv('UNIVERSE_ID')
workspace_id: str = getenv('WORKSPACE_ID')
s = Shimoku.Client(
access_token=access_token,
universe_id=universe_id,
)
s.set_workspace(uuid=workspace_id)
s.set_board('Custom Board')
s.set_menu_path('catalog', 'bar-example')
language_expressiveness = [
{'Language': 'C', 'Statements ratio': 1.0, 'Lines ratio': 1.0},
{'Language': 'C++', 'Statements ratio': 2.5, 'Lines ratio': 1.0},
{'Language': 'Fortran', 'Statements ratio': 2.0, 'Lines ratio': 0.8},
{'Language': 'Java', 'Statements ratio': 2.5, 'Lines ratio': 1.5},
{'Language': 'Perl', 'Statements ratio': 6.0, 'Lines ratio': 6.0},
{'Language': 'Smalltalk', 'Statements ratio': 6.0, 'Lines ratio': 6.25},
{'Language': 'Python', 'Statements ratio': 6.0, 'Lines ratio': 6.5},
]
s.plt.bar(
order=0, title='Language expressiveness',
data=language_expressiveness, x='Language',
y=['Statements ratio', 'Lines ratio'],
)
Once you execute this piece of code you can see the following plot in your shimoku.io page:

Language expressiveness ratio in comparison to C
As it can be seen in the previous image the first element in the menu is called 'Custom Board', this element is a board. The boards are necessary for the contents of a menu path to be seen, if a menu path is not included in a board it will not appear in the page. For this reason the SDK always attaches the menu paths to a board when creating content, ideally the user should define which name to use for the board, but when it is not specified it will use the name 'Default Name'.
The method to specify the board's name that the SDK should use is:
s.set_board(name: str)
This will ensure that all the menu paths used after that point are included in
name
.There is a possible issue that can arise from executing code multiple times with different board names, as it can be seen in the result two boards have been created with the same menu path attached.
In case this wasn't the expected result, it can be solved very easily using the method:
s.board.force_delete_board(uuid: str, name: str)
This will delete a specified board, but first it will delete all of it's links to it's menu paths, so it will always be able to delete an existing board without having to touch the menu paths. In this case the method should be used like this:
s.board.force_delete_board(name='Default Name')
Then there will only exist the 'Custom Board' linking to the 'catalog' menu path.

Two boards with the same menu path
There is now the option to monitor the SDK flow of execution, with three levels of verbosity. This will help to know where the error occurred, so it will make bug-fixing a lot easier, It also outputs how much time the function call has taken to quickly profile code. To enable it you just have to set the parameter verbosity from the client to
INFO
or DEBUG
. s = Shimoku.Client(
access_token=access_token,
universe_id=universe_id,
verbosity='INFO',
)
The
INFO
keyword will be the most useful for visualizing the execution while DEBUG
is made so it outputs as much information as possible. You can also set it to
WARNING
but this is the default behavior and will have no effect, it will output only warnings and errors.The logging level of the Shimoku SDK can be configured dynamically during execution by calling the
s.configure_logging
function with the desired verbosity
level (either 'DEBUG', 'INFO', or 'WARNING') and an optional channel
to write the log output to. This allows for fine-grained control over the logging behavior and output, making it easier to debug and profile the SDK's execution.Asynchronous execution which means that code execution doesn't need to stop for requests, freeing up time to make more requests. To enable it, simply set the
async_execution
parameter to True
when creating the client object:s = Shimoku.Client(
access_token=access_token,
universe_id=universe_id,
verbosity='INFO',
async_execution=True,
)
By default, execution is set to sequential. You can toggle between sequential and asynchronous execution using the following functions:
s.activate_async_execution()
s.activate_sequential_execution()
When asynchronous execution is enabled, tasks are added to a task pool and executed once a strictly sequential task is reached. A function has been added to allow users to trigger the execution of tasks, which is
s.run()
.Be sure to call
s.run()
at the end of your code to ensure all tasks are executed before the program terminates.from os import getenv
import shimoku_api_python as Shimoku
access_token = getenv('SHIMOKU_TOKEN')
universe_id: str = getenv('UNIVERSE_ID')
workspace_id: str = getenv('WORKSPACE_ID')
s = Shimoku.Client(
access_token=access_token,
universe_id=universe_id,
verbosity='INFO',
async_execution=True,
)
s.set_workspace(workspace_id)
s.set_board('Custom Dashboard')
s.set_menu_path('catalog', 'bar-example')
language_expressiveness = pd.read_html(
'https://en.wikipedia.org/wiki/Comparison_of_programming_languages')[2]
s.plt.bar(
order=0, title='Language expressiveness',
data=language_expressiveness, x='Language',
y=['Statements ratio[48]', 'Lines ratio[49]'],
)
s.run()

Sign in

Dashboard

Theme custom

Invitation users view
With an unlimited number of users
Last modified 27d ago