Skip to content
Snippets Groups Projects
Commit 8acdac67 authored by Gallenkamp, Fabian's avatar Gallenkamp, Fabian
Browse files

Fixed small issues

parent 7de6b48f
Branches
No related tags found
No related merge requests found
......@@ -189,7 +189,7 @@ class AdvancedSoftwareView(sqla.ModelView):
# Generate overview page
with open('templates/export/softwares.jinja2', "r", encoding="utf-8") as file_:
template = Template(file_.read())
template.stream(softwareincategory=softwareincategory).dump('../digitale-Methoden-wiki/Softwareliste.asciidoc', encoding='utf-8')
template.stream(softwareincategory=softwareincategory).dump('../digitale-Methoden-wiki/SoftwareToolsList.asciidoc', encoding='utf-8')
base_path = pathlib.Path('../digitale-Methoden-wiki/')
data = io.BytesIO()
......@@ -203,139 +203,25 @@ class AdvancedSoftwareView(sqla.ModelView):
as_attachment=True,
attachment_filename='data.zip'
)
flash("Done")
flash("Files generated!")
except Exception as ex:
if not self.handle_view_exception(ex):
raise
flash("Not done")
'''
class UserAdmin(sqla.ModelView):
action_disallowed_list = ['delete', ]
column_display_pk = True
column_list = [
'id',
'last_name',
'first_name',
'email',
'pets',
]
column_default_sort = [('last_name', False), ('first_name', False)] # sort on multiple columns
# custom filter: each filter in the list is a filter operation (equals, not equals, etc)
# filters with the same name will appear as operations under the same filter
column_filters = [
FilterEqual(column=User.last_name, name='Last Name'),
FilterLastNameBrown(column=User.last_name, name='Last Name',
options=(('1', 'Yes'), ('0', 'No')))
]
inline_models = [(UserInfo, inline_form_options), ]
# setup create & edit forms so that only 'available' pets can be selected
def create_form(self):
return self._use_filtered_parent(
super(UserAdmin, self).create_form()
)
def edit_form(self, obj):
return self._use_filtered_parent(
super(UserAdmin, self).edit_form(obj)
)
def _use_filtered_parent(self, form):
form.pets.query_factory = self._get_parent_list
return form
def _get_parent_list(self):
# only show available pets in the form
return Pet.query.filter_by(available=True).all()
# Customized Post model admin
class PostAdmin(sqla.ModelView):
column_list = ['id', 'user', 'title', 'date', 'tags']
column_default_sort = ('date', True)
column_sortable_list = [
'id',
'title',
'date',
('user', ('user.last_name', 'user.first_name')), # sort on multiple columns
]
column_labels = dict(title='Post Title') # Rename 'title' column in list view
column_searchable_list = [
'title',
'tags.name',
'user.first_name',
'user.last_name',
]
column_labels = {
'title': 'Title',
'tags.name': 'tags',
'user.first_name': 'user\'s first name',
'user.last_name': 'last name',
}
column_filters = [
'user',
'title',
'date',
'tags',
filters.FilterLike(Post.title, 'Fixed Title', options=(('test1', 'Test 1'), ('test2', 'Test 2'))),
]
can_export = True
export_max_rows = 1000
export_types = ['csv', 'xls']
# Pass arguments to WTForms. In this case, change label for text field to
# be 'Big Text' and add required() validator.
form_args = dict(
text=dict(label='Big Text', validators=[validators.data_required()])
)
form_ajax_refs = {
'user': {
'fields': (User.first_name, User.last_name)
},
'tags': {
'fields': (Tag.name,),
'minimum_input_length': 0, # show suggestions, even before any user input
'placeholder': 'Please select',
'page_size': 5,
},
}
def __init__(self, session):
# Just call parent class with predefined model.
super(PostAdmin, self).__init__(Post, session)
class TreeView(sqla.ModelView):
form_excluded_columns = ['children', ]
class ScreenView(sqla.ModelView):
column_list = ['id', 'width', 'height',
'number_of_pixels'] # not that 'number_of_pixels' is a hybrid property, not a field
column_sortable_list = ['id', 'width', 'height', 'number_of_pixels']
# Flask-admin can automatically detect the relevant filters for hybrid properties.
column_filters = ('number_of_pixels',)
'''
# Create admin
admin = admin.Admin(app, name='Softwaresammlung: Digitale Methoden', template_mode='bootstrap3')
admin = admin.Admin(app, name='SoftwareTools: digital methods', template_mode='bootstrap3')
# Add views
admin.add_view(AdvancedSoftwareView(Software, db.session))
admin.add_view(sqla.ModelView(Feature, db.session, category="Weiteres"))
admin.add_view(sqla.ModelView(License, db.session, category="Weiteres"))
admin.add_view(sqla.ModelView(Link, db.session, category="Weiteres"))
admin.add_view(sqla.ModelView(SoftwareCategory, db.session, category="Weiteres"))
admin.add_sub_category(name="Andere Sammlungen", parent_name="Weiteres")
admin.add_link(MenuLink(name="CRAN-R", url='https://cran.r-project.org/web/views/', category='Andere Sammlungen', target="_blank"))
admin.add_link(MenuLink(name="ROpenSci", url='https://ropensci.org/packages/', category='Andere Sammlungen', target="_blank"))
admin.add_view(AdvancedSoftwareView(Software, db.session, name="SoftwareTool"))
admin.add_view(sqla.ModelView(Feature, db.session, category="Misc"))
admin.add_view(sqla.ModelView(License, db.session, category="Misc"))
admin.add_view(sqla.ModelView(Link, db.session, category="Misc"))
admin.add_view(sqla.ModelView(SoftwareCategory, db.session, category="Misc"))
admin.add_sub_category(name="Other collections", parent_name="Misc")
admin.add_link(MenuLink(name="CRAN-R", url='https://cran.r-project.org/web/views/', category='Other collections', target="_blank"))
admin.add_link(MenuLink(name="ROpenSci", url='https://ropensci.org/packages/', category='Other collections', target="_blank"))
......@@ -344,12 +230,9 @@ def build_sample_db():
Populate a small db with some example entries.
"""
import random
import datetime
db.drop_all()
db.create_all()
lic_unknown = License(name="Unbekannt")
lic_unknown = License(name="Unknown")
lic_bsd = License(name="BSD")
lic_gpl2 = License(name="GPL", version="2.0")
lic_gpl3 = License(name="GPL", version="3.0")
......@@ -359,7 +242,7 @@ def build_sample_db():
lic_mit = License(name="MIT")
lic_byncnd3 = License(name="CC BY-NC-ND", version="3.0")
lic_ccdl = License(name="CCDL", version="1.0")
lic_prop = License(name="Proprietär")
lic_prop = License(name="Proprietary")
db.session.add(lic_gpl3)
db.session.add(lic_gpl3)
db.session.add(lic_agpl3)
......@@ -383,25 +266,27 @@ def build_sample_db():
db.session.add(prol_js)
db.session.add(prol_c)
cat_tracking = SoftwareCategory(name="datenschutzkonformes Tracking", short_description="Sammlung von Sensordaten/Logdaten oder Nutzungsdaten mit expliziter Einverständnis mittels Software auf dem Gerät.")
cat_scraping = SoftwareCategory(name="Scraping", short_description="Tools im Zusammenhang mit Web-Scraping.")
cat_int = SoftwareCategory(name="Korpusanalyse", short_description="Integrierte Plattformen für die Analyse großer Textcorpora.")
cat_qda = SoftwareCategory(name="QDA-Software", short_description="Computer-gestützte Analyse qualitativer Daten.")
cat_tm = SoftwareCategory(name="Automatisierte Inhaltsanalyse/Text Mining", short_description="")
cat_senti = SoftwareCategory(name="Sentiment Analysis", short_description="")
cat_topic = SoftwareCategory(name="Topic-Modellierung", short_description="")
cat_visu = SoftwareCategory(name="Visualisierung", short_description="")
cat_kollab_anno = SoftwareCategory(name="Kollaboratives Annotieren", short_description="")
cat_kollab_write = SoftwareCategory(name="Kollaboratives Schreiben", short_description="")
cat_stat = SoftwareCategory(name="Statisik-Programme", short_description="Zur statistischen Modellierung einsetzbare Software.")
cat_repo = SoftwareCategory(name="Forschungsdatenspeicherung", short_description="")
cat_now = SoftwareCategory(name="Nowcasting", short_description="")
cat_net = SoftwareCategory(name="Netzwerkanalysen", short_description="social network analysis")
cat_esmema = SoftwareCategory(name="ESM/EMA-Studien", short_description="Datenerhebung in 'natürlicher' Umgebung.")
cat_transkript = SoftwareCategory(name="Audio-Transkription", short_description="Transkriptionssoftware")
cat_search = SoftwareCategory(name="Suche", short_description="Software im Zusammenhang von erweiterter Suche in großen Textmengen")
cat_misc = SoftwareCategory(name="Weiteres", short_description="Zu speziell zum Einordnen..")
cat_tracking = SoftwareCategory(name="user-consented tracking", short_description="Collection of sensor data on (mobile) devices in accordance with data protection laws.")
cat_scraping = SoftwareCategory(name="scraping", short_description="Tools in the area of web-scraping")
cat_int = SoftwareCategory(name="tools for corpus linguistics", short_description="Integrated platforms for corpus analysis and processing.")
cat_qda = SoftwareCategory(name="computer assisted/aided qualitative data analysis software (CAQDAS)", short_description="assist with qualitative research such as transcription analysis, coding and text interpretation, recursive abstraction, content analysis, discourse analysis, grounded theory methodology, etc.")
cat_tm = SoftwareCategory(name="text mining/natuaral language processing(NLP)", short_description="")
cat_senti = SoftwareCategory(name="sentiment analysis", short_description="")
cat_topic = SoftwareCategory(name="topic-models", short_description="")
cat_visu = SoftwareCategory(name="visualization", short_description="")
cat_kollab_anno = SoftwareCategory(name="collaborative annotation", short_description="")
cat_kollab_write = SoftwareCategory(name="collaborative writing", short_description="")
cat_stat = SoftwareCategory(name="statistical software", short_description="software that helps calcualting with specific statistical models")
cat_repo = SoftwareCategory(name="research data archiving", short_description="")
cat_now = SoftwareCategory(name="nowcasting", short_description="")
cat_net = SoftwareCategory(name="network analysis", short_description="social network analysis")
cat_esmema = SoftwareCategory(name="ESM/EMA surveys", short_description="Datenerhebung in 'natürlicher' Umgebung.")
cat_transkript = SoftwareCategory(name="audio-transcriptions", short_description="software that converts speech into electronic text document.")
cat_search = SoftwareCategory(name="search", short_description="information retrieval in large datasets.")
cat_ocr = SoftwareCategory(name="optical character recognition (OCR)",short_description="OCR is the mechanical or electronic conversion of images of typed, handwritten or printed text into machine-encoded text.")
cat_oe = SoftwareCategory(name="online experiments", short_description="")
cat_misc = SoftwareCategory(name="miscellaneous", short_description="")
db.session.add(cat_tracking)
db.session.add(cat_scraping)
......@@ -449,6 +334,17 @@ def build_sample_db():
db.session.add(Link(software=tool, type="repository", url="https://github.com/audaciouscode/PassiveDataKit-Android", comment="android"))
db.session.add(Link(software=tool, type="repository", url="https://github.com/audaciouscode/PassiveDataKit-iOS", comment="iOS"))
tool = Software(name="facepager",
developer="Jakob Jünger and Till Keyling",
maintainer="Jakob Jünger",
softwarecategory=cat_scraping,
architecture="package",
license=lic_mit,
programminglanguages=[prol_py])
db.session.add(tool)
db.session.add(Link(software=tool, type="wiki", url="https://github.com/strohne/Facepager", comment=""))
db.session.add(Link(software=tool, type="repository", url="https://github.com/strohne/Facepager", comment=""))
tool = Software(name="Scrapy",
developer="",
maintainer="",
......@@ -857,6 +753,18 @@ def build_sample_db():
db.session.add(Link(software=tool, type="website", url="https://gephi.org/", comment=""))
db.session.add(Link(software=tool, type="repository", url="https://github.com/gephi/gephi/", comment=""))
tool = Software(name="scikit-image",
short_description="scikit-image is a collection of algorithms for image processing. It is available free of charge and free of restriction. We pride ourselves on high-quality, peer-reviewed code, written by an active community of volunteers.",
developer="Stéfan van der Walt, Johannes L. Schönberger, Juan Nunez-Iglesias, François Boulogne, Joshua D. Warner, Neil Yager, Emmanuelle Gouillart, Tony Yu, and the scikit-image contributors",
maintainer="Stéfan van der Walt, Johannes L. Schönberger, Juan Nunez-Iglesias, François Boulogne, Joshua D. Warner, Neil Yager, Emmanuelle Gouillart, Tony Yu, and the scikit-image contributors",
softwarecategory=cat_visu,
architecture="package",
license=lic_bsd,
programminglanguages=[prol_py])
db.session.add(tool)
db.session.add(Link(software=tool, type="website", url="https://scikit-image.org/", comment=""))
db.session.add(Link(software=tool, type="repository", url="https://github.com/scikit-image/scikit-image", comment=""))
tool = Software(name="CATMA",
short_description="CATMA (Computer Assisted Text Markup and Analysis) is a practical and intuitive tool for text researchers. In CATMA users can combine the hermeneutic, ‘undogmatic’ and the digital, taxonomy based approach to text and corpora—as a single researcher, or in real-time collaboration with other team members.",
developer="",
......@@ -939,7 +847,7 @@ def build_sample_db():
license=lic_prop,
programminglanguages=[])
db.session.add(tool)
db.session.add(Link(software=tool, type="website", url="https://www.rrz.uni-hamburg.de/services/software/software-thematisch/statistik/stata.html", comment = "uhh"))
db.session.add(Link(software=tool, type="website", url="https://www.rrz.uni-hamburg.de/services/software/software-thematisch/statistik/spss-netzlizenz.html", comment = "uhh"))
tool = Software(name="STATA",
......@@ -951,7 +859,7 @@ def build_sample_db():
license=lic_prop,
programminglanguages=[])
db.session.add(tool)
db.session.add(Link(software=tool, type="website", url="https://www.rrz.uni-hamburg.de/services/software/software-thematisch/statistik/spss-netzlizenz.html", comment = "uhh"))
db.session.add(Link(software=tool, type="website", url="https://www.rrz.uni-hamburg.de/services/software/software-thematisch/statistik/stata.html", comment = "uhh"))
tool = Software(name="Nowcasting",
short_description="",
......@@ -1079,6 +987,40 @@ def build_sample_db():
db.session.add(Link(software=tool, type="website", url="", comment=""))
db.session.add(Link(software=tool, type="repository", url="https://github.com/EXMARaLDA/exmaralda", comment=""))
tool = Software(name="tesseract",
short_description="Tesseract is an open source text recognizer (OCR) Engine, available under the Apache 2.0 license. It can be used directly, or (for programmers) using an API to extract printed text from images. It supports a wide variety of languages.",
developer="Google, HP Inc.",
maintainer="Ray Smith u. a. ",
softwarecategory=cat_ocr,
architecture="package",
license=lic_apache2,
programminglanguages=[prol_py])
db.session.add(tool)
db.session.add(Link(software=tool, type="repository", url="https://github.com/tesseract-ocr/tesseract", comment=""))
tool = Software(name="nodeGame",
short_description="NodeGame is a free, open source JavaScript/HTML5 framework for conducting synchronous experiments online and in the lab directly in the browser window. It is specifically designed to support behavioral research along three dimensions: larger group sizes, real-time (but also discrete time) experiments, batches of simultaneous experiments.",
developer="Stefan Balietti",
maintainer="Stefan Balietti",
softwarecategory=cat_oe,
architecture="package",
license=lic_mit,
programminglanguages=[prol_js])
db.session.add(tool)
db.session.add(Link(software=tool, type="website", url="https://nodegame.org/", comment=""))
db.session.add(Link(software=tool, type="repository", url="https://github.com/nodeGame", comment=""))
tool = Software(name="scikit-learn",
short_description="Scikit-learn is a free software machine learning library for the Python programming language. It features various classification, regression and clustering algorithms including support vector machines, random forests, gradient boosting, k-means and DBSCAN, and is designed to interoperate with the Python numerical and scientific libraries NumPy and SciPy.",
developer="Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V. and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P. and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.",
maintainer="Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V. and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P. and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.",
softwarecategory=cat_misc,
architecture="package",
license=lic_bsd,
programminglanguages=[prol_py])
db.session.add(tool)
db.session.add(Link(software=tool, type="website", url="https://scikit-learn.org/stable/index.html", comment=""))
db.session.add(Link(software=tool, type="repository", url="https://github.com/scikit-learn/scikit-learn", comment=""))
'''
tool = Software(name="",
......
No preview for this file type
:toc:
:toclevels: 8
:toc-title: Categories (work in progress: this list is preliminary and will be updated continuously)
:sectnums:
:sectnumlevels: 8
{% for softwarecategory in softwareincategory %}
== {{ softwarecategory[0].name }}
_{{softwarecategory[0].short_description}}_
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment