7 ms·
French civil code now on GitHub
- cranium 12y agoI wish all legal proposition was supplied with a diff.
- Rexxar 12y agoIn 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.
- highCs 12y agoFinalement, 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."
- zx2c4 12y agoToo 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 12y agoIs git using an unsigned int for time?
- taspeotis 12y agohttp://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
- seszett 12y agoApart from the timestamps, line returns also make some of the diffs difficult to interpret sometimes, like if the first line of a long paragraph gets wrapped differently then all the paragraph is just highlighted as a diff instead of each modified word. Isn't there a better tool than git for plain text diffs?
- cellover 12y agoNow let's anarchy-fork!
- rtpg 12y agokind of curious as to how this got generated in the first place
- mackwic 12y agoSame 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 12y agoThe 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 12y agoI 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 12y agoIt's probably possible to do that for a crawler of http://www.legifrance.gouv.fr http://www.legifrance.gouv.fr though.
- simlevesque 12y agoHe said in another comment that it's not how he did it.
- markvdb 12y agoMe too. Unfortunately, the author was utterly careless about spelling. That really makes it feel like a quick hack.
- gtf21 12y agoThis 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 12y agoTL;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
- wishiknew 12y agoCouldn'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 12y agoGay 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 12y agoA 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.
- seszett 12y agoAre you saying the author of a civil code git repository should have chosen a non-political example? You might be forgetting that the civil code is an entirely political product.
- joshguthrie 12y agoDo we even have another recent law that everybody in France remembers? And seriously, every single new law is pushing somebody's agenda. The author could've chosen the "animals are human being" change and we'd have another you yelling not being fond of developers pushing their love for animals.
- scrollaway 12y agohttps://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?
- thomasbachem 12y agoAll 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 12y agoIs 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 12y agoIt'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/0d53376225b4502851e2ec062a80e45924e265ce https://github.com/steeve/france.code-civil/commit/0d5337622...). 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).
- deleted 12y ago[deleted]
- mpasternacki 12y agoIf 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.
- mintplant 12y agoI 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/b805ecf05a86162d149d3d182e04074ecf72 https://github.com/steeve/france.code-civil/commit/b805ecf05... 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/).
- torrent-of-ions 12y agoI'm really pleased that I was able to read all of the README despite not having read French for probably a year or more. I guess it was written in a very easy/academic style.
- mintplant 12y ago
- joshguthrie 12y agoNice use of git, never thought of that. Who's up for other countries law books?
- masklinn 12y agothomasbachem 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
- t_fatus 12y agoThank you so much!
- BertrandBordage 12y agoI 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/pdf/ https://criminocorpus.org/fr/legislation/versions/689/1/diff... :)
- LaurentGh 12y agoGenerated PDF are not really web 2.0 :/
- BertrandBordage 12y agoThe 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...
- sacado2 12y agoThat's a wonderful effort. Thanks.
- haosdent 12y agoChina civil code is on the way. Github, hold on!
- return0 12y agoLegal 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)
- mpasternacki 12y agoThere are services (external, secondary to the published acts) that published a re-unified, highlighted version. I would imagine a repository that maintains a current unified text, with the "update acts" as commit messages (or even with the original PDFs somehow linked to the commits. I'm sure it can be implemented somehow in Git plumbing. Annotations, maybe?). I'd even pay for this kind of service - but probably not as much as lawyers who need it for their daily work pay for the existing equivalents.
- bolaft 12y agoDid 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/b805ecf05a86162d149d3d182e04074ecf72c066 https://github.com/steeve/france.code-civil/commit/b805ecf05... 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".
- return0 12y agoI see, that indeed looks like a good example. Does it only work for newly changed laws? i couldnt find any other versioncontrolled articles.
- masklinn 12y ago> i couldnt find any other versioncontrolled articles. Did you look? All markdown files aside from the readme are articles. Or did you mean articles which were altered after their initial creation? https://github.com/steeve/france.code-civil/commits/master/Livre%20Ier/Titre%20V/Article%20220.md https://github.com/steeve/france.code-civil/commits/master/L... is one, it was added in 1803 and modified in 1986 and 2014. https://github.com/steeve/france.code-civil/commits/a191667dfd6f9058652087c25ba812423494a345/Livre%20Ier/Titre%20IX/Article%20375.md https://github.com/steeve/france.code-civil/commits/a191667d... is also one, with modifications in 1986, 1987, 2007 and 2013.
- ptaipale 12y agoWhat 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).
- Arkanosis 12y agodiff, blame… That alone are killer features.
- mdemare 12y agoIsn't that obvious? Pull Requests! Can you imagine a democracy editing its laws through pull requests and code review?
- spacemanmatt 12y ago...where regional committers are elected, and once elected, act in blocs against their electorate?
- tux3 12y agoIs it bad if I want to live in that world ?
- agumonkey 12y agoAnd continuous integration with simulation and testing. Then computer assisted planning and resource allocation for implementation of selected laws.
- oelmekki 12y agoVery 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?
- gadders 12y agoIn 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
- mackwic 12y agoThat's a funny story. :)
- JosephRedfern 12y agoNo longer the case, apparently: http://www.wales-legislation.org.uk/ http://www.wales-legislation.org.uk/
- b08aa8b0dcfce 12y agoThe README is so full of grammatical and spelling errors it obviously wasn't written by a French speaker. Urgh.
- omtose 12y agoI think you give too much credit to native speakers of any language.
- peteretep 12y agoThe irony of course being that I thought to myself as I was reading it "that's some mighty easy-to-understand French". A long time ago I used to visit francophone Africans in a UK asylum centre who were always notably easier to understand than the French.
- steeve 12y agoIt was written at 3am as I was falling asleep on my keyboard... I am french born and raised, btw.
- gregschlom 12y agoOh no, this kind of grammatical errors show that it's clearly a native French speaker. We French suck at our own language - partly because it is fairly complicated, and partly because people don't bother learning.
- nothrabannosir 12y agoA bit ironic, no? That such a thing, almost exclusively useful for French people, has to come from a non-native speaker. And that the only obviously French comment so far is a critique about the style... We sure do know how to complain. :) (slightly unfair, of course---obviously the complaint about grammar had to come from a native speaker; who else would notice it in the first place..?)
- phtrivier 12y agoThere's a PR for that ;) https://github.com/steeve/france.code-civil/pull/1/files https://github.com/steeve/france.code-civil/pull/1/files
- troels 12y agoA pity they can't use dates before epoch.
- steeve 12y agoI just woke up and wow. Well, I'd be happy to answer any questions you might have of course.
- nyandaber 12y agoHow does it feed the data to the repo? Is it parsing reports from the parliament? If yes, how smooth did the process go?
- steeve 12y agoIt goes on each article on Legifrance, creates a JSON file with all the articles, which book/section they belong to, and for each article, tracks it's versions (they are dates). The crawler is in Go. Then there is a python script that takes that JSON file, creates the .md files and runs the git commands in the shell. Ultimately the sad thing is that I had to scrape this information. There were lots of pitfalls due to bad formatting and so on... Well, scraping.
- rouxrc 12y agoIt might not be necessary to scrap anything since this data was finally released as OpenData last year: https://www.data.gouv.fr/fr/datasets/legi-codes-lois-et-reglements-consolides/ https://www.data.gouv.fr/fr/datasets/legi-codes-lois-et-regl...
- steeve 12y agoi tried using this, but it seems it seems to be just a snapshot, not the full dataset with history (i wish i'm wrong, though)
- antimagic 12y agoSo 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?!?!
- rouxrc 12y agoNioce 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-de-la-Loi-fran%C3%A7aise%2C-pour-%C3%A9tudier-son-%C3%A9volution http://blog.seb35.fr/billet/Arch%C3%A9o-Lex%2C-Pure-Histoire... 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-how-gitlaw-turns-the-french-parliamentary-process-into-open-data/ http://sunlightfoundation.com/blog/2014/06/25/opengov-voices...
- passepartout 12y agoYour licence should be more precise because you cannot put a CC licence on the legal texts, just on your ReadMe file.
- jordigh 12y agoHow does French law work? Do the texts of laws have droit d'auteur?
- passepartout 12y agoThey are considered "public information", so no droit d'auteur. All government data considered as public information were published starting 2011 with an open data licence, the Etalab licence similar to the UK one.
- seszett 12y agoAs 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.
- svarog 12y agoDo they accept pull requests if I find any bugs?
- nraynaud 12y agoI can't navigate easily, but I wonder if it goes all the way to Napoleon.
- thesorrow 12y agoThis 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
- andyjohnson0 12y agoThis 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?timeline=true http://www.legislation.gov.uk/ukpga/1974/39/section/21?timel...
- terminalcommand 12y agoI 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 12y ago
- dheera 12y agoWhat's the point of this? Are they taking pull requests?
- ddebernardy 12y agoNew laws are available in gif format: https://github.com/steeve/france.code-civil/commit/b805ecf05a86162d149d3d182e04074ecf72c066 https://github.com/steeve/france.code-civil/commit/b805ecf05... 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
- umadrab 12y agoIf 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
- briandear 12y agoDo they accept pull requests?
- nathanappere 12y agoInteresting! 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!)
- jackbravo 12y agoMexican constitution: https://github.com/ceyusa/constitucion-mexicana https://github.com/ceyusa/constitucion-mexicana
- peeters 12y agoThis 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 12y agoThe 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.
- Aaronik 12y agoCan't believe there're only 5 pull requests :D