I recently pusblished my first official powershell module to the powershell Gallery Called RegardsCitoyensPS . RegardsCitoyenPS is a PowerShell Module that allow people to retrieve information from  the French democratic process. For more details, click here. (This module is publicly available on github under MIT licence). As with all the open source (public) projects I work on, I keep  learning new things. It never end’s. And for this project this modo was still true.  I learned the process on how to upload a Module using CI with Appveyor, or how to work with classes in a module project in a structuered and a logical way (Blog post is in prepration ;)). But no, this time, there was something more then technical knowledge. Something really surprising that I actually wouldn’t have never thought that PowerShell could teach me…

 

Let me explain:

When you google things about how our democracy works, you will find nice pictures and flows that explains how we elect our president (In france it is a direct vote) and then that he creates a government.

We see a lot of arrows, that explains that we vote for the Deputes through regional votes and that these same deputes will control the actions that are done by the government and discuss national and international issues, propose/vote laws etc..

The API goes pretty deep in the real documents that are produced by our government, and it shows all the details of how the different deputes actually work together. They actually create groups called a “Groupe Parlementaire” or “Groupe Extra parlementaire” to work on different cases Called ‘Dossier’ in French. (Get-RCDossier). Base on this ‘dossier’ they go and discuss it during a ‘seance’,Which is actually just another word for a normal working day. (This resulted in the cmdlet Get-RCSeance). Each depute has a specific amount of time to be able to discuss the subject of the seance about the ‘dossier’. Each of these talks, is called a “Intervention” (Get-RCIntervention).

The parlement groups and extra parlement groups can also produce documents (Get-RCDocument) which can be of several nature: ‘Proposition for a new law’, ‘A report’, “A writable question” etc… and these documents will then be discussed in the parlement during a ‘sceance’.

While working on the module, and looking into all the different objects I got back from the  differnt API routes, I had to do understand the structure of thesed objects, how they were linked together in order to be able to write the appropraite functions and cmdlets for the module. Digging into the objects made me realize where the connection were, and which entity produced which document.

After a few days of working on this project, I realized that my knowledge in the inner processes of our government was pretty basic, just the basic high level knowledge that you can easily find on wikipedia. But how our parlement really works, was a mystery for me (or to be honnest, I actually never really thought about it).

I realized that thanks to the efforts I made in trying to build this powershell module, I suddently understood how our parlement really works. The inner process. And THAT(!), is what surprised me and what is so priceless to my eyes.

 

This time I would like to present you a small project on which I have been working on for the last couple of weeks, and that I recently published.

 

When I published the first version of RegardsCitoyensPS, I had a very special feeling growing inside me. I had the impression I provided something more then just a powershell module for other scripters like me. I had the feeling, that I did something something bigger. Something that would be use full (in a way) for our country, and the democracy we are living in (on my very low and humble level, of course..)

 

But why is this important?

I agree, this has nothing to do with datacenter or Cloud management, but this module can be the base of so many  projects that could be used to make our democracy cleaner and more transparent that I am really really excited to see how this is going to forward.

The main Github Project and the introductory article are both written in French, since it made sense to me to address this module first to the people that would probably use it the most: The french citizens, and as everybody might know, English can be a bit difficult for some of the French people of the older generation. (There has been some drastic investements, and the global english level and comprehension really stung).

The help files in the module itself are all written in French. There is currently no plan yet to translate them to English.  If there if there is a demand asking for it, It could be a possibility that we then do the translation into English.

 

What can we concretley do with RegardsCitoyenPS?

First, be sure that you have installed the module. If not, you can install it using the following command:

It should not take more then a few seconds to download and install the module.

For the moment we have 10 different cmdlets to work with (and a few in the pipe for the next release)

 

We have the possibility to query the list of our deputies using the following command:

The list of all our political groups:

“Since France has a system of ‘multipartisme’ we have quite a few political parties in our country. Not all of them are in the parliament though, so, only the ones that have an elected deputy in the parliament are returned.”

List all the deputies members of a specefic political group

 

We can then go and dig a bit deeper in some of the work that the deputies have been working on.

 

This ‘Dossier’ (which means folder in french) is about the inner security and the discussions about the measures against terrorism that should be adopted or not.

If you have a closer look at the object, we see that ‘some’ of the properties seem to be empty. Since some of the discussions could become so big, and so many different people could be involved in it, that the objects could get really big, and that would have a negative performance impact on the cmdlet.

 

Therefor,  this cmdlet only returns some basic information first, and if more information is needed. I decided to implement this using a Class Method so that the information would be available with the rest of the object after the additional calls

Lets save the results in a variable and look a the same example again, but this time, we will use the class method to gather the rest of the properties.

Now that we know that there is a method called full()  on this object of type Dossier we go ahead and call it.

This will take a short while to finish, since there is a lot to go and fetch. But after a few seconds, the object is sent back to us, with properties “intervenants”,”seances” and “Documents” filled.

It is now possible to dig deeper in these values. For example, to have the list of all the deputies that actually took part in this debate, you would use the following line ( I have select the Name, political group the deputy is member of, and the circonscription it has been elected in (more or less from which region in France).

(I truncate the results for brievety).

The interesting part is yet to come. The debate about a specific topic is held during a regular working day. Each of a regular work day, is called a ‘seance’. So to get the details about what has been exactly said, and by who, can be achieved using the following lines of code:

 

If we look in the Property called Contenu, we see everything that has been discussed in for that particular Law. We can learn, who was for it, who was against it, and what each party said about it. I have only display an extreme small portion of what is possible to have. The contents are extremly detailed, and we can follow / parse a complete debate, from start to the vote of law, just through reading the different powershell objects.

In this particular case, there has been 7715 exchanges (AS the following command proves).

 

 

Interesting isn’t it? And that is just the tip of the iceberg! I do have a lot of ideas to expand this module, and I hope people will participate in this project.

#Stéphane