Skip to content

Commit 43e5dfa

Browse files
authored
Merge pull request #2 from swerik-project/dev
prerelease: patch version
2 parents 49daf25 + d2e9baa commit 43e5dfa

13 files changed

Lines changed: 1025 additions & 716 deletions

File tree

CITATION.cff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cff-version: 1.2.0
22
message: To cite this reposository, please use these metadata.
33
title: "valtiopy: access the Finnish Parliament Corpus"
4-
version: v0.0.1
4+
version: v0.0.2
55
authors:
66
- family-names: Borges
77
given-names: Robert

docs/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/valtiopy.html

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
<input type="search" placeholder="Search..." role="searchbox" aria-label="search"
2323
pattern=".+" required>
2424

25+
<h2>Contents</h2>
26+
<ul>
27+
<li><a href="#valtiopy">valtiopy</a></li>
28+
</ul>
29+
2530

2631
<h2>Submodules</h2>
2732
<ul>
@@ -32,7 +37,7 @@ <h2>Submodules</h2>
3237
</ul>
3338

3439

35-
<footer>v0.0.1</footer>
40+
<footer>v0.0.2</footer>
3641

3742
<a class="attribution" title="pdoc: Python API documentation generator" href="https://pdoc.dev" target="_blank">
3843
built with <span class="visually-hidden">pdoc</span><img
@@ -46,10 +51,21 @@ <h2>Submodules</h2>
4651
<h1 class="modulename">
4752
valtiopy </h1>
4853

49-
50-
51-
52-
54+
<div class="docstring"><h1 id="valtiopy">valtiopy</h1>
55+
56+
<p>A Python module for working with the Valtiopaivat corpus.</p>
57+
</div>
58+
59+
<input id="mod-valtiopy-view-source" class="view-source-toggle-state" type="checkbox" aria-hidden="true" tabindex="-1">
60+
61+
<label class="view-source-button" for="mod-valtiopy-view-source"><span>View Source</span></label>
62+
63+
<div class="pdoc-code codehilite"><pre><span></span><span id="L-1"><a href="#L-1"><span class="linenos">1</span></a><span class="sd">&quot;&quot;&quot;</span>
64+
</span><span id="L-2"><a href="#L-2"><span class="linenos">2</span></a><span class="sd">.. include:: ../README.md</span>
65+
</span><span id="L-3"><a href="#L-3"><span class="linenos">3</span></a><span class="sd">&quot;&quot;&quot;</span>
66+
</span></pre></div>
67+
68+
5369
</section>
5470
</main>
5571
<script>

docs/valtiopy/args.html

Lines changed: 454 additions & 312 deletions
Large diffs are not rendered by default.

docs/valtiopy/config.html

Lines changed: 173 additions & 134 deletions
Large diffs are not rendered by default.

docs/valtiopy/curate.html

Lines changed: 227 additions & 202 deletions
Large diffs are not rendered by default.

docs/valtiopy/utils.html

Lines changed: 60 additions & 53 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "valtiopy"
3-
version = "v0.0.1"
3+
version = "v0.0.2"
44
description = "Work with the Valtiopaivat Corpus."
55
authors = ["bobborges"]
66
repository = "https://github.com/swerik-project/valtiopy"

valtiopy/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""
2+
.. include:: ../README.md
3+
"""

valtiopy/args.py

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ def custom_serializer(obj):
3939
def populate_common_args(parser):
4040
"""
4141
Add common arguments to a parser that will be used in most of the scripts.
42+
43+
Args
44+
45+
parser: argparse parser instance
46+
47+
Returns
48+
49+
parser
4250
"""
4351
parser.add_argument("-c", "--config-name",
4452
default = 'default',
@@ -85,6 +93,14 @@ def populate_common_args(parser):
8593
def fetch_parser(description=None):
8694
"""
8795
Create a parser instance and populate it with common arguments.
96+
97+
Args
98+
99+
description (str): description of script calling parser (__doc__)
100+
101+
Returns
102+
103+
parser
88104
"""
89105
parser = argparse.ArgumentParser(description=description)
90106
parser = populate_common_args(parser)
@@ -94,6 +110,14 @@ def fetch_parser(description=None):
94110
def impute_arg_values(args):
95111
"""
96112
parse common arguments and pre-handle args for the script user
113+
114+
Args
115+
116+
args: Argparse argument class instances
117+
118+
Returns
119+
120+
args
97121
"""
98122
def _handle_config(args):
99123
"""
@@ -114,6 +138,14 @@ def _handle_config(args):
114138
def _fetch_documents(args):
115139
"""
116140
fetch documents according to start/end or meeting time frame
141+
142+
Args
143+
144+
args: Argparse argument class instances
145+
146+
Returns
147+
148+
args
117149
"""
118150
def _get_files(paths, args, ext=".xml"):
119151
files = []
@@ -156,6 +188,14 @@ def _get_files(paths, args, ext=".xml"):
156188
def _filter_doctype(args):
157189
"""
158190
select documents based on doctype
191+
192+
Args
193+
194+
args: Argparse argument class instances
195+
196+
Returns
197+
198+
args
159199
"""
160200
if args.doctypes is None:
161201
return args
@@ -172,13 +212,29 @@ def _filter_doctype(args):
172212
def _filter_language(args):
173213
"""
174214
select documents based on the primary language
215+
216+
Args
217+
218+
args: Argparse argument class instances
219+
220+
Returns
221+
222+
args
175223
"""
176224
warnings.warn(_filter_language.__name__, NotImplemented)
177225
return args
178226

179227
def _filter_chamber(args):
180228
"""
181229
select documents based on the chamber
230+
231+
Args
232+
233+
args: Argparse argument class instances
234+
235+
Returns
236+
237+
args
182238
"""
183239
if args.chambers is None:
184240
return args

0 commit comments

Comments
 (0)