{ "info": { "author": "Regards Citoyens", "author_email": "contact@regardscitoyens.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "the-law-factory-parser\n======================\n\n[![Build Status](https://travis-ci.org/regardscitoyens/the-law-factory-parser.svg?branch=master)](https://travis-ci.org/regardscitoyens/the-law-factory-parser) [![Coverage Status](https://coveralls.io/repos/github/regardscitoyens/the-law-factory-parser/badge.svg?branch=master)](https://coveralls.io/github/regardscitoyens/the-law-factory-parser?branch=master)\n\nData generator for [the-law-factory project](https://github.com/RegardsCitoyens/the-law-factory) (http://www.LaFabriqueDeLaLoi.fr)\n\nCode used to generate the API available at: http://www.LaFabriqueDeLaLoi.fr/api/\n\n\n## Install the dependencies ##\n\nYou should set up a dedicated virtualenv with Python 3.5+:\n\n```bash\nvirtualenv -p $(which python3) venv\nsource venv/bin/activate\n```\n\nUsing Pypy can seriously boost performance. You can easily install it and create a virtualenv with it for instance by [installing Pyenv](https://github.com/pyenv/pyenv-installer#pyenv-installer):\n\n```bash\npyenv install pypy3.5-6.0.0\npyenv virtualenv pypy3.5-6.0.0 lafabrique\npyenv activate lafabrique\n```\n\nThen with your choice of virtualenv activated, install the dependencies:\n\n```bash\nsudo apt install libxml2-dev libxslt-dev # necessary for lxml\npip install --upgrade setuptools pip # not necessary but always a good idea\npip install -e .\npip install -Ur requirements.txt # to get the latest version of those dependencies\n```\n\n## Generate data for one bill ##\n\n- search for the [bill's procedure page on Senat.fr](http://www.senat.fr/dossiers-legislatifs/index-general-projets-propositions-de-lois.html) or [Assemblee-nationale.fr](http://www.assemblee-nationale.fr/15/documents/index-dossier.asp).\n\n- execute *tlfp-parse* script using the procedure page:\n\n`tlfp-parse `\n\nThe data is generated in the \"*data*\" directory. You can change this default behavior by inputting a data path as extra argument: `tlfp-parse `.\n\nFor example, to generate data about the \"*Enseignement sup\u00e9rieur et recherche*\" bill:\n\n tlfp-parse http://www.senat.fr/dossier-legislatif/pjl12-614.html\n ls data/pjl12-614/\n\nYou can also use directly Senate's ids such as: `tlfp-parse pjl12-614`\n\nDevelopment options `--debug`, `--enable-cache` and `--only-promulgated` can also be used.\n\n\n## Generate data for many bills\n\nTo generate all bills from 2008, you can pipe a list of ids or urls into `tlfp-parse-many`.\n\nA convenient way to do so is to use [senapy](https://github.com/regardscitoyens/senapy):\n\n senapy-cli doslegs_urls --min-year=2008 | tlfp-parse-many data/\n\nSee `senapy-cli doslegs_urls` help for more options. You can also use [anpy](https://github.com/regardscitoyens/anpy) with `anpy-cli doslegs_urls`.\n\n\n## Serve bills locally for [The Law Factory website](https://github.com/regardscitoyens/the-law-factory)\n\nFirst, you need to build data for all desired bills.\n\nThen generate the files required by the frontend:\n\n python tlfp/generate_dossiers_csv.py data/ # generates home.json and dossiers_promulgues.csv used by the searchbar\n python tlfp/tools/assemble_procedures.py data/ # generates dossiers_n.json files used by the Navettes viz\n\nFinally, serve the data directory however you like. For instance, you can serve it on a specific port with a simple http server like nodeJs', in which case, you'll need to enable cors: just install *http-server* with npm and run it in data directory on a given port (8002 in the example):\n\n npm install -g http-server\n cd data & http-server -p 8002 --cors\n\n\n## Generate git version for a bill\n\n*Work In Progress*\n\nYou can export all your bills as git repositories: `python tlfp/tools/make_git_repos.py git_export`\n\n## Other things you can do\n\n - parse a s\u00e9nat dosleg: `senapy-cli parse pjl15-610`\n - parse an AN dosleg: `anpy-cli parse http://www.assemblee-nationale.fr/13/dossiers/deuxieme_collectif_2009.asp`\n - parse all the s\u00e9nat doslegs: `senapy-cli doslegs_urls | senapy-cli parse_many senat_doslegs/`\n - parse all the AN doslegs `anpy-cli doslegs_urls | anpy-cli parse_many an_doslegs/`\n - generate a graph of the steps: `python tlfp/tools/steps_as_dot.py data/ | dot -Tsvg > steps.svg`\n\nYou can explore the related projects [here](https://github.com/search?q=topic%3Aparliamentary-data+org%3Aregardscitoyens)\n\n## Tests\n\nTo run the tests, you can follow the `.travis.yml` file.\n\n git clone https://github.com/regardscitoyens/the-law-factory-parser-test-cases.git\n python tests/test_regressions.py the-law-factory-parser-test-cases\n\nIf you modify something, best is to regenerate the test-cases with the `--regen` flag:\n\n python tests/test_regressions.py the-law-factory-parser-test-cases --regen\n\nTo make the tests faster, you can also use the `--enable-cache` flag.\nTo clear the cache, you can remove the directory returned by `lawfactory_where_is_my_cache`.\nTo update the meta-infos (ex: a new political group was added), you need to clear the test-cases directory of all the root `.json` files.\n\nYou can also watch for parts of the code not yet covered by the tests:\n\n - First, install `coverage`: `pip install coverage`\n - Then, you can execute `bash coverage.sh`\n - Then, the report is in `htmlcov/index.html`\n\n## Credits\n\nThis work, a collaboration between [Regard Citoyens](https://www.regardscitoyens.org), [m\u00e9dialab Sciences Po](https://medialab.sciencespo.fr/fr/) and [CEE Sciences Po](http://www.sciencespo.fr/centre-etudes-europeennes/fr), is supported by a public grant overseen by the French National Research Agency (ANR) as part of the \"Investissements d'Avenir\" program within the framework of the LIEPP center of excellence (ANR11LABX0091, ANR 11 IDEX000502).\n\nMore details at https://lafabriquedelaloi.fr/a-propos.html\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/regardscitoyens/the-law-factory-parser", "keywords": "scraping politics data", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "tlfp", "package_url": "https://pypi.org/project/tlfp/", "platform": "", "project_url": "https://pypi.org/project/tlfp/", "project_urls": { "Homepage": "https://github.com/regardscitoyens/the-law-factory-parser" }, "release_url": "https://pypi.org/project/tlfp/0.0.3/", "requires_dist": [ "lawfactory-utils", "anpy (==0.1.22)", "legipy (==0.1.2)", "senapy (==0.2.15)", "metslesliens (==1.3.0)", "diff-match-patch (==20121119)", "python-gitlab (==1.5.1)" ], "requires_python": "", "summary": "Data generator for the-law-factory project lafabriquedelaloi.fr", "version": "0.0.3", "yanked": false, "yanked_reason": null }, "last_serial": 6035382, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "814ae7a295f6c6989d2a178797af65c0", "sha256": "7a1ef7d3c60520b7e41d580840a1d1a3d5fea34ed940cf65820a00b7988966d6" }, "downloads": -1, "filename": "tlfp-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "814ae7a295f6c6989d2a178797af65c0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 93031, "upload_time": "2019-10-09T19:47:57", "upload_time_iso_8601": "2019-10-09T19:47:57.694707Z", "url": "https://files.pythonhosted.org/packages/66/29/3795fb43cb4db361eb80d6f72ed538bbb947d6569b64ceb181efae966749/tlfp-0.0.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "6fecd2d5cc38ebc8a75f0c32a1c1d2b5", "sha256": "8c50c29ed7fa9bbdada7003a518705daa38b7cec95a243e757bd203ddebcc105" }, "downloads": -1, "filename": "tlfp-0.0.1.tar.gz", "has_sig": false, "md5_digest": "6fecd2d5cc38ebc8a75f0c32a1c1d2b5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68297, "upload_time": "2019-10-09T19:48:02", "upload_time_iso_8601": "2019-10-09T19:48:02.462783Z", "url": "https://files.pythonhosted.org/packages/80/b1/1e727a0bd574177371876b492d5990933889eb645229da693a99230d64c1/tlfp-0.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.2.1": [ { "comment_text": "", "digests": { "md5": "a38fd81aad8ea74600b405d0250b7fb3", "sha256": "294bdc170c02d11abea0b6fcead2901fd11e771f5ddb183089936ac57f75ca27" }, "downloads": -1, "filename": "tlfp-0.0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a38fd81aad8ea74600b405d0250b7fb3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 93895, "upload_time": "2019-10-23T21:25:08", "upload_time_iso_8601": "2019-10-23T21:25:08.087627Z", "url": "https://files.pythonhosted.org/packages/75/30/08c4db19c0855db5485092d4ecb10567c43ae350781a66448589518a61a7/tlfp-0.0.2.1-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "721c71d1e73255339127ad66edb73fe6", "sha256": "d38fd7631f4c39c17dddc283eb4f0f42d6249d28be10b1493f28d138178bbda1" }, "downloads": -1, "filename": "tlfp-0.0.2.1.tar.gz", "has_sig": false, "md5_digest": "721c71d1e73255339127ad66edb73fe6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68924, "upload_time": "2019-10-23T21:25:10", "upload_time_iso_8601": "2019-10-23T21:25:10.238046Z", "url": "https://files.pythonhosted.org/packages/04/9a/d1377216149e4ac927e2a2fac074a8f21bdf57cfe692c9f218b1a8c82a09/tlfp-0.0.2.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "8e2fb7cf409ab454bf1d8e16ee977c5a", "sha256": "63dd1f270b30b2f7c20394e287d7c1ce7d414a23d1f396563ed08b88939b1fb4" }, "downloads": -1, "filename": "tlfp-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8e2fb7cf409ab454bf1d8e16ee977c5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 93861, "upload_time": "2019-10-26T23:04:55", "upload_time_iso_8601": "2019-10-26T23:04:55.343407Z", "url": "https://files.pythonhosted.org/packages/99/ef/ac6db508dd39c7ef46ce55c512ab5cf367a929ab727a81951f4e448761c7/tlfp-0.0.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "f743388eeeea1986cab7f36d8ee21ed9", "sha256": "573d2547294d735048ff1b0dbaa36ab7eede8d6e2b43cd59adc9c79240ff7605" }, "downloads": -1, "filename": "tlfp-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f743388eeeea1986cab7f36d8ee21ed9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68925, "upload_time": "2019-10-26T23:04:58", "upload_time_iso_8601": "2019-10-26T23:04:58.028987Z", "url": "https://files.pythonhosted.org/packages/0f/bd/2c2cee1aef5b166376f0440c4ad34c638dde798a5b7de6faa77529c34a0f/tlfp-0.0.3.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8e2fb7cf409ab454bf1d8e16ee977c5a", "sha256": "63dd1f270b30b2f7c20394e287d7c1ce7d414a23d1f396563ed08b88939b1fb4" }, "downloads": -1, "filename": "tlfp-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "8e2fb7cf409ab454bf1d8e16ee977c5a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 93861, "upload_time": "2019-10-26T23:04:55", "upload_time_iso_8601": "2019-10-26T23:04:55.343407Z", "url": "https://files.pythonhosted.org/packages/99/ef/ac6db508dd39c7ef46ce55c512ab5cf367a929ab727a81951f4e448761c7/tlfp-0.0.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "f743388eeeea1986cab7f36d8ee21ed9", "sha256": "573d2547294d735048ff1b0dbaa36ab7eede8d6e2b43cd59adc9c79240ff7605" }, "downloads": -1, "filename": "tlfp-0.0.3.tar.gz", "has_sig": false, "md5_digest": "f743388eeeea1986cab7f36d8ee21ed9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 68925, "upload_time": "2019-10-26T23:04:58", "upload_time_iso_8601": "2019-10-26T23:04:58.028987Z", "url": "https://files.pythonhosted.org/packages/0f/bd/2c2cee1aef5b166376f0440c4ad34c638dde798a5b7de6faa77529c34a0f/tlfp-0.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }