Name | cellar-extractor JSON |
Version |
1.2.1
JSON |
| download |
home_page | None |
Summary | Library for extracting cellar data |
upload_time | 2024-10-24 11:33:32 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
keywords |
cellar
extractor
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Cellar extractor
This library contains two functions to get cellar case law data from eurlex.
## Version
Python 3.9+
## Tests
![Workflow Status](https://github.com/maastrichtlawtech/extraction_libraries/actions/workflows/github-actions.yml/badge.svg)
## Contributors
<table>
<tr>
<td align="center"> <a href="https://github.com/pranavnbapat"> <img src="https://avatars.githubusercontent.com/u/7271334?v=4" width="100;" alt="pranavnbapat"/> <br />
<sub><b>Pranav Bapat</b></sub> </a>
</td>
<td align="center"> <a href="https://github.com/Cloud956"> <img src="https://avatars.githubusercontent.com/u/24865274?v=4" width="100;" alt="Cloud956"/> <br /> <sub><b>Piotr Lewandowski</b></sub> </a> </td>
<td align="center"> <a href="https://github.com/shashankmc"> <img src="https://avatars.githubusercontent.com/u/3445114?v=4" width="100;" alt="shashankmc"/> <br /> <sub><b>shashankmc</b></sub> </a> </td>
<td align="center"> <a href="https://github.com/gijsvd"> <img src="https://avatars.githubusercontent.com/u/31765316?v=4" width="100;" alt="gijsvd"/> <br /> <sub><b>gijsvd</b></sub> </a> </td>
<td align="center"> <a href="https://github.com/venvis"> <img src="https://avatars.githubusercontent.com/venvis" width="100;" alt="venvis"/> <br /> <sub><b>venvis</b></sub> </a> </td>
</tr>
</table>
## How to install?
``pip install cellar-extractor``
## What are the functions?
1. ``get_cellar``
Gets all the ECLI data from the eurlex sparql endpoint and saves them in the CSV or JSON format, in-memory or as a saved file.
2. ``get_cellar_extra``
Gets all the ECLI data from the eurlex sparql endpoint, and on top of that scrapes the eurlex websites to acquire
the full text, keywords, case law directory code and eurovoc identifiers. If the user does have an eurlex account with access to the eurlex webservices, he can also
pass his webservices login credentials to the method, in order to extract data about works citing work and works
being cited by work. The full text is returned as a JSON file, rest of data as a CSV. Can be in-memory or as saved files.
3. ``get_nodes_and_edges_lists``
Gets 2 list objects, one for the nodes and edges of the citations within the passed dataframe.
Allows the creation of a network graph of the citations. Can only be returned in-memory.
4. ``filter_subject_matter``
Returns a dataframe of cases only containing a certain phrase in the column containing the subject of cases.
## What are the classes?
1. ``FetchOperativePart``
A class whose instance(declaration) when called returns a list of the all the text contained within the operative part for each European Court of Justice (CJEU, formerly known as European Court of Justice (ECJ)) judgement (English only). The ``FetchOperativePart`` class has eleven functions - each function scrapes for the operative part depending on the html structure of the page :
- ``html_page_structure_one`` - This function retreives operative part from documents of the respected celex id's. This function scrapes/parse the operative part from a nested table structure . The relevant text lies inside the coj-bold class of the span tag.
- ``html_page_structure_two`` - This function retreives operative part from documents of the respected celex id's. This function scrapes/parse the operative part from a paragraph (p) structure. The relevant text lies inside the normal class of the p tag which comes after the keyword operative of the previous span tag.
- ``structure_three`` - This function retreives operative part from documents of the respected celex id's. This function scrapes/parse the operative part from a nested table structure. The relevant text lies inside the coj-bold class of the span tag.
- `structure_four` - This function retrieves the operative part from documents of the respected celex ids. This function scrapes/parses the operative part from a paragraph (p) structure. The relevant text lies inside the p tag which comes after the keyword operative of the previous span tag.
- `structure_five` - This function retrieves the operative part from documents of the respected celex ids. This function scrapes/parses the operative part from a paragraph (p) structure. The relevant text lies inside the normal class of the p tag which comes after the keyword operative of the previous span tag.
- `structure_six` - This function retrieves the operative part from documents of the respected celex ids. This function scrapes/parses the operative part from a h2 (header) structure. The relevant text lies inside the p tag which comes after the keyword operative part of the respective h2 tag.
- `structure_seven` - This function retrieves the operative part from documents of the respected celex ids. This function scrapes/parses the operative part from a table (table) structure. The relevant text lies inside the span tag which comes after the p tag, with the class name=normal.
- `structure_eight` - This function retrieves the operative part from documents of the respected celex ids. The text is extracted from the span tag nested inside the tbody tag. Returns a list as output.
- `structure_nine` - This function retrieves the operative part from documents of the respected celex ids. The operative part is under the bold (b) tag after the p tag where the keywords "on those grounds" exist.
- `structure_ten` - This function retrieves the operative part from documents of the respected celex ids. Since the content is preloaded using js/client server side functions, the text from the current page is retrieved and the operative part is scraped after the occurrence of the phrase "On those grounds".
- `structure_eleven` - This function retrieves the operative part from documents of the respected celex ids. The operative part is under the paragraph (p) tag after the b tag where the keywords "operative part" exist.
2. ``Writing``
A class which writes the text for the operative part for each European Case law case(En-English only) into csv,json and txt files(Generated upon initialization). The ``Writing`` class has three functions:
- ``to_csv()`` - Writes the operative part along with celex id into a csv file.
- ``to_json()`` - Writes the operative part along with celex id into a json file.
- ``to_txt()`` - Writes the operative part along with celex id into a txt file
3. ``CellarSparqlQuery``
A class which includes methods to extract extra data for each court case using a sparql query.
- ``get_endorsements`` - Fetches endorsements of the judgement
- ``get_subjects`` - Fetches subjects of the judgement
- ``get_parties`` - Fetches parties of the judgement
- ``get_keywords`` - Fetches keywords of the judgement
- ``get_citations`` - Fetches court cases cited by the source judgement
- ``get_grounds`` - Fetches grounds of the judgement
## What are the parameters?
1. ``get_cellar``
**Parameters**:
- **max_ecli**: **int, optional, default 100**
Maximum number of ECLIs to retrieve.
- **sd: date, optional, default '2022-05-01'**
The start last modification date (yyyy-mm-dd).
- **ed: date, optional, default current date**
The end last modification date (yyyy-mm-dd).
- **save_file: ['y', 'n'],optional, default 'y'**
Save data in a data folder, or return in-memory.
- **file_format: ['csv', 'json'],optional, default 'csv'**
Returns the data as a JSON/dictionary, or as a CSV/Pandas Dataframe object.
2. ``get_cellar_extra``
- **max_ecli: int, optional, default 100**
Maximum number of ECLIs to retrieve.
- **sd: date, optional, default '2022-05-01'**
The start last modification date (yyyy-mm-dd).
- **ed: date, optional, default current date**
The end last modification date (yyyy-mm-dd).
- **save_file: ['y', 'n'],optional, default 'y'**
Save the full text of cases as JSON file / return as a dictionary and save the rest ofthe data as a CSV file / return as a Pandas Dataframe object.
- **threads: int ,optional, default 10**
Extracting the additional data takes a lot of time. The use of multi-threading can cut down this time. Even with this, the method may take a couple of minutes for a couple of hundred cases. A maximum number of 10 recommended, as this method may also affect the device's internet connection.
- **username: string, optional, default empty string**
The username to the eurlex webservices.
- **password: string, optional, default empty string**
The password to the eurlex webservices.
3. ``get_nodes_and_edges_lists``
- **df: DataFrame object, required, default None**
DataFrame of cellar metadata acquired from the ``get_cellar_extra`` method with eurlex webservice credentials passed. This method will only work on dataframes with citations data.
- **only_local: boolean, optional, default False**
Flag for nodes and edges generation. If set to True, the network created will only include nodes and edges between
cases exclusively inside the given dataframe.
4. ``filter_subject_matter``
- **df: DataFrame object, required, default None**
DataFrame of cellar metadata acquired from any of the cellar extraction methods listed above.
- **phrase: string, required, default None**
The phrase which has to be present in the subject matter of cases. Case insensitive.
5. ``Analyzer``
- **celex id: str, required**
- Pass as a constructor upon initializing the class
6. ``Writing``
- **celex id: str, required**
- Pass as a constructor upon initializing the class
## Examples
```python
import cellar_extractor as cell
# Below are examples for in-file saving:
cell.get_cellar(save_file='y', max_ecli=200, sd='2022-01-01', file_format='csv')
cell.get_cellar_extra(max_ecli=100, sd='2022-01-01', threads=10)
# Below are examples for in-memory saving:
df = cell.get_cellar(save_file='n', file_format='csv', sd='2022-01-01', max_ecli=1000)
df,json = cell.get_cellar_extra(save_file='n', max_ecli=100, sd='2022-01-01', threads=10)
```
Create a callback of the instance of the class initiated and pass a list as it's value.
```python
import cellar_extractor as cell
instance=cell.FetchOperativePart(celex_id:str)
output_list=instance()
print(output_list) # prints operative part of the Case as a list
```
The Writing Class also takes a celex id , upon initializing the class , through the means of the constructor and writes the content of its operative part into different files, depending on the function called.
```python
import cellar_extractor as cell
instance=cell.Writing(celex_id:str)
output=instance.to_csv() # for csv
output=instance.to_txt() # for txt
output=instance.to_json() # for json
```
## License
[![License: Apache 2.0](https://img.shields.io/github/license/maastrichtlawtech/extraction_libraries)](https://opensource.org/licenses/Apache-2.0)
Previously under the [MIT License](https://opensource.org/licenses/MIT), as of 28/10/2022 this work is licensed under a [Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0).
```
Apache License, Version 2.0
Copyright (c) 2022 Maastricht Law & Tech Lab
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```
Raw data
{
"_id": null,
"home_page": null,
"name": "cellar-extractor",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "cellar, extractor",
"author": null,
"author_email": "LawTech Lab <law-techlab@maastrichtuniversity.nl>",
"download_url": "https://files.pythonhosted.org/packages/8c/4b/6d6413ca271913d7d36bbb19b4e48eef07c10f014e71359a800b89a7bfbb/cellar_extractor-1.2.1.tar.gz",
"platform": null,
"description": "# Cellar extractor\n\nThis library contains two functions to get cellar case law data from eurlex.\n\n## Version\n\nPython 3.9+\n\n## Tests\n\n![Workflow Status](https://github.com/maastrichtlawtech/extraction_libraries/actions/workflows/github-actions.yml/badge.svg)\n\n## Contributors\n\n<table>\n <tr>\n <td align=\"center\"> <a href=\"https://github.com/pranavnbapat\"> <img src=\"https://avatars.githubusercontent.com/u/7271334?v=4\" width=\"100;\" alt=\"pranavnbapat\"/> <br />\n <sub><b>Pranav Bapat</b></sub> </a> \n </td>\n <td align=\"center\"> <a href=\"https://github.com/Cloud956\"> <img src=\"https://avatars.githubusercontent.com/u/24865274?v=4\" width=\"100;\" alt=\"Cloud956\"/> <br /> <sub><b>Piotr Lewandowski</b></sub> </a> </td>\n <td align=\"center\"> <a href=\"https://github.com/shashankmc\"> <img src=\"https://avatars.githubusercontent.com/u/3445114?v=4\" width=\"100;\" alt=\"shashankmc\"/> <br /> <sub><b>shashankmc</b></sub> </a> </td>\n <td align=\"center\"> <a href=\"https://github.com/gijsvd\"> <img src=\"https://avatars.githubusercontent.com/u/31765316?v=4\" width=\"100;\" alt=\"gijsvd\"/> <br /> <sub><b>gijsvd</b></sub> </a> </td>\n <td align=\"center\"> <a href=\"https://github.com/venvis\"> <img src=\"https://avatars.githubusercontent.com/venvis\" width=\"100;\" alt=\"venvis\"/> <br /> <sub><b>venvis</b></sub> </a> </td>\n </tr>\n</table>\n\n## How to install?\n\n``pip install cellar-extractor``\n\n## What are the functions?\n\n1. ``get_cellar`` \n Gets all the ECLI data from the eurlex sparql endpoint and saves them in the CSV or JSON format, in-memory or as a saved file.\n2. ``get_cellar_extra`` \n Gets all the ECLI data from the eurlex sparql endpoint, and on top of that scrapes the eurlex websites to acquire \n the full text, keywords, case law directory code and eurovoc identifiers. If the user does have an eurlex account with access to the eurlex webservices, he can also \n pass his webservices login credentials to the method, in order to extract data about works citing work and works \n being cited by work. The full text is returned as a JSON file, rest of data as a CSV. Can be in-memory or as saved files.\n3. ``get_nodes_and_edges_lists`` \n Gets 2 list objects, one for the nodes and edges of the citations within the passed dataframe.\n Allows the creation of a network graph of the citations. Can only be returned in-memory.\n4. ``filter_subject_matter`` \n Returns a dataframe of cases only containing a certain phrase in the column containing the subject of cases.\n\n## What are the classes?\n\n1. ``FetchOperativePart`` \n A class whose instance(declaration) when called returns a list of the all the text contained within the operative part for each European Court of Justice (CJEU, formerly known as European Court of Justice (ECJ)) judgement (English only). The ``FetchOperativePart`` class has eleven functions - each function scrapes for the operative part depending on the html structure of the page :\n - ``html_page_structure_one`` - This function retreives operative part from documents of the respected celex id's. This function scrapes/parse the operative part from a nested table structure . The relevant text lies inside the coj-bold class of the span tag.\n - ``html_page_structure_two`` - This function retreives operative part from documents of the respected celex id's. This function scrapes/parse the operative part from a paragraph (p) structure. The relevant text lies inside the normal class of the p tag which comes after the keyword operative of the previous span tag.\n - ``structure_three`` - This function retreives operative part from documents of the respected celex id's. This function scrapes/parse the operative part from a nested table structure. The relevant text lies inside the coj-bold class of the span tag.\n - `structure_four` - This function retrieves the operative part from documents of the respected celex ids. This function scrapes/parses the operative part from a paragraph (p) structure. The relevant text lies inside the p tag which comes after the keyword operative of the previous span tag.\n - `structure_five` - This function retrieves the operative part from documents of the respected celex ids. This function scrapes/parses the operative part from a paragraph (p) structure. The relevant text lies inside the normal class of the p tag which comes after the keyword operative of the previous span tag.\n - `structure_six` - This function retrieves the operative part from documents of the respected celex ids. This function scrapes/parses the operative part from a h2 (header) structure. The relevant text lies inside the p tag which comes after the keyword operative part of the respective h2 tag.\n - `structure_seven` - This function retrieves the operative part from documents of the respected celex ids. This function scrapes/parses the operative part from a table (table) structure. The relevant text lies inside the span tag which comes after the p tag, with the class name=normal. \n - `structure_eight` - This function retrieves the operative part from documents of the respected celex ids. The text is extracted from the span tag nested inside the tbody tag. Returns a list as output.\n - `structure_nine` - This function retrieves the operative part from documents of the respected celex ids. The operative part is under the bold (b) tag after the p tag where the keywords \"on those grounds\" exist.\n - `structure_ten` - This function retrieves the operative part from documents of the respected celex ids. Since the content is preloaded using js/client server side functions, the text from the current page is retrieved and the operative part is scraped after the occurrence of the phrase \"On those grounds\".\n - `structure_eleven` - This function retrieves the operative part from documents of the respected celex ids. The operative part is under the paragraph (p) tag after the b tag where the keywords \"operative part\" exist.\n\n2. ``Writing`` \nA class which writes the text for the operative part for each European Case law case(En-English only) into csv,json and txt files(Generated upon initialization). The ``Writing`` class has three functions:\n - ``to_csv()`` - Writes the operative part along with celex id into a csv file.\n - ``to_json()`` - Writes the operative part along with celex id into a json file.\n - ``to_txt()`` - Writes the operative part along with celex id into a txt file\n \n3. ``CellarSparqlQuery``\nA class which includes methods to extract extra data for each court case using a sparql query.\n - ``get_endorsements`` - Fetches endorsements of the judgement\n - ``get_subjects`` - Fetches subjects of the judgement\n - ``get_parties`` - Fetches parties of the judgement\n - ``get_keywords`` - Fetches keywords of the judgement\n - ``get_citations`` - Fetches court cases cited by the source judgement\n - ``get_grounds`` - Fetches grounds of the judgement\n\n## What are the parameters?\n\n1. ``get_cellar`` \n **Parameters**:\n - **max_ecli**: **int, optional, default 100** \n Maximum number of ECLIs to retrieve.\n - **sd: date, optional, default '2022-05-01'** \n The start last modification date (yyyy-mm-dd).\n - **ed: date, optional, default current date** \n The end last modification date (yyyy-mm-dd).\n - **save_file: ['y', 'n'],optional, default 'y'** \n Save data in a data folder, or return in-memory.\n - **file_format: ['csv', 'json'],optional, default 'csv'** \n Returns the data as a JSON/dictionary, or as a CSV/Pandas Dataframe object.\n\n2. ``get_cellar_extra``\n - **max_ecli: int, optional, default 100** \n Maximum number of ECLIs to retrieve.\n - **sd: date, optional, default '2022-05-01'** \n The start last modification date (yyyy-mm-dd).\n - **ed: date, optional, default current date** \n The end last modification date (yyyy-mm-dd).\n - **save_file: ['y', 'n'],optional, default 'y'** \n Save the full text of cases as JSON file / return as a dictionary and save the rest ofthe data as a CSV file / return as a Pandas Dataframe object.\n - **threads: int ,optional, default 10** \n Extracting the additional data takes a lot of time. The use of multi-threading can cut down this time. Even with this, the method may take a couple of minutes for a couple of hundred cases. A maximum number of 10 recommended, as this method may also affect the device's internet connection.\n - **username: string, optional, default empty string** \n The username to the eurlex webservices.\n - **password: string, optional, default empty string** \n The password to the eurlex webservices.\n\n3. ``get_nodes_and_edges_lists``\n - **df: DataFrame object, required, default None** \n DataFrame of cellar metadata acquired from the ``get_cellar_extra`` method with eurlex webservice credentials passed. This method will only work on dataframes with citations data.\n - **only_local: boolean, optional, default False** \n Flag for nodes and edges generation. If set to True, the network created will only include nodes and edges between\n cases exclusively inside the given dataframe.\n\n4. ``filter_subject_matter``\n - **df: DataFrame object, required, default None** \n DataFrame of cellar metadata acquired from any of the cellar extraction methods listed above.\n - **phrase: string, required, default None** \n The phrase which has to be present in the subject matter of cases. Case insensitive.\n\n5. ``Analyzer``\n - **celex id: str, required**\n - Pass as a constructor upon initializing the class\n\n6. ``Writing``\n - **celex id: str, required**\n - Pass as a constructor upon initializing the class\n\n## Examples\n\n```python\nimport cellar_extractor as cell\n\n# Below are examples for in-file saving:\n\ncell.get_cellar(save_file='y', max_ecli=200, sd='2022-01-01', file_format='csv')\ncell.get_cellar_extra(max_ecli=100, sd='2022-01-01', threads=10)\n\n# Below are examples for in-memory saving:\n\ndf = cell.get_cellar(save_file='n', file_format='csv', sd='2022-01-01', max_ecli=1000)\ndf,json = cell.get_cellar_extra(save_file='n', max_ecli=100, sd='2022-01-01', threads=10)\n```\n\nCreate a callback of the instance of the class initiated and pass a list as it's value.\n\n```python\nimport cellar_extractor as cell\ninstance=cell.FetchOperativePart(celex_id:str)\noutput_list=instance()\nprint(output_list) # prints operative part of the Case as a list\n```\n\nThe Writing Class also takes a celex id , upon initializing the class , through the means of the constructor and writes the content of its operative part into different files, depending on the function called.\n\n```python\nimport cellar_extractor as cell\ninstance=cell.Writing(celex_id:str)\noutput=instance.to_csv() # for csv\noutput=instance.to_txt() # for txt\noutput=instance.to_json() # for json\n```\n\n## License\n[![License: Apache 2.0](https://img.shields.io/github/license/maastrichtlawtech/extraction_libraries)](https://opensource.org/licenses/Apache-2.0)\n\nPreviously under the [MIT License](https://opensource.org/licenses/MIT), as of 28/10/2022 this work is licensed under a [Apache License, Version 2.0](https://opensource.org/licenses/Apache-2.0).\n```\nApache License, Version 2.0\n\nCopyright (c) 2022 Maastricht Law & Tech Lab\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n \n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n",
"bugtrack_url": null,
"license": "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. \"License\" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. \"Licensor\" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. \"Legal Entity\" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, \"control\" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. \"You\" (or \"Your\") shall mean an individual or Legal Entity exercising permissions granted by this License. \"Source\" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. \"Object\" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. \"Work\" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). \"Derivative Works\" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. \"Contribution\" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, \"submitted\" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as \"Not a Contribution.\" \"Contributor\" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a \"NOTICE\" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets \"[]\" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same \"printed page\" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ",
"summary": "Library for extracting cellar data",
"version": "1.2.1",
"project_urls": {
"Bug Tracker": "https://github.com/maastrichtlawtech/extraction_libraries",
"Build Source": "https://github.com/maastrichtlawtech/extraction_libraries"
},
"split_keywords": [
"cellar",
" extractor"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "733b820414752cefb52ee0d65ae9ff6437568f02a50320db0fbbb3c8444d2376",
"md5": "cce7ee2a72f56f150cce981da4908219",
"sha256": "192ee9baf3a85d6d17d5300f4ff81add70e7573e5235424b11e4dcef13a8dfcd"
},
"downloads": -1,
"filename": "cellar_extractor-1.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cce7ee2a72f56f150cce981da4908219",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 37448,
"upload_time": "2024-10-24T11:33:31",
"upload_time_iso_8601": "2024-10-24T11:33:31.471083Z",
"url": "https://files.pythonhosted.org/packages/73/3b/820414752cefb52ee0d65ae9ff6437568f02a50320db0fbbb3c8444d2376/cellar_extractor-1.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8c4b6d6413ca271913d7d36bbb19b4e48eef07c10f014e71359a800b89a7bfbb",
"md5": "fa9c96b1cb7c458d21895305cc99cff4",
"sha256": "53297e8dfcf49ab4b4640947d2a264fcdfc856bf7b660cb0823dfa964804d20a"
},
"downloads": -1,
"filename": "cellar_extractor-1.2.1.tar.gz",
"has_sig": false,
"md5_digest": "fa9c96b1cb7c458d21895305cc99cff4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 37979,
"upload_time": "2024-10-24T11:33:32",
"upload_time_iso_8601": "2024-10-24T11:33:32.440440Z",
"url": "https://files.pythonhosted.org/packages/8c/4b/6d6413ca271913d7d36bbb19b4e48eef07c10f014e71359a800b89a7bfbb/cellar_extractor-1.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-24 11:33:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "maastrichtlawtech",
"github_project": "extraction_libraries",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "cellar-extractor"
}