wbnews 2.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wbnews-2.2.1/.gitignore +181 -0
- wbnews-2.2.1/PKG-INFO +8 -0
- wbnews-2.2.1/pyproject.toml +31 -0
- wbnews-2.2.1/wbnews/.coveragerc +23 -0
- wbnews-2.2.1/wbnews/__init__.py +1 -0
- wbnews-2.2.1/wbnews/admin.py +27 -0
- wbnews-2.2.1/wbnews/apps.py +9 -0
- wbnews-2.2.1/wbnews/factories.py +33 -0
- wbnews-2.2.1/wbnews/fixtures/wbnews.yaml +1 -0
- wbnews-2.2.1/wbnews/import_export/__init__.py +0 -0
- wbnews-2.2.1/wbnews/import_export/backends/__init__.py +1 -0
- wbnews-2.2.1/wbnews/import_export/backends/news.py +35 -0
- wbnews-2.2.1/wbnews/import_export/handlers/__init__.py +1 -0
- wbnews-2.2.1/wbnews/import_export/handlers/news.py +25 -0
- wbnews-2.2.1/wbnews/import_export/parsers/__init__.py +0 -0
- wbnews-2.2.1/wbnews/import_export/parsers/emails/__init__.py +0 -0
- wbnews-2.2.1/wbnews/import_export/parsers/emails/news.py +48 -0
- wbnews-2.2.1/wbnews/import_export/parsers/emails/utils.py +61 -0
- wbnews-2.2.1/wbnews/import_export/parsers/rss/__init__.py +0 -0
- wbnews-2.2.1/wbnews/import_export/parsers/rss/news.py +63 -0
- wbnews-2.2.1/wbnews/locale/de/LC_MESSAGES/django.po +112 -0
- wbnews-2.2.1/wbnews/migrations/0001_initial_squashed_0005_alter_news_import_source.py +349 -0
- wbnews-2.2.1/wbnews/migrations/0006_alter_news_language.py +122 -0
- wbnews-2.2.1/wbnews/migrations/0007_auto_20240103_0955.py +43 -0
- wbnews-2.2.1/wbnews/migrations/0008_alter_news_language.py +123 -0
- wbnews-2.2.1/wbnews/migrations/0009_newsrelationship_analysis_newsrelationship_sentiment.py +94 -0
- wbnews-2.2.1/wbnews/migrations/__init__.py +0 -0
- wbnews-2.2.1/wbnews/models/__init__.py +3 -0
- wbnews-2.2.1/wbnews/models/llm/cleaned_news.py +63 -0
- wbnews-2.2.1/wbnews/models/news.py +116 -0
- wbnews-2.2.1/wbnews/models/relationships.py +20 -0
- wbnews-2.2.1/wbnews/models/sources.py +43 -0
- wbnews-2.2.1/wbnews/serializers.py +83 -0
- wbnews-2.2.1/wbnews/signals.py +4 -0
- wbnews-2.2.1/wbnews/tests/__init__.py +0 -0
- wbnews-2.2.1/wbnews/tests/conftest.py +6 -0
- wbnews-2.2.1/wbnews/tests/test_models.py +15 -0
- wbnews-2.2.1/wbnews/tests/tests.py +12 -0
- wbnews-2.2.1/wbnews/urls.py +29 -0
- wbnews-2.2.1/wbnews/viewsets/__init__.py +12 -0
- wbnews-2.2.1/wbnews/viewsets/buttons.py +23 -0
- wbnews-2.2.1/wbnews/viewsets/display.py +133 -0
- wbnews-2.2.1/wbnews/viewsets/endpoints.py +18 -0
- wbnews-2.2.1/wbnews/viewsets/menu.py +23 -0
- wbnews-2.2.1/wbnews/viewsets/titles.py +39 -0
- wbnews-2.2.1/wbnews/viewsets/views.py +140 -0
wbnews-2.2.1/.gitignore
ADDED
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
~
|
|
2
|
+
|
|
3
|
+
# Docker volumes
|
|
4
|
+
volumes/
|
|
5
|
+
# Poetry auth file
|
|
6
|
+
auth.toml
|
|
7
|
+
|
|
8
|
+
media/*
|
|
9
|
+
media/
|
|
10
|
+
mediafiles/
|
|
11
|
+
mediafiles/*
|
|
12
|
+
test/*
|
|
13
|
+
staticfiles/*
|
|
14
|
+
staticfiles/
|
|
15
|
+
#
|
|
16
|
+
# Byte-compiled / optimized / DLL files
|
|
17
|
+
__pycache__/
|
|
18
|
+
*.py[cod]
|
|
19
|
+
*$py.class
|
|
20
|
+
|
|
21
|
+
# C extensions
|
|
22
|
+
*.so
|
|
23
|
+
|
|
24
|
+
# Distribution / packaging
|
|
25
|
+
.Python
|
|
26
|
+
build/
|
|
27
|
+
develop-eggs/
|
|
28
|
+
dist/
|
|
29
|
+
info/
|
|
30
|
+
downloads/
|
|
31
|
+
eggs/
|
|
32
|
+
.eggs/
|
|
33
|
+
lib/
|
|
34
|
+
lib64/
|
|
35
|
+
parts/
|
|
36
|
+
sdist/
|
|
37
|
+
var/
|
|
38
|
+
wheels/
|
|
39
|
+
share/python-wheels/
|
|
40
|
+
*.egg-info/
|
|
41
|
+
.installed.cfg
|
|
42
|
+
*.egg
|
|
43
|
+
MANIFEST
|
|
44
|
+
|
|
45
|
+
# PyInstaller
|
|
46
|
+
# Usually these files are written by a python script from a template
|
|
47
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
48
|
+
*.manifest
|
|
49
|
+
*.spec
|
|
50
|
+
|
|
51
|
+
# Installer logs
|
|
52
|
+
pip-log.txt
|
|
53
|
+
pip-delete-this-directory.txt
|
|
54
|
+
|
|
55
|
+
# Unit test / coverage reports
|
|
56
|
+
htmlcov/
|
|
57
|
+
.tox/
|
|
58
|
+
.nox/
|
|
59
|
+
.coverage
|
|
60
|
+
.coverage.*
|
|
61
|
+
.cache
|
|
62
|
+
.dccache
|
|
63
|
+
nosetests.xml
|
|
64
|
+
coverage.xml
|
|
65
|
+
*.cover
|
|
66
|
+
*.py,cover
|
|
67
|
+
.hypothesis/
|
|
68
|
+
.pytest_cache/
|
|
69
|
+
cover/
|
|
70
|
+
report.xml
|
|
71
|
+
*/report.xml
|
|
72
|
+
|
|
73
|
+
# Translations
|
|
74
|
+
*.mo
|
|
75
|
+
*.pot
|
|
76
|
+
|
|
77
|
+
# Django stuff:
|
|
78
|
+
*.log
|
|
79
|
+
local_settings.py
|
|
80
|
+
*.sqlite3
|
|
81
|
+
db.sqlite3-journal
|
|
82
|
+
|
|
83
|
+
# Flask stuff:
|
|
84
|
+
instance/
|
|
85
|
+
.webassets-cache
|
|
86
|
+
|
|
87
|
+
# Scrapy stuff:
|
|
88
|
+
.scrapy
|
|
89
|
+
|
|
90
|
+
# Sphinx documentation
|
|
91
|
+
docs/_build/
|
|
92
|
+
|
|
93
|
+
# PyBuilder
|
|
94
|
+
.pybuilder/
|
|
95
|
+
target/
|
|
96
|
+
|
|
97
|
+
# Jupyter Notebook
|
|
98
|
+
.ipynb_checkpoints
|
|
99
|
+
*.ipynb
|
|
100
|
+
# IPython
|
|
101
|
+
profile_default/
|
|
102
|
+
ipython_config.py
|
|
103
|
+
|
|
104
|
+
# pyenv
|
|
105
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
106
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
107
|
+
# .python-version
|
|
108
|
+
|
|
109
|
+
# pipenv
|
|
110
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
111
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
112
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
113
|
+
# install all needed dependencies.
|
|
114
|
+
#Pipfile.lock
|
|
115
|
+
|
|
116
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
117
|
+
__pypackages__/
|
|
118
|
+
|
|
119
|
+
# Celery stuff
|
|
120
|
+
celerybeat-schedule
|
|
121
|
+
celerybeat.pid
|
|
122
|
+
|
|
123
|
+
# SageMath parsed files
|
|
124
|
+
*.sage.py
|
|
125
|
+
|
|
126
|
+
# Environments
|
|
127
|
+
.env
|
|
128
|
+
.envrc
|
|
129
|
+
.venv
|
|
130
|
+
env/
|
|
131
|
+
venv/
|
|
132
|
+
ENV/
|
|
133
|
+
env.bak/
|
|
134
|
+
venv.bak/
|
|
135
|
+
.vscode/
|
|
136
|
+
.idea/
|
|
137
|
+
.idea.bkp/
|
|
138
|
+
|
|
139
|
+
# Spyder project settings
|
|
140
|
+
.spyderproject
|
|
141
|
+
.spyproject
|
|
142
|
+
|
|
143
|
+
# Rope project settings
|
|
144
|
+
.ropeproject
|
|
145
|
+
|
|
146
|
+
# mkdocs documentation
|
|
147
|
+
/site
|
|
148
|
+
|
|
149
|
+
# mypy
|
|
150
|
+
.mypy_cache/
|
|
151
|
+
.dmypy.json
|
|
152
|
+
dmypy.json
|
|
153
|
+
|
|
154
|
+
# Pyre type checker
|
|
155
|
+
.pyre/
|
|
156
|
+
|
|
157
|
+
# pytype static type analyzer
|
|
158
|
+
.pytype/
|
|
159
|
+
crm/
|
|
160
|
+
# Cython debug symbols
|
|
161
|
+
cython_debug/
|
|
162
|
+
|
|
163
|
+
# Gitlab Runner
|
|
164
|
+
builds
|
|
165
|
+
builds/
|
|
166
|
+
|
|
167
|
+
# Integrator Office 365 : reverse proxy tunnel for outlook365
|
|
168
|
+
ngrok
|
|
169
|
+
*/ngrok
|
|
170
|
+
/modules/**/system/
|
|
171
|
+
|
|
172
|
+
/modules/wbmailing/files/*
|
|
173
|
+
/modules/wbmailing/mailing/*
|
|
174
|
+
|
|
175
|
+
/projects/*/requirements.txt
|
|
176
|
+
public
|
|
177
|
+
|
|
178
|
+
# Ignore archive localization generated folder
|
|
179
|
+
backend/modules/**/archive/*
|
|
180
|
+
**/**/requirements.txt
|
|
181
|
+
CHANGELOG-*
|
wbnews-2.2.1/PKG-INFO
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "wbnews"
|
|
3
|
+
description = "A workbench module for managing news."
|
|
4
|
+
authors = [{ name = "Christopher Wittlinger", email = "c.wittlinger@stainly.com"}]
|
|
5
|
+
dynamic = ["version"]
|
|
6
|
+
|
|
7
|
+
dependencies = [
|
|
8
|
+
"wbcore",
|
|
9
|
+
"feedparser == 6.*",
|
|
10
|
+
"langdetect == 1.*",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[tool.uv.sources]
|
|
14
|
+
wbcore = { workspace = true }
|
|
15
|
+
|
|
16
|
+
[tool.uv]
|
|
17
|
+
package = true
|
|
18
|
+
|
|
19
|
+
[tool.hatch.version]
|
|
20
|
+
path = "../../pyproject.toml"
|
|
21
|
+
|
|
22
|
+
[tool.hatch.build.targets.sdist]
|
|
23
|
+
include = ["wbnews/*"]
|
|
24
|
+
|
|
25
|
+
[tool.hatch.build.targets.wheel]
|
|
26
|
+
packages = ["wbnews"]
|
|
27
|
+
only-packages = true
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
requires = ["hatchling"]
|
|
31
|
+
build-backend = "hatchling.build"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
[report]
|
|
2
|
+
exclude_lines =
|
|
3
|
+
print()
|
|
4
|
+
def api_endpoints_root
|
|
5
|
+
def get_or_create_model_sql
|
|
6
|
+
def profile_check
|
|
7
|
+
if hasattr
|
|
8
|
+
raise Exception
|
|
9
|
+
raise Http404
|
|
10
|
+
except:
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
[run]
|
|
14
|
+
omit = */migrations/*
|
|
15
|
+
manage.py
|
|
16
|
+
*/tests/*
|
|
17
|
+
*/wbnews_config/*
|
|
18
|
+
*/apps.py
|
|
19
|
+
*/docs/*
|
|
20
|
+
*/dynamic_preferences_registry.py
|
|
21
|
+
*/permissions.py
|
|
22
|
+
*/preferences/*
|
|
23
|
+
*/.venv/*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.0.0"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from django.contrib import admin
|
|
2
|
+
|
|
3
|
+
from .models import News, NewsRelationship, NewsSource
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@admin.register(NewsRelationship)
|
|
7
|
+
class NewsRelationshipAdmin(admin.ModelAdmin):
|
|
8
|
+
list_display = ["news", "content_object"]
|
|
9
|
+
autocomplete_fields = ["news"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@admin.register(News)
|
|
13
|
+
class NewsAdmin(admin.ModelAdmin):
|
|
14
|
+
search_fields = ("title", "description")
|
|
15
|
+
raw_id_fields = ["import_source"]
|
|
16
|
+
autocomplete_fields = [
|
|
17
|
+
"source",
|
|
18
|
+
]
|
|
19
|
+
list_display = ["title", "language", "tags", "source", "datetime"]
|
|
20
|
+
|
|
21
|
+
list_filter = ("source",)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@admin.register(NewsSource)
|
|
25
|
+
class NewsSourceAdmin(admin.ModelAdmin):
|
|
26
|
+
search_fields = ("type", "title", "identifier", "description", "author", "url")
|
|
27
|
+
list_filter = ("type",)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import factory
|
|
2
|
+
from django.conf.global_settings import LANGUAGES
|
|
3
|
+
from django.utils import timezone
|
|
4
|
+
from faker import Factory
|
|
5
|
+
from wbnews.models import News, NewsSource
|
|
6
|
+
|
|
7
|
+
langs = [n for (n, v) in LANGUAGES]
|
|
8
|
+
faker = Factory.create()
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class NewsSourceFactory(factory.django.DjangoModelFactory):
|
|
12
|
+
title = factory.Sequence(lambda n: f"source_{n}")
|
|
13
|
+
identifier = factory.Sequence(lambda n: f"http://myurl_{n}.com")
|
|
14
|
+
image = faker.url()
|
|
15
|
+
description = factory.Faker("sentence", nb_words=32)
|
|
16
|
+
author = faker.name()
|
|
17
|
+
url = factory.Faker("url")
|
|
18
|
+
|
|
19
|
+
class Meta:
|
|
20
|
+
model = NewsSource
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class NewsFactory(factory.django.DjangoModelFactory):
|
|
24
|
+
datetime = factory.LazyFunction(timezone.now)
|
|
25
|
+
title = factory.Sequence(lambda n: f"news_{n}")
|
|
26
|
+
description = factory.Faker("sentence", nb_words=32)
|
|
27
|
+
summary = factory.Faker("sentence", nb_words=32)
|
|
28
|
+
language = factory.Iterator(langs)
|
|
29
|
+
link = faker.url()
|
|
30
|
+
source = factory.SubFactory(NewsSourceFactory)
|
|
31
|
+
|
|
32
|
+
class Meta:
|
|
33
|
+
model = News
|