summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-15 08:21:36 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-15 08:21:36 +0000
commit0a2082194036d73c26d68ff21c076ce56a89c760 (patch)
tree08c28ccfa6e4e306a030b5be4a8cfe9ff50adba2
parent684bc8c8cd2543d44b05cf225785c86a826f9441 (diff)
automatic import of python-oscn
-rw-r--r--.gitignore1
-rw-r--r--python-oscn.spec520
-rw-r--r--sources1
3 files changed, 522 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..3177ff3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/oscn-0.0.0.84.tar.gz
diff --git a/python-oscn.spec b/python-oscn.spec
new file mode 100644
index 0000000..7063b82
--- /dev/null
+++ b/python-oscn.spec
@@ -0,0 +1,520 @@
+%global _empty_manifest_terminate_build 0
+Name: python-oscn
+Version: 0.0.0.84
+Release: 1
+Summary: Oklahoma State Courts Network case parsing utilities
+License: MIT
+URL: https://github.com/codefortulsa/oscn
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/36/78/8a49fd97ee5da20eb5519319669f793595daddab3a700d978da8b53160d7/oscn-0.0.0.84.tar.gz
+BuildArch: noarch
+
+Requires: python3-requests
+Requires: python3-beautifulsoup4
+Requires: python3-boto3
+Requires: python3-decouple
+
+%description
+# OSCN utilities
+
+A python library for scraping case information from the [Oklahoma State Courts Network](https://www.oscn.net/dockets/).
+
+## Contents
+
+oscn > Python package source to provide an api for retrieving and parsing case records.
+
+scripts > Python scripts showing use of the oscn package
+
+- example.py: demonstrates use of the request Case and Caselist
+- retrieve-counts.py: saves a list of all counts for a list of counties and years
+- find-counts.py: saves a list of counts passing a test for a list of counties and years
+- soup_test.py: a stub for testing parsing attempts using BeautifulSoup
+- parse_test.py: a stub for developing using saved examples
+
+## OSCN package
+
+### oscn
+
+- counties: Returns a list of counties.
+- courts: Same as counties but more a accurate description.
+- judges: Returns a list of objects formated as {'name': 'Bond, James', 'number': '007'}
+- types: returns a dict of case type codes and descriptons
+- type: function to return case type description. Usage:
+ ```
+ >>> oscn.type("AO")
+ 'CIVIL ADMINISTRATIVE'
+ ```
+
+### oscn.request
+
+- Case: Returns a single case. Case can be saved as files using Case.save() and retrieved using Case.open().
+
+- CaseList: Returns an iterator for retrieving cases for a county and year. CaseLists can be filtered using .find(). See scripts/example.py for details
+
+- Party: Returns information on parties available on OSCN.
+
+- Docket: Returns docket of cases for specific judges and date
+
+### oscn.parse
+
+Parsers accept the html of an OSCN page and return python objects.
+
+#### Case Page Parsers
+
+- filed: returns a string of the filing date (e.g. 12/25/2017)
+- closed: returns a string of the date the case was closed. Return None if not closed.
+- counts: returns of list of count dicts found in a case. Keys include 'description'
+ of the count. If available 'violation' and 'disposed' are added.
+- judge: returns a string of the judge's name
+- parties: returns a list of dicts with these keys: id, name, type
+- docket: returns a list of rows in a docket
+- events: returns a list of dicts with these keys: event, party, docket, reporter, date, description. The keys date and description are cleaner versions of the event text. The event key will be deprecated some day so use date and description if you are starting a project.
+- attorneys: returns a list of dicts with these keys: name, address, and representing
+- issues: returns a list of dicts with issue information. Each issues includes a list of dicts for each party
+
+#### Party Page Parsers
+
+- name: returns 'Requested Party'
+- alias: returns 'Alias or Alternate Names'
+- profile: returns dict of values in 'Personal Profile'
+- birth_month: returns string of 'Birth Month and Year'
+- addresses: returns a list of dicts for each address
+
+#### Docket Page Parsers
+
+- cases: returns a list of case indexes
+- tables: returns the html table for each case in the docket
+
+### oscn.find
+
+- CaseIndexes: returns an iterator of case indexes (e.g. tulsa-CF-2019-12).
+
+#### Usage
+
+Create a CaseIndexes list using these key word arguments:
+
+- county: defaults to all,
+- last_name: use this for company or organization names
+- first_name: optional
+- middle_name: optional
+- filed_after: More readable than FiledDateL
+- filed_before: More readable than FiledDateH
+- closed_after: More readable than ClosedDateL
+- closed_before: More readable than ClosedDateH
+
+#### Notes
+
+- The % wild card is added to all words in name, first and middle
+- Date arguments use MM/DD/YYY strings.
+
+#### OSCN search parameters
+
+If you are familar with the OSCN search parameters you can initialize CaseIndexes using these as key word arguments: db, number, lname, fname, mname, DoBMin, DoBMax, partytype, apct, dcct, FiledDate, FiledDateH, ClosedDateL, ClosedDateH, iLC, iLCType, iYear, iNumber, and citation
+
+Using this will override init keyword values such as first or filed_after.
+
+## Development Install
+
+1. Create and activate a Python 3.6 virtual env
+1. `git clone git@github.com:codefortulsa/oscn.git`
+1. `cd oscn`
+1. `pip install -e .`
+
+## Usage
+
+Install with `pip install oscn`
+
+Script example:
+
+`import oscn`
+
+Request a single case:
+
+`oscn.request.Case(county='tulsa', year='2018', number=84)`
+
+or use case index notation:
+
+`oscn.request.Case('love-CF-2019-25')`
+
+To request a list of cases to iterate:
+
+`oscn.request.CaseList(county='adair', year='2016')`
+
+## Run test scripts
+
+- `pytest tests/`
+
+or with ipdb:
+
+ - `pytest -s tests/`
+
+specify a test:
+
+- `pytest -s tests/test_parse.py -k 'test_events'`
+
+## Deployment steps
+
+1. `python3 setup.py sdist bdist_wheel`
+1. `twine upload dist/*`
+
+## User Agent
+
+In some cases a custom user agent is required in the header of requests.
+Setting an environmental varialbe called OSCN_USER_AGENT will override the default.
+
+
+
+
+%package -n python3-oscn
+Summary: Oklahoma State Courts Network case parsing utilities
+Provides: python-oscn
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-oscn
+# OSCN utilities
+
+A python library for scraping case information from the [Oklahoma State Courts Network](https://www.oscn.net/dockets/).
+
+## Contents
+
+oscn > Python package source to provide an api for retrieving and parsing case records.
+
+scripts > Python scripts showing use of the oscn package
+
+- example.py: demonstrates use of the request Case and Caselist
+- retrieve-counts.py: saves a list of all counts for a list of counties and years
+- find-counts.py: saves a list of counts passing a test for a list of counties and years
+- soup_test.py: a stub for testing parsing attempts using BeautifulSoup
+- parse_test.py: a stub for developing using saved examples
+
+## OSCN package
+
+### oscn
+
+- counties: Returns a list of counties.
+- courts: Same as counties but more a accurate description.
+- judges: Returns a list of objects formated as {'name': 'Bond, James', 'number': '007'}
+- types: returns a dict of case type codes and descriptons
+- type: function to return case type description. Usage:
+ ```
+ >>> oscn.type("AO")
+ 'CIVIL ADMINISTRATIVE'
+ ```
+
+### oscn.request
+
+- Case: Returns a single case. Case can be saved as files using Case.save() and retrieved using Case.open().
+
+- CaseList: Returns an iterator for retrieving cases for a county and year. CaseLists can be filtered using .find(). See scripts/example.py for details
+
+- Party: Returns information on parties available on OSCN.
+
+- Docket: Returns docket of cases for specific judges and date
+
+### oscn.parse
+
+Parsers accept the html of an OSCN page and return python objects.
+
+#### Case Page Parsers
+
+- filed: returns a string of the filing date (e.g. 12/25/2017)
+- closed: returns a string of the date the case was closed. Return None if not closed.
+- counts: returns of list of count dicts found in a case. Keys include 'description'
+ of the count. If available 'violation' and 'disposed' are added.
+- judge: returns a string of the judge's name
+- parties: returns a list of dicts with these keys: id, name, type
+- docket: returns a list of rows in a docket
+- events: returns a list of dicts with these keys: event, party, docket, reporter, date, description. The keys date and description are cleaner versions of the event text. The event key will be deprecated some day so use date and description if you are starting a project.
+- attorneys: returns a list of dicts with these keys: name, address, and representing
+- issues: returns a list of dicts with issue information. Each issues includes a list of dicts for each party
+
+#### Party Page Parsers
+
+- name: returns 'Requested Party'
+- alias: returns 'Alias or Alternate Names'
+- profile: returns dict of values in 'Personal Profile'
+- birth_month: returns string of 'Birth Month and Year'
+- addresses: returns a list of dicts for each address
+
+#### Docket Page Parsers
+
+- cases: returns a list of case indexes
+- tables: returns the html table for each case in the docket
+
+### oscn.find
+
+- CaseIndexes: returns an iterator of case indexes (e.g. tulsa-CF-2019-12).
+
+#### Usage
+
+Create a CaseIndexes list using these key word arguments:
+
+- county: defaults to all,
+- last_name: use this for company or organization names
+- first_name: optional
+- middle_name: optional
+- filed_after: More readable than FiledDateL
+- filed_before: More readable than FiledDateH
+- closed_after: More readable than ClosedDateL
+- closed_before: More readable than ClosedDateH
+
+#### Notes
+
+- The % wild card is added to all words in name, first and middle
+- Date arguments use MM/DD/YYY strings.
+
+#### OSCN search parameters
+
+If you are familar with the OSCN search parameters you can initialize CaseIndexes using these as key word arguments: db, number, lname, fname, mname, DoBMin, DoBMax, partytype, apct, dcct, FiledDate, FiledDateH, ClosedDateL, ClosedDateH, iLC, iLCType, iYear, iNumber, and citation
+
+Using this will override init keyword values such as first or filed_after.
+
+## Development Install
+
+1. Create and activate a Python 3.6 virtual env
+1. `git clone git@github.com:codefortulsa/oscn.git`
+1. `cd oscn`
+1. `pip install -e .`
+
+## Usage
+
+Install with `pip install oscn`
+
+Script example:
+
+`import oscn`
+
+Request a single case:
+
+`oscn.request.Case(county='tulsa', year='2018', number=84)`
+
+or use case index notation:
+
+`oscn.request.Case('love-CF-2019-25')`
+
+To request a list of cases to iterate:
+
+`oscn.request.CaseList(county='adair', year='2016')`
+
+## Run test scripts
+
+- `pytest tests/`
+
+or with ipdb:
+
+ - `pytest -s tests/`
+
+specify a test:
+
+- `pytest -s tests/test_parse.py -k 'test_events'`
+
+## Deployment steps
+
+1. `python3 setup.py sdist bdist_wheel`
+1. `twine upload dist/*`
+
+## User Agent
+
+In some cases a custom user agent is required in the header of requests.
+Setting an environmental varialbe called OSCN_USER_AGENT will override the default.
+
+
+
+
+%package help
+Summary: Development documents and examples for oscn
+Provides: python3-oscn-doc
+%description help
+# OSCN utilities
+
+A python library for scraping case information from the [Oklahoma State Courts Network](https://www.oscn.net/dockets/).
+
+## Contents
+
+oscn > Python package source to provide an api for retrieving and parsing case records.
+
+scripts > Python scripts showing use of the oscn package
+
+- example.py: demonstrates use of the request Case and Caselist
+- retrieve-counts.py: saves a list of all counts for a list of counties and years
+- find-counts.py: saves a list of counts passing a test for a list of counties and years
+- soup_test.py: a stub for testing parsing attempts using BeautifulSoup
+- parse_test.py: a stub for developing using saved examples
+
+## OSCN package
+
+### oscn
+
+- counties: Returns a list of counties.
+- courts: Same as counties but more a accurate description.
+- judges: Returns a list of objects formated as {'name': 'Bond, James', 'number': '007'}
+- types: returns a dict of case type codes and descriptons
+- type: function to return case type description. Usage:
+ ```
+ >>> oscn.type("AO")
+ 'CIVIL ADMINISTRATIVE'
+ ```
+
+### oscn.request
+
+- Case: Returns a single case. Case can be saved as files using Case.save() and retrieved using Case.open().
+
+- CaseList: Returns an iterator for retrieving cases for a county and year. CaseLists can be filtered using .find(). See scripts/example.py for details
+
+- Party: Returns information on parties available on OSCN.
+
+- Docket: Returns docket of cases for specific judges and date
+
+### oscn.parse
+
+Parsers accept the html of an OSCN page and return python objects.
+
+#### Case Page Parsers
+
+- filed: returns a string of the filing date (e.g. 12/25/2017)
+- closed: returns a string of the date the case was closed. Return None if not closed.
+- counts: returns of list of count dicts found in a case. Keys include 'description'
+ of the count. If available 'violation' and 'disposed' are added.
+- judge: returns a string of the judge's name
+- parties: returns a list of dicts with these keys: id, name, type
+- docket: returns a list of rows in a docket
+- events: returns a list of dicts with these keys: event, party, docket, reporter, date, description. The keys date and description are cleaner versions of the event text. The event key will be deprecated some day so use date and description if you are starting a project.
+- attorneys: returns a list of dicts with these keys: name, address, and representing
+- issues: returns a list of dicts with issue information. Each issues includes a list of dicts for each party
+
+#### Party Page Parsers
+
+- name: returns 'Requested Party'
+- alias: returns 'Alias or Alternate Names'
+- profile: returns dict of values in 'Personal Profile'
+- birth_month: returns string of 'Birth Month and Year'
+- addresses: returns a list of dicts for each address
+
+#### Docket Page Parsers
+
+- cases: returns a list of case indexes
+- tables: returns the html table for each case in the docket
+
+### oscn.find
+
+- CaseIndexes: returns an iterator of case indexes (e.g. tulsa-CF-2019-12).
+
+#### Usage
+
+Create a CaseIndexes list using these key word arguments:
+
+- county: defaults to all,
+- last_name: use this for company or organization names
+- first_name: optional
+- middle_name: optional
+- filed_after: More readable than FiledDateL
+- filed_before: More readable than FiledDateH
+- closed_after: More readable than ClosedDateL
+- closed_before: More readable than ClosedDateH
+
+#### Notes
+
+- The % wild card is added to all words in name, first and middle
+- Date arguments use MM/DD/YYY strings.
+
+#### OSCN search parameters
+
+If you are familar with the OSCN search parameters you can initialize CaseIndexes using these as key word arguments: db, number, lname, fname, mname, DoBMin, DoBMax, partytype, apct, dcct, FiledDate, FiledDateH, ClosedDateL, ClosedDateH, iLC, iLCType, iYear, iNumber, and citation
+
+Using this will override init keyword values such as first or filed_after.
+
+## Development Install
+
+1. Create and activate a Python 3.6 virtual env
+1. `git clone git@github.com:codefortulsa/oscn.git`
+1. `cd oscn`
+1. `pip install -e .`
+
+## Usage
+
+Install with `pip install oscn`
+
+Script example:
+
+`import oscn`
+
+Request a single case:
+
+`oscn.request.Case(county='tulsa', year='2018', number=84)`
+
+or use case index notation:
+
+`oscn.request.Case('love-CF-2019-25')`
+
+To request a list of cases to iterate:
+
+`oscn.request.CaseList(county='adair', year='2016')`
+
+## Run test scripts
+
+- `pytest tests/`
+
+or with ipdb:
+
+ - `pytest -s tests/`
+
+specify a test:
+
+- `pytest -s tests/test_parse.py -k 'test_events'`
+
+## Deployment steps
+
+1. `python3 setup.py sdist bdist_wheel`
+1. `twine upload dist/*`
+
+## User Agent
+
+In some cases a custom user agent is required in the header of requests.
+Setting an environmental varialbe called OSCN_USER_AGENT will override the default.
+
+
+
+
+%prep
+%autosetup -n oscn-0.0.0.84
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-oscn -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.0.84-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..a8211a1
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+d04745e7004ce1646b23d9129b223f27 oscn-0.0.0.84.tar.gz