Programming in Python: Follow up QA from the 1/8/2020 Webinar

Melissa
Meraki Alumni (Retired)
Meraki Alumni (Retired)

Programming in Python: Follow up QA from the 1/8/2020 Webinar

Hi everyone!

 

We're excited for the upcoming Python SDK webinar tomorrow - registration is still open here!

 

We'll use this thread for any ongoing QA after the show. For folks who are unable to join us for the live broadcast, this (and other Meraki webinars!) will be available on-demand through the same link/channel above. 

 

We have another session next week on Node-Red and will start a topic on that soon. Sign up here.

 

See you soon!

8 Replies 8
Uberseehandel
Kind of a big deal

I've registered for the Node Red seminar on 14 January (hope I'm back from London in time).

 

Having spent a great chunk of my time in academia working on language design, I still shudder whenever presented with looking at anything written in Python. Honestly, it is as full of appalling error-inducing features as the original Fortran, that attracted attention thanks to a number of stellar programming misunderstandings so that their NASA missions were destined for failure.

 

Being able to use Node-Red with the Meraki API is a great alternative option. As a bonus, I have found that when communicating with engineering types, they readily understand what is going on.

Node-RED-Scanning-API-animated[1].gif

 

https://developer.cisco.com/meraki/build/node-red-and-meraki-apis-demo/

 

It is worth giving it a go.

Robin St.Clair | Principal, Caithness Analytics | @uberseehandel

Hi, @chengineer.

I watched your webinar held on Jan 8 and it is really helpful. Thank you very much.
However, can I ask something about the difference between meraki-sdk-1.5.0 and meraki-0.70.4?

Although the contents about meraki-sdk-1.5.0(https://developer.cisco.com/meraki/api/#/rest/guides/python-sdk-quick-start) are in Meraki-DevNet homepage, updated meraki-0.70.4(https://pypi.org/project/meraki/) is introduced on Jan 8.

I did tests of two SDKs all, but I wonder what is the biggest difference between them. (Only components of each library?)

chengineer
Meraki Alumni (Retired)
Meraki Alumni (Retired)

Hi @Namgyu, thanks for your feedback. The "SDK" (this repository) was generated by a third-party API tool, and unfortunately not only does it contain bugs, it is also not intuitive (need to import extra controllers, models, exceptions), and does not include features we want for an API to manage networking infrastructure.

The new "library" (repository and package) is similar only in that the functions used are also under-the-hood based on the OpenAPI specification, but includes features listed there on GitHub meant specifically for Meraki's platforms.

 

We do need to update the Developer Hub webpage that you have linked there, and in the meantime, the recommendation is to migrate to the latter if you are using the former.

Solutions Architect @ Cisco Meraki | API & Developer Ecosystem

Thank you very much. Your reply is really helpful.
And thank you for having pointed out my wrong word use. 😉
kruse
Here to help

Hi,

 

Attended the seminar, and I really liked it 🙂

 

One thing, when I try to use the new API, I get this error:

 

AttributeError: module 'meraki' has no attribute 'DashboardAPI'

 

I get the error when I try run the example script: New_Client_Listing.

 

This is an example code I am running, and the same error:

api_key = 'A_API_KEY'

import meraki

m = meraki.DashboardAPI(api_key)
orgs = m.organizations.getOrganizations()
print(orgs)

 

Sure I am doing something wrong here, but what? Can you point me in the right direction. I have upgraded the 'Meraki' module from 0.32 to 0.70.4 with pip3 install --upgrade.

 

Thank you

chengineer
Meraki Alumni (Retired)
Meraki Alumni (Retired)

Hi @kruse, thank you for joining, and sorry I saw your question late and didn't answer it verbally!

 

In your folder/directory where you have your source code, is there a file meraki.py or folder meraki already? If so, you will need to remove that first, since what Python does with import commands is to first try the local directory first, before using packages installed.

Solutions Architect @ Cisco Meraki | API & Developer Ecosystem

Hey , @chengineer

That is the difference from me a script kiddie and a pro :-D. Thank you very much for talking the time to answer me.

No problem, I did ask the question a couple of hours after the presentation was over. 😉 And I don't expect to get a reply the moment after I post something :-D.

I will check up on that, but I think that is the problem. I remember that under the 0.32 installation, I did copy something to that library.

Regards, kruse

@chengineer : It worked, thank you one more for your help.
Get notified when there are additional replies to this discussion.