• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

iplweb / bpp / 18634744198

19 Oct 2025 07:00PM UTC coverage: 31.618% (-29.9%) from 61.514%
18634744198

push

github

mpasternak
Merge branch 'release/v202510.1270'

657 of 9430 branches covered (6.97%)

Branch coverage included in aggregate %.

229 of 523 new or added lines in 42 files covered. (43.79%)

11303 existing lines in 316 files now uncovered.

14765 of 39346 relevant lines covered (37.53%)

0.38 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

11.32
src/api_v1/views.py
1
from rest_framework.routers import APIRootView
1✔
2

3
from django.utils.safestring import mark_safe
1✔
4

5

6
class CustomAPIRootView(APIRootView):
1✔
7
    """
8
    System BPP - Bibliografia Publikacji Pracowników
9
    BPP System - Academic Staff Publications Bibliography
10
    """
11

12
    def get_view_name(self):
1✔
UNCOV
13
        return "BPP API"
×
14

15
    def get_view_description(self, html=False):
1✔
16
        if html:
×
17
            return mark_safe(
×
18
                """
19
            <div class="description">
20
                <h3>System BPP - Bibliografia Publikacji Pracowników</h3>
21
                <h4>BPP System - Academic Staff Publications Bibliography</h4>
22

23
                <pre>
24
Data flows through code,
25
AI bridges minds and texts —
26
Knowledge finds its home.
27
</pre>
28

29
                <div style="margin-top: 20px;">
30
                    <p><strong>PL:</strong> To jest interfejs programistyczny (API) systemu BPP, który umożliwia dostęp
31
                    do danych bibliograficznych publikacji naukowych.</p>
32

33
                    <p><strong>EN:</strong> This is the BPP system API that provides access
34
                    to bibliographic data of academic publications.</p>
35
                </div>
36

37
                <div style="margin-top: 25px; padding: 15px; background-color: #f8f9fa; border-radius: 5px;">
38
                    <h5 style="margin-top: 0;"><span class="fi-info"></span> Informacje / Information</h5>
39

40
                    <p><strong>PL:</strong> BPP jest wolnym oprogramowaniem o otwartym kodzie źródłowym.</p>
41
                    <p><strong>EN:</strong> BPP is free and open source software.</p>
42

43
                    <div style="margin-top: 15px;">
44
                        <p><strong>Przydatne linki / Useful links:</strong></p>
45
                        <ul style="list-style: none; padding-left: 0;">
46
                            <li><span class="fi-book"></span> <strong>Dokumentacja / Documentation:</strong>
47
                                <a href="https://bpp.readthedocs.io" target="_blank">bpp.readthedocs.io</a>
48
                            </li>
49
                            <li><span class="fi-social-github"></span> <strong>Kod źródłowy / Source code:</strong>
50
                                <a href="https://github.com/iplweb/bpp/" target="_blank">github.com/iplweb/bpp</a>
51
                            </li>
52
                            <li><span class="fi-web"></span> <strong>Strona projektu / Project page:</strong>
53
                                <a href="https://bpp.iplweb.pl/" target="_blank">bpp.iplweb.pl</a>
54
                            </li>
55
                        </ul>
56
                    </div>
57
                </div>
58
            </div>
59
            """
60
            )
61
        return self.__doc__
×
62

63
    def get(self, request, *args, **kwargs):
1✔
64
        # Get the standard API root response
65
        response = super().get(request, *args, **kwargs)
×
66

67
        # Reorganize the endpoints into categories for better readability
68
        if hasattr(response, "data"):
×
69
            endpoints = response.data.copy()
×
70

71
            # Track which endpoints we've categorized
72
            categorized_endpoints = set()
×
73

74
            # Define what goes into each category
75
            categories_mapping = {
×
76
                "publications": [
77
                    "wydawnictwo_zwarte",
78
                    "wydawnictwo_zwarte_autor",
79
                    "wydawnictwo_zwarte_streszczenie",
80
                    "wydawnictwo_ciagle",
81
                    "wydawnictwo_ciagle_autor",
82
                    "wydawnictwo_ciagle_streszczenie",
83
                    "wydawnictwo_ciagle_zewnetrzna_baza_danych",
84
                    "patent",
85
                    "patent_autor",
86
                    "praca_doktorska",
87
                    "praca_habilitacyjna",
88
                ],
89
                "authors_and_units": [
90
                    "autor",
91
                    "autor_jednostka",
92
                    "funkcja_autora",
93
                    "tytul",
94
                    "recent_author_publications",
95
                    "jednostka",
96
                    "wydzial",
97
                    "uczelnia",
98
                ],
99
                "sources_and_publishers": [
100
                    "zrodlo",
101
                    "rodzaj_zrodla",
102
                    "wydawca",
103
                    "poziom_wydawcy",
104
                ],
105
                "metadata": [
106
                    "charakter_formalny",
107
                    "typ_kbn",
108
                    "jezyk",
109
                    "dyscyplina_naukowa",
110
                    "konferencja",
111
                    "seria_wydawnicza",
112
                    "czas_udostepnienia_openaccess",
113
                    "nagroda",
114
                ],
115
                "reports": ["raport_slotow_uczelnia", "raport_slotow_uczelnia_wiersz"],
116
            }
117

118
            organized_data = {
×
119
                "info": {
120
                    "name_pl": "System BPP - Bibliografia Publikacji Pracowników",
121
                    "name_en": "BPP System - Academic Staff Publications Bibliography",
122
                    "description_pl": (
123
                        "To jest interfejs programistyczny (API) systemu BPP, który umożliwia dostęp "
124
                        "do danych bibliograficznych publikacji naukowych. "
125
                        "Kliknij na dowolny z poniższych adresów URL, aby przeglądać dostępne zasoby."
126
                    ),
127
                    "description_en": (
128
                        "This is the BPP system API that provides access "
129
                        "to bibliographic data of academic publications. "
130
                        "Click on any of the URLs below to browse available resources."
131
                    ),
132
                    "usage_pl": "Kliknij na adresy poniżej, aby eksplorować dostępne dane.",
133
                    "usage_en": "Click on the addresses below to explore available data.",
134
                }
135
            }
136

137
            # Initialize all categories
138
            for category in categories_mapping:
×
139
                organized_data[category] = {}
×
140

141
            # Categorize known endpoints
142
            for category, endpoint_names in categories_mapping.items():
×
143
                for endpoint_name in endpoint_names:
×
144
                    if endpoint_name in endpoints:
×
145
                        organized_data[category][endpoint_name] = endpoints[
×
146
                            endpoint_name
147
                        ]
148
                        categorized_endpoints.add(endpoint_name)
×
149

150
            # Collect any uncategorized endpoints
151
            organized_data["other"] = {}
×
152
            for endpoint_name, endpoint_url in endpoints.items():
×
153
                if endpoint_name not in categorized_endpoints:
×
154
                    organized_data["other"][endpoint_name] = endpoint_url
×
155

156
            # Remove empty categories (except info)
157
            final_data = {"info": organized_data["info"]}
×
158
            for category, content in organized_data.items():
×
159
                if category != "info" and content:
×
160
                    final_data[category] = content
×
161

162
            response.data = final_data
×
163

164
        return response
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc