
French civil code now on GitHub - Remiii
https://github.com/steeve/france.code-civil
======
gadders
In contrast, the list of Wales-only laws is (or used to be) maintained by one
French woman at a Welsh university:

"But any queries may well be referred to Marie Navarro, the editor and chief
researcher of Wales Legislation Online.

Like everyone in Wales, the judges use this website when they need to find out
whether the law in Wales on a particular topic is different from English law.

The database is not run by the judiciary, by the Welsh Assembly Government or
by one of the commercial publishers that pride themselves on keeping their
subscribers up to date with English law.

It was set up in 1999 by Cardiff University Law School, and is run by Miss
Navarro, a French lawyer who came to Wales on a European scholarship 13 years
ago and decided to stay."

[http://www.bbc.co.uk/news/uk-12674539](http://www.bbc.co.uk/news/uk-12674539)

~~~
JosephRedfern
No longer the case, apparently: [http://www.wales-
legislation.org.uk/](http://www.wales-legislation.org.uk/)

------
thomasbachem
All German federal laws and regulations are here:
[https://github.com/bundestag/gesetze](https://github.com/bundestag/gesetze)

I do especially like the GitHub avatar:
[https://avatars1.githubusercontent.com/u/1994383](https://avatars1.githubusercontent.com/u/1994383)
;)

~~~
mpasternacki
Is this account actually maintained by Bundestag (or other actual piece of
state administration), or is it just a mirror? Also, either German law is
really mature and stable, or this repository is unmaintained: last commit oin
master is Jan 2013.

I'd love to see such a repository for the acts in my country, by the way, but
the official source is a PDF, and most of the published acts are actually
patches to existing (already heavily "patched"), like "In the section II, item
13a, change words 'foo and bar' to 'foo, baz and quux'". This mess untangled
into an actual, highlighted, unified text is an actual product, and lawyers
happily pay the subscription. I imagine it is similar in other countries.

~~~
arcatek
It's the same thing in France, but that's why the OP repo is great: you can
see the actual change as a usual diff ([https://github.com/steeve/france.code-
civil/commit/0d5337622...](https://github.com/steeve/france.code-
civil/commit/0d53376225b4502851e2ec062a80e45924e265ce)).

I'm not sure how they do it, but I guess that it wouldn't be extremely hard to
have a small grammar to automatically convert the legalese patch into an
actual git patch (most of the time, the sentences which wrap the editions are
the sames).

~~~
mpasternacki
If you have a text version, at least preprocessing and proposing changes could
be doable (especially that as far as I know, formal French is quite uniform -
but then, it's what I heard from others, all French I actually know comes from
a Dexter's Laboratory episode). In Poland, though, the original acts are
published as PDFs, and the text extraction itself needs assistance, if it's
even possible without OCR: the international agreements that are side-by-side
in multiple languages (Polish, other party, sometimes also English) are
usually image scans saved as PDFs.

------
andyjohnson0
This github repo seems to treat the French legal code as a flat text file.
Which is useful, but I'm guessing doesn't do a good job of capturing
_structural_ changes to the legal code. Is this fair?

So I'm curious: how do legal scholars and practising lawyers track changes to
legal systems over time? Do they use trees, DAGs, or something else? Do they
have concepts similar to change dependencies and regressions? What special
concepts or techniques does the domain require?

The UK has legislation.gov.uk [1], which seems to treat acts of the UK
parliament as some kind of structured objects. Amendments can be accessed, and
there is a timeline feature (for example [2]) that shows changes over time. It
does have the feeling of being incomplete, though, and lagging behind changes
as they happen. So is there some other, canonical, data source that this site
tracks? What is it?

Anyone knowledgeable care to comment?

[1] [http://www.legislation.gov.uk/](http://www.legislation.gov.uk/)

[2]
[http://www.legislation.gov.uk/ukpga/1974/39/section/21?timel...](http://www.legislation.gov.uk/ukpga/1974/39/section/21?timeline=true)

~~~
terminalcommand
I am at my first year of law school in Turkey, so I might be wrong. But in my
country there are private companies who collect and summarize court decisions.
They also offer search engines.

As far as the changes to regulations go, they are announced in the state
paper, with a starting date. All lawyers are obligated to follow the changes.
The ministery of justice also offers a service, they collect all the law texts
and publish them. Although recent changes come with a considarable amount of
delay. So you use it at your own risk.

In germany there is an excellent site:
[http://dejure.org/gesetze/BGB/413.html](http://dejure.org/gesetze/BGB/413.html)
You can browse the regulations and read the comments and decisions based on
that very regulation. I hope we had a similar site here in Turkey.

Moreover, I also have to state that law regulations don't change quite often.
The regulations that change are usually very specialised. All regulations
already have a structural order. Especially code books like civil code have
regulations that can't be treated seperately.

Last but not least, UK and US have a different law system than France. French
law has its roots in Roman law. Nearly all regulations are written in books
like civil code.

~~~
karambahh
Pretty similar in France. Lamy, a subsidiary of Wolters Kluwer is the leading
company. They do the same for a bunch of european countries. Spain, Belgium,
Germany, etc...

------
steeve
I just woke up and wow. Well, I'd be happy to answer any questions you might
have of course.

~~~
antimagic
So how do you go about creating the commits like the example given? Even
though I live in France I've not much looked at French law - the only
exception being a few articles relating to immigration. In those examples,
there are modifications made to preceding laws, and it seems to me that it
would require strong AI to correctly update the original laws as required by
the new law. The example in the README gives the impression that we can just
pull from Git and get the updated version of the whole law, is that correct?
If so, how?!?!

~~~
steeve
It's because legifrance carries snapshots of the articles. Git is very good at
tracking the changes between them.

So for earch article, the codes tracks "when" the article changed, stores it
in a hashtable, and replays the "time" (date) for each snapshot, and creates a
commit each time.

------
rouxrc
Nioce job but it's too bad there's no licence and the building code is
missing.

It's also not really new, Seb35 already did a great job on this previously as
free software: \- [https://github.com/Seb35/CPI](https://github.com/Seb35/CPI)
\- [https://github.com/Seb35/Archeo-Lex](https://github.com/Seb35/Archeo-Lex)
\- [http://blog.seb35.fr/billet/Arch%C3%A9o-Lex%2C-Pure-
Histoire...](http://blog.seb35.fr/billet/Arch%C3%A9o-Lex%2C-Pure-Histoire-de-
la-Loi-fran%C3%A7aise%2C-pour-%C3%A9tudier-son-%C3%A9volution)

Also [http://www.lafabriquedelaloi.fr](http://www.lafabriquedelaloi.fr)
proposes git versioning of the parliamlentary process for each bills:
[http://sunlightfoundation.com/blog/2014/06/25/opengov-
voices...](http://sunlightfoundation.com/blog/2014/06/25/opengov-voices-how-
gitlaw-turns-the-french-parliamentary-process-into-open-data/)

------
highCs
_Finalement, le Code Civil, c 'est une partie du code source de la France. Et
le code source, ca va sur un source control. Point._

Which means - correct me if I'm wrong: "The civil code is like a part of the
source code of France. And then, it should be in a source control."

~~~
maelito
Ultimately, the civil code is one part of France's source code. And a source
code should be on a source control. Period

------
BertrandBordage
I already made something similar (but more user-friendly) a few years ago
using Django:
[https://criminocorpus.org/fr/legislation/civil/](https://criminocorpus.org/fr/legislation/civil/).

And there are similar diff possibilities:
[https://criminocorpus.org/fr/legislation/versions/689/1/diff...](https://criminocorpus.org/fr/legislation/versions/689/1/diff/pdf/)
:)

~~~
LaurentGh
Generated PDF are not really web 2.0 :/

~~~
BertrandBordage
The clients weren’t really web 2.0 ;) The HTML version of diffs is also
available, but not referenced by links:
[https://criminocorpus.org/fr/legislation/versions/689/1/diff...](https://criminocorpus.org/fr/legislation/versions/689/1/diff/)

------
nathanappere
Interesting!

This looks like a demo day project of Le Wagon, a french bootcamp in Paris (I
found a link from their demo day
[https://youtu.be/hHPOV8vz5Q8?t=503](https://youtu.be/hHPOV8vz5Q8?t=503) ).

Where you part of that bootcamp too ? (It seems to reuse the same "Nul n'est
cense ignorer la loi." gimmick!)

------
mintplant
I need to keep in practice with my French, so I've translated the README
below. Let me know if I got anything wrong.

\------

 _The French Civil Code, in Git_

 _Introduction_

Here is a little hack, the result of an afternoon of code: the Civil Code in
Git.

If one considers the law as a set of texts modified by the various assemblies
of the state, one can consider them as a set of text files created
collaboratively.

The members of government, and the various assemblies, work in collaboration
on these files, which, once voted for, are written into the Code (here the
Civil Code).

But there is another category of people who, for fifty years now, have worked
on text files collaboratively, and excel at it: developers. They have created
extremely effective collaboration and tracking tools for working on source
code. The most popular to date is Git.

Git not only allows you to view the source at a time T (snapshot) but above
all to easily visualize the changes in the source (commits). In the analogy to
the Civil Code, this permits the tracking of the changes made by a law.

Combine all of this with the Open Source philosophy, and the second part of
the analogy is made: the modification of source code in an open and public
fashion.

Finally, the Civil Code is a part of the source code of France. And source
code belongs in source control. Period.

 _Example_

Here is for example the commit which authorizes marriage for all:
[https://github.com/steeve/france.code-
civil/commit/b805ecf05...](https://github.com/steeve/france.code-
civil/commit/b805ecf05a86162d149d3d182e04074ecf72)

This is more readable than, for example (cf [http://www.assemblee-
nationale.fr/14/ta/ta0120.asp](http://www.assemblee-
nationale.fr/14/ta/ta0120.asp)):

"At article 165 of the same code, the word: 'before' is replaced by the words:
'during a republican ceremony by'."

 _Technical Note_

Git dates are based on the Unix epoch (01/01/1970), changes before these dates
are all dated 01/01/1970, with incremental seconds; the commit message gives
the correct date.

 _LICENSE_

All files are licensed under Creative Commons
([https://creativecommons.org/licenses/by/4.0/](https://creativecommons.org/licenses/by/4.0/)).

~~~
nmc
As a native French speaker: very good translation.

One small point: I do not understand why you added _" it"_ to the last
sentence of the introduction. Your translation of that particular sentence
feels weird to me, why not simply:

 _" And source code belongs in source control."_

Also, maybe _" différentes"_ (in the third sentence) could have been
translated to _" various"_?

* * *

Aside, note that the original text itself has several errors. Many accents are
missing, some letters or words are missing or doubled. I may submit a PR to
correct them.

Moreover, the text includes many English words (not all of which are common in
French). It even includes a barbarism: _" tracker"_, from English _" track"_
and French common verbal suffix _" -er"_, supposedly a verb supposed to mean
_" to track"_ — a shame, since French has the verb _" traquer"_ to express the
same thing.

~~~
mintplant
_One small point: I do not understand why you added "it" to the last sentence
of the introduction. Your translation of that particular sentence feels weird
to me, why not simply:_

 _" And source code belongs in source control."_

You're right, of course. That was left over when I switched from "it goes in"
to "it belongs in". Fixed!

For _" les différentes assemblées"_, would you say "various assembliess" or
"the various assemblies" in this context?

~~~
nmc
In this context, I would definitely say _" the various assemblies"_ since the
author is obviously designating _the various assemblies working on the Civil
Code_ , not a random ensemble of assemblies.

------
return0
Legal documents are particularly bad to place under source control, because
most of them already reference the previous code they are replacing. And,
since the code is basically readonly what's the point of using github? I think
legal documents do need a versioning system, but it would have to take into
account the peculiarities of the domain (i.e. have each article as a node and
amendments as graph links)

~~~
bolaft
Did you take a look at the repo? It doesn't track new laws, it tracks the
entire Code Civil and considers each new law a "commit", so it works
perfectly. Here, as an example, the commit/law that legalizes same-sex
marriage :

[https://github.com/steeve/france.code-
civil/commit/b805ecf05...](https://github.com/steeve/france.code-
civil/commit/b805ecf05a86162d149d3d182e04074ecf72c066)

You can clearly see that the "commit/law" changes the wordings of various
files to replace "mother and father" by "parents" and "husband and wife" by
"spouses".

~~~
mauricemir
Does it also work out the consequential's

By that i mean if law x is changed to say "blah blah blah" that means that law
Y no longer applies and law Z is changed to say "foo bar bobbins"

~~~
bolaft
No, version control can only handle textual changes, only humans with legal
expertise can work out how one law affects another. Even if there was a graph
that showed all the links between all the laws (which would take an enormous
amount of work to build), it would take a semantic understanding of each
modification to deduce whether it has any impact on other nodes.

------
passepartout
Your licence should be more precise because you cannot put a CC licence on the
legal texts, just on your ReadMe file.

~~~
jordigh
How does French law work? Do the texts of laws have droit d'auteur?

~~~
seszett
As far as I understand from [http://rip.journal-
officiel.gouv.fr/index.php/pages/LO](http://rip.journal-
officiel.gouv.fr/index.php/pages/LO) the laws themselves don't really have an
author, but you are required to mention the source of the texts you reuse.

------
zx2c4
Too bad the date stamps only can go back to 1970-1-1. It's neat, though, to be
able to flip through the history like this.

~~~
Svip
Is git using an unsigned int for time?

~~~
taspeotis
[http://stackoverflow.com/a/24977895/242520](http://stackoverflow.com/a/24977895/242520)

> We freely interchange between time_t and unsigned long in the low-level date
> code

------
svarog
Do they accept pull requests if I find any bugs?

------
ptaipale
What does this offer on top of Legifrance?

[http://eur-lex.europa.eu/n-lex/info/info_fr/index_en.htm](http://eur-
lex.europa.eu/n-lex/info/info_fr/index_en.htm)

(I don't know any French and don't know the particulars of French legal system
that much, so I cannot really assess quickly based on what I can find in the
net).

~~~
mdemare
Isn't that obvious?

Pull Requests! Can you imagine a democracy editing its laws through pull
requests and code review?

~~~
spacemanmatt
...where regional committers are elected, and once elected, act in blocs
against their electorate?

------
rtpg
kind of curious as to how this got generated in the first place

~~~
mackwic
Same here. Diffs published from the Journal Officiel aren't so easy to parse.
I am afraid it could be manually generated, which is a dead end.

~~~
Majestic121
The author mention he did it in an afternoon of code, so it's definitely not
manually generated : "Voici un petit hack, résultat d'une après-midi de code"

I do agree that the technical details would be interesting.

~~~
mackwic
I don't think it's possible to generate a general parser for the Journal
Officiel in an afternoon.

It would make the author a _very_ efficient worker.

~~~
masklinn
It's probably possible to do that for a crawler of
[http://www.legifrance.gouv.fr](http://www.legifrance.gouv.fr) though.

~~~
simlevesque
He said in another comment that it's not how he did it.

------
jackbravo
Mexican constitution: [https://github.com/ceyusa/constitucion-
mexicana](https://github.com/ceyusa/constitucion-mexicana)

------
cranium
I wish all legal proposition was supplied with a diff.

~~~
Rexxar
In a way, it's often the case: law are often modifications of the underlying
reference code (here 'Code civil') and are a set of proposition to change the
wording or to add/remove a sentence from the reference code.

------
peeters
This makes me wonder about how legislators deal with merge conflicts. Since
new laws are often written as "Act X of 1972 is amended as follows: ...", I
wonder if there are ever cases where two laws are in the House at the same
time that would conflict, and how they resolve this. Do they amend the later
law once the first has been signed/given assent?

~~~
walshemj
The way it should work is that any conflicts that require changes are noted in
the motion - by the clerks drafting the law.

If you pass motion A implementing this new law the Law x and Z a deemed to be
negated or changed appropriately.

------
cellover
Now let's anarchy-fork!

------
haosdent
China civil code is on the way. Github, hold on!

------
umadrab
If there's some people interested in french law, I did the French constitution
in JSON [https://github.com/Felixaverlant/French-
Constitution](https://github.com/Felixaverlant/French-Constitution)

------
gtf21
This would be a great idea in general for the legislature of any country, to
be able to see exactly how and when the law was changed would be valuable for
transparency and also research. Commit messages could reference transcripts of
the debates surrounding changes.

~~~
ptaipale
TL;DR: Denmark, Finland, Sweden and presumably others do it already.

I'm surprised if France and other supposedly civilized countries don't do it
on behalf of the Justice Ministry or equivalent. I mean, the fundamental
responsibility of citizens is to adhere to the law (ignorantia juris non
excusat); the fundamental responsibility of government is to make the law
available to citizens because it is not reasonable to require compliance with
laws that are not practically available to citizens.

I'm in Finland, and the full content of law books has been in internet for
almost 20 years, published first by the state-owned publishing house that gave
out the print versions, and more recently by Ministry of Justice who has
contracted the technical execution out. The database structure managing pieces
of legislation dates back to 1980's, but until 1990's it was available only
through a license payment.

Individual laws (and executive orders, state treaties and such) that are
published by parliament or ministries have of course always been public
information and published in the net since 1990's; the important thing is
actually maintenance of "up-to-date" version because the parliament publishes
its laws mostly as "patches" (i.e. only a changed section is reviewed, voted
on, and published).

The database cross-links to published parliamentary process so that the
official background work for each law, section and paragraph is available,
including preparatory statements by parliamentary committees, any dissenting
opinions and so on.

Also more significant precedent cases from high courts are available in
database. (We have a so-called Roman law system where the code is primary
source of law, unlike American/English common law where precedents are more
important; nevertheless neither system is absolute of course, and precedents
do matter in civil law systems as well.)

The database descriptions can be found:

Denmark: [http://eur-
lex.europa.eu/n-lex/info/info_dk/index_en.htm](http://eur-
lex.europa.eu/n-lex/info/info_dk/index_en.htm)

Finland: [http://eur-
lex.europa.eu/n-lex/info/info_fi/index_en.htm](http://eur-
lex.europa.eu/n-lex/info/info_fi/index_en.htm)

France: [http://eur-lex.europa.eu/n-lex/info/info_de/index_en.htm](http://eur-
lex.europa.eu/n-lex/info/info_de/index_en.htm)

Germany: [http://eur-
lex.europa.eu/n-lex/info/info_de/index_en.htm](http://eur-
lex.europa.eu/n-lex/info/info_de/index_en.htm)

Sweden: [http://eur-lex.europa.eu/n-lex/info/info_sv/index_en.htm](http://eur-
lex.europa.eu/n-lex/info/info_sv/index_en.htm)

~~~
mackwic
> I'm surprised if France and other supposedly civilized countries don't do it
> on behalf of the Justice Ministry or equivalent.

Please be kind in your comments.

Also, you're wrong ([http://legifrance.gouv.fr/](http://legifrance.gouv.fr/)),
but that's secondary relatively to the harsh tone you had there.

~~~
ptaipale
Well, I said "surprised _if_ ", not "surprised _that_ ".

The eur-lex link I mentioned lists precisely that site (legifrance) for
France. But as I don't read French and don't know the particulars, what
puzzles me is what is the additional value of putting the same thing in
Github. The maintenance burden seems horrific unless you can pull it
automatically, and even then the actual benefit of using Github is not so
clear to me.

~~~
masklinn
> The maintenance burden seems horrific unless you can pull it automatically

Which is probably relatively easy, legifrace provides reconciliated articles
with history so it should be possible to just crawl the code, see if an
article was updated since the last crawling and generate the relevant commits.

> and even then the actual benefit of using Github is not so clear to me.

Diffs are somewhat more straightforward than the equivalent legalese, and
version-controlled markdown makes for easier programmatic manipulations across
"space" and time than a custom-designed website.

~~~
ptaipale
Right, that makes sense then.

------
thesorrow
This is going fast after the announcement of a new Party proposal here in
France (RebootFrance) :
[https://www.reddit.com/r/RebootFrance](https://www.reddit.com/r/RebootFrance)

------
oelmekki
Very nice! This will make lawmaking in France somewhat more understandable,
and not something we hear reported now and then when it's deemed newsworthy.

One thing that is not mentioned though : will it autoupdate? And if yes, at
which rate?

------
dheera
What's the point of this? Are they taking pull requests?

~~~
ddebernardy
New laws are available in gif format:

[https://github.com/steeve/france.code-
civil/commit/b805ecf05...](https://github.com/steeve/france.code-
civil/commit/b805ecf05a86162d149d3d182e04074ecf72c066)

Compare with what they usually look like:

[http://www.assemblee-nationale.fr/14/ta/ta0120.asp](http://www.assemblee-
nationale.fr/14/ta/ta0120.asp)

------
troels
A pity they can't use dates before epoch.

------
joshguthrie
Nice use of git, never thought of that. Who's up for other countries law
books?

~~~
masklinn
thomasbachem noted german laws and regulations are already there at
[https://github.com/bundestag/gesetze](https://github.com/bundestag/gesetze),
with an amazing org avatar:
[https://avatars1.githubusercontent.com/u/1994383](https://avatars1.githubusercontent.com/u/1994383)

A quick github search indicates that Taiwan's laws might also be there at
[https://github.com/victorhsieh/tw-law-
corpus](https://github.com/victorhsieh/tw-law-corpus) using the
[https://github.com/g0v/twlaw](https://github.com/g0v/twlaw) exporter,
Japanese laws seem to have been uploaded at
[https://github.com/riywo/law.e-gov.go.jp](https://github.com/riywo/law.e-gov.go.jp)
but just be a crawl/dump of law.e-gov.go.jp

------
briandear
Do they accept pull requests?

------
nraynaud
I can't navigate easily, but I wonder if it goes all the way to Napoleon.

------
Aaronik
Can't believe there're only 5 pull requests :D

------
sacado2
That's a wonderful effort. Thanks.

------
t_fatus
Thank you so much!

------
b08aa8b0dcfce
The README is so full of grammatical and spelling errors it obviously wasn't
written by a French speaker. Urgh.

~~~
steeve
It was written at 3am as I was falling asleep on my keyboard...

I am french born and raised, btw.

------
wishiknew
Couldn't this have been done without taking gay marriage as the first example?
Or does IT _always_ need to go hand in hand with unconditional progressism?

~~~
nicolasp
Gay marriage (or "marriage for everyone") is a recent, substantial change to a
law that is familiar to many French people. I thought it was a great example
despite its somewhat controversial nature.

~~~
wishiknew
A quick look at the author's tweets reveals this is not as innocent as you
seem to say it is. Plato once said something along the lines of: "those who
mix art with politics must be either unsure of their art or of their political
positions, if not both". We had engaged musicians, now we have engaged
developers. This is all the same trash to me.

~~~
scrollaway
[https://i.imgur.com/82QXoAj.jpg](https://i.imgur.com/82QXoAj.jpg)

Here's a tip that will massively improve your personal quality of life: Stop
getting offended. Don't you have better things to do with your time?

~~~
reinhardt
Kinda ironic as it's usually the uber liberals that tend to get grossly
offended by perceived social injustices such as gendered pronouns or dongle
jokes.

~~~
scrollaway
"Getting offended" has little to do with political leanings, and a lot to do
with being bored and seeking attention. Man-childness, if you will.

