How to use safe_client_libs in python?


Quick note. I had 15 minutes to poke around, and the auth_set_additional_search_path method was just the ticket.

“void auth_set_additional_search_path(char const* new_path, void* user_data, void (*o_cb)(void* user_data, FfiResult const* result));” to the cdef, and calling with

lib2.auth_set_additional_search_path(‘char[]’,’…/compiled_binaries’.encode()), ffi.NULL, change_crust_location_cb)

before the stem_exe command indeed initializes from the provided config, and doesn’t create a new one in the python bin directory. Victory!

Lots of work to do, but 100% possible to make a portable package with no leakage into the python install :slight_smile: Look forwards to having more time on friday.


This is indeed the case… bundling it as a compiled .exe would get around this. Using the provided method before initializing the stem is far cleaner and more flexible though. :slight_smile:


Okay - I have the strong impression you have a plan!
That is way more than my poking around so I’m looking forward to learning new things =)


Well into it now. Expect a large pull request this eve.


Pull request sent. It is now reorganized as an importable, installable and pypi friendly library. Automatically reads and binds the headers, then binds the local config file before logging in. Hello world in examples demonstrates the basic api. Lots to do, but now we are rolling. We should continue #todos over email. Looking forwards to serving the community


I was working late today - will have a look after a shower and yes makes sense! Awesome!


Minor announcement

@DASK and I just created a telegram group for coordinating everything connected to the Python api

In case someone else wants to get involved too we’re at :slight_smile:


just a little status update because i’m slightly excited :smiley:

We haven’t been inactive over the last days/weeks and as you know we have done a major refactor to create something easier to bundle as pip-installable.

we now added an automated test framework for linux/osx/windows (for python 3.6) and an automated documentation build through readthedocs - the status of the builds can be seen on the github page (just as with the maidsafe repos :wink: )
(for starters we’ll prioritize linux because that’s what we work on right now - but when we reach a point where one can actually use pySafe to interact with the network we’ll take care of the other platforms as well)

status is shown for master and dev branch - i guess we’ll be working with the dev branch a lot more for a little while longer now :slight_smile:

ofc the tests are not testing really safe network relevant stuff yet but we’ll probably upgrade them later on to interact with either mock routing or the real network to do some very basic tasks like logging into an account or retrieving some data to make sure we don’t break the most basic stuff when merging new development/pull requests into the master branch
(at least that’s the plan :smiley: )

those tests get executed for every pull request too and we can just see

and merge or not merge based on the results :slight_smile: (sooo cool!)

first skeleton for docs is available at

and we changed our license to MIT to be in line with the rest of the project (bindings) :slight_smile:

it’s going forward fast and I can’t wait to see where we’re heading xD


Hey @riddim - let me know when you’re ready for some ‘bull in a china shop’ type testing, You know an idiot doing things most sensiible people wouldn’t. I can do that!


The day for hostile testing is coming… Once we have the proper headers, then the features in the ‘experiment’ branch can be merged: automated verification of the binaries versus the headers, thread handling, command line console, etc. Then we can build the various data type classes. Riddim has done some great work here, and I will add my next bit to the pile very soon. Hoping to have it ready before alpha3 :stuck_out_tongue:


sooooooooo since @nbaksalyar did the difficult part and created the c headers :smiley: … i wasn’t able to stop myself in trying to find out how to make a first authentication request =D
(ohoh … i was completely clueless how the workflow was at first … )

I still am a bit lost on how to call authenticator-plugin from python xD … so … that part needs to be investigated … but everything before that happened in python!

thanks to @oetyng s earlier investigations on the API i cheated a bit and stole the idea of first opening the AuthRequest just in a browser that relayed it to the authenticator :slight_smile:

baduffba! i guess we are getting closer! (and if a browser that knows nothing about safe can do it than python will for sure offer a way to do it as well :slight_smile: )