Commit Graph
61 Commits
Author SHA1 Message Date
retoor 0d7ff2a0d1 fix: correct typo in devRant community string and remove image show call
- Fix spelling of "community" in the mention count output string
- Remove the redundant `new_image.show()` call at the end of merge_images.py
2024-12-03 03:34:56 +00:00
retoor 522465e0f8 fix: increase timeout from 5 to 15 seconds for executor call in get_recent_rants
The timeout passed to asyncio.wait_for for the run_in_executor call fetching rants was raised to 15 seconds to accommodate slower responses from the underlying dr.get_rants API call.
2024-12-03 03:31:21 +00:00
retoor 95e266c7cb fix: pass explicit None executor to run_in_executor for get_rants call
The diff shows a single change in `src/drstats/sync.py` where `loop.run_in_executor(get_rants)` is corrected to `loop.run_in_executor(None, get_rants)`, adding the required `None` argument for the executor parameter to match the asyncio API signature.
2024-12-03 03:31:06 +00:00
retoor 13bcd5d6af fix: add missing GROUP BY clause to rants_of_user and posts_of_user views
The rants_of_user and posts_of_user views were missing a GROUP BY clause on the username column, causing the GROUP_CONCAT aggregations to produce incorrect concatenated results across all rows instead of per-user groupings. This fix adds the required GROUP BY username to both view definitions, ensuring each user's rants and comments are properly aggregated into separate rows.
2024-12-03 03:21:25 +00:00
retoor 3c2b2e192a chore: update trigger timestamp in .gitignore from November to December 2024 2024-12-03 03:21:11 +00:00
retoor 5bdc1c177f chore: add git pull step before listing files in build and export workflows 2024-12-03 03:06:22 +00:00
retoor bbb7928d09 ci: add gitea build workflow and rename export workflow to scheduled with cron trigger 2024-12-02 21:26:17 +00:00
retoor 3821afacc9 feat: add cron schedule trigger every 30 minutes to export workflow
The workflow previously only triggered on push events. This change adds a
scheduled trigger using a cron expression that runs every 30 minutes,
enabling periodic execution of the export statistics job independently
of code pushes.
2024-12-02 21:23:50 +00:00
retoor f2547b6d3e chore: update trigger timestamp in .gitignore to 2024-11-29
The trigger file timestamp in .gitignore was updated from 2024-11-27 to 2024-11-29
to force a fresh build cycle on the CI pipeline.
2024-12-01 08:24:01 +00:00
retoor 56f9d2b6d9 chore: update trigger timestamp in .gitignore from 2024-11-25 to 2024-11-27 2024-11-28 04:00:02 +00:00
retoor 736913d9ff feat: update drstats dataset with 102 active users and 2557 total contributions
- Increment active user count from 101 to 102 and total contributions from 2550 to 2557 in export/0_dataset.txt
- Refresh all export graphs (comments per day/hour/weekday, score per user/period) with data spanning 2024-11-07 to 2024-11-23
- Update view-comment_stats_per_hour.json with adjusted counts for hours 10, 11, 13, 14
- Rebuild dist/drstats-1.3.37 wheel and tarball, and update drstats.db binary
2024-11-26 17:42:48 +00:00
retoor 3853d78c6b fix: correct typo in Makefile export_stats echo message from 'statisticts' to 'statistics' 2024-11-26 17:15:45 +00:00
retoor 7f19248052 chore: remove deprecated sync_excempt target and switch export_stats to dr.stats
- Delete the sync_excempt Makefile target that was stubbed with a timeout warning
- Change export_stats to call dr.stats instead of dr.stats_all
- Remove extraneous blank lines in Makefile for cleaner formatting
2024-11-26 08:28:21 +00:00
retoor 35a3139428 style: remove unnecessary parentheses and trailing whitespace across multiple drstats modules 2024-11-26 08:22:24 +00:00
retoor 73a1aa168b chore: fix typo in README link text and consolidate drstats CLI entry points 2024-11-26 08:21:46 +00:00
retoor 224d073542 chore: add timestamped trigger file to .gitignore for build automation 2024-11-26 02:49:51 +00:00
retoor 18706742ae docs: promote heading levels in readme analysis sections from h5/h4 to h4/h3 2024-11-25 22:43:21 +00:00
retoor 9120544080 docs: replace vague section heading with precise description of AI-generated user summary in README 2024-11-25 22:42:42 +00:00
retoor 03ac8d3bf1 fix: remove stray backtick from README code block marker in setup instructions 2024-11-25 22:41:34 +00:00
retoor 3488ce4d66 docs: add per-user statistics section for user neo to README
This commit extends the README with a detailed analysis of a specific user (neo), including rank, contributions, ownership metrics, upvote statistics, and post length data. The new section provides anonymized insights into individual user behavior within the forum dataset, complementing the existing community-level statistics.
2024-11-25 22:39:25 +00:00
retoor 73fe85cf6f docs: update README with AI-generated statistics summary and dataset description 2024-11-25 22:32:09 +00:00
retoor 95d7c2cb78 feat: rename rank_appreciation column to rank_by_appreciation_based_on_upvotes_per_message in contributions_extended_ranked view and update dataset.py dump function to use new column name 2024-11-25 21:35:16 +00:00
retoor 1dad2d804a fix: rename rank column to rank_appreciation in contributions_extended_ranked view and update dataset.py reference
Rename the popularity rank column from 'rank' to 'rank_appreciation' in the SQL view
contributions_extended_ranked to make its meaning clearer. Update the corresponding
reference in dataset.py's statistics text generation to use the new column name.
2024-11-25 21:31:20 +00:00
retoor 600ed88efc feat: rename upvote_ratio column to upvotes_per_post_on_average in contributions_extended view
Update the SQL view definition to replace the ambiguous `upvote_ratio` column name with the more descriptive `upvotes_per_post_on_average`, and update the ranked view to order by the new column name instead of the old one.
2024-11-25 20:24:06 +00:00
retoor a03c6eb774 chore: prefix pip and python commands with venv path in Makefile build target 2024-11-25 19:50:20 +00:00
retoor 66155ce6a6 chore: bump package version to 1.3.37 and declare runtime dependencies in PKG-INFO
Update PKG-INFO metadata to remove UNKNOWN placeholders for Home-page and Platform fields, and add explicit Requires-Dist entries for aiohttp, dataset, matplotlib, and requests. Also trim trailing blank lines from the description section.
2024-11-25 19:48:02 +00:00
retoor f816a73efa chore: add ensure_env target to Makefile for automatic venv creation 2024-11-25 19:47:34 +00:00
retoor 2f3a4431b6 fix: re-add sync target to Makefile all and fix asyncio loop reference in get_recent_rants
The Makefile's `all` target was missing the `sync` step, which has now been restored alongside a fix in `src/drstats/sync.py` where `asyncio.wait_for` incorrectly called `asyncio.run_in_executor` instead of the proper `loop.run_in_executor` to avoid event loop context errors during async execution.
2024-11-25 19:44:33 +00:00
retoor a6fd640e92 feat: make get_recent_rants async by wrapping dr.get_rants in run_in_executor with 5s timeout 2024-11-25 19:39:06 +00:00
retoor c32c59dd2a fix: restore accidentally deleted __main__ and __init__ module files
The __main__.py and __init__.py files were inadvertently removed during a previous cleanup operation. This commit restores both files to their original state, ensuring the package can be properly executed as a module and imported as a package.
2024-11-25 19:28:59 +00:00
retoor 5025647f04 chore: remove stale pycache files and add asyncio timeout to sync loop
Remove all compiled Python cache files from the drstats package directory to prevent stale bytecode issues. Refactor the sync_rants function by extracting the rant processing logic into a private _sync_rants helper and wrap it with asyncio.wait_for using a 5-second timeout to handle rate-limited API responses gracefully, breaking the loop on timeout exceptions.
2024-11-25 19:27:39 +00:00
retoor 2657c83053 fix: handle missing comments key when syncing rants with no comments
The previous code assumed every rant returned from the API would have a "comments" key, causing a KeyError crash when iterating over rants that had zero comments. This fix uses `.get("comments", [])` to safely default to an empty list, allowing the sync loop to continue without interruption.
2024-11-25 19:19:22 +00:00
retoor ed190ec774 fix: prefix dr.sync, dr.stats_all, dr.dataset, and merge_images.py with ./venv/bin/ in Makefile targets 2024-11-25 19:15:31 +00:00
retoor 8f86fc8112 fix: correct dataset dump and db queries to handle multiple user records 2024-11-24 07:39:56 +00:00
retoor b5103f45f1 fix: remove newline and whitespace stripping from user rants and posts in dataset dump 2024-11-24 07:10:21 +00:00
retoor 27a6409c09 feat: add initial export of devRant statistics, mentions, posts, and contributions data
Add raw query results for user contributions, mention counts, individual user posts, and view-comment statistics exported as text and JSON files under the export/ directory.
2024-11-24 07:02:48 +00:00
retoor 04e61f8a56 feat: add raw query results to json export for each view using new Db context manager 2024-11-24 07:02:32 +00:00
retoor c59085db6a fix: correct indentation of view export loop inside dump function 2024-11-24 06:38:33 +00:00
retoor 7ec7ae8646 feat: add view export functionality and refactor contributions query to use named view
Introduce a new `get_views()` function in db.py that queries the sqlite_schema for user-defined views, and add a loop in dataset.py to export each view's query results as a JSON file. Also create a persistent `contributions_extended_ranked` view to replace the inline subquery in `get_contributions()`, and refactor `get_users()` to use a direct DISTINCT query instead of deduplicating in Python.
2024-11-24 06:38:17 +00:00
retoor e5e5dd3aca fix: correct f.write argument in dataset.py dump function to close code block properly 2024-11-24 06:17:50 +00:00
retoor 7040fe5797 fix: correct string concatenation in dataset.py write calls for user and text 2024-11-24 06:16:36 +00:00
retoor 1414d1e116 fix: add missing commas in print and f.write calls for dataset export formatting 2024-11-24 06:15:17 +00:00
retoor 31b792bde2 feat: add rank column to user stats and format score with commas in display
Implement rank calculation based on total score ordering and format score values with thousands separator for improved readability in the user statistics view.
2024-11-24 06:13:53 +00:00
retoor 9497cde9c8 feat: add export_statistics and export_mentions make targets with dataset prefix markers
Add two new Makefile targets for exporting statistics and mentions data from the dataset file, each prefixed with "===" markers in the dataset.py dump function to enable clean grep extraction. The export_statistics target filters lines containing "Statistics:" while export_mentions filters lines containing "times ment", both writing results to separate export files.
2024-11-24 06:09:50 +00:00
retoor cdc8c1a0c2 docs: rewrite README to replace outdated ML dataset reference with retoor9b hype and reorder build server explanation 2024-11-23 20:11:28 +00:00
retoor b4c969e62a chore: remove clean step from all target and update dataset export path in readme
The clean step was removed from the default build pipeline to preserve historic statistics across builds, as deleted data still consumes git storage. Additionally, the dataset export filename was changed from dataset.txt to 0_dataset.txt, and the corresponding link in the README was updated to reflect this new path.
2024-11-23 20:05:45 +00:00
retoor dbe9b4184d docs: add generated statistics dataset and graphs to README with build server links 2024-11-23 19:48:43 +00:00
retoor d95f215975 fix: configure git user email and name before commit in export workflow 2024-11-23 19:36:40 +00:00
retoor c84e34be26 chore: pin dependency versions and add requests library to setup.cfg and egg-info 2024-11-23 19:29:56 +00:00
retoor e039dae62b chore: remove build output redirection to file in export workflow
The CI export workflow previously redirected `make` output to `build_output.txt`.
This change removes the file redirection, allowing build output to flow directly
to the job's standard output stream.
2024-11-23 19:22:22 +00:00
retoor 7177c356f2 fix: normalize SQL formatting and remove duplicate DROP VIEW in user_stats view creation 2024-11-23 19:20:16 +00:00
retoor 513dbaf095 chore: remove time prefix from pip install and dr commands in Makefile targets 2024-11-23 19:18:21 +00:00
retoor 9b195fcb48 style: fix whitespace formatting and trailing newlines across multiple Python files 2024-11-23 19:17:01 +00:00
retoor 8b259cc39c chore: redirect make output to build_output.txt and auto-commit export results 2024-11-23 19:09:06 +00:00
retoor 26d883e0cb feat: add CI workflow, clean target, and fix user_stats view with deduplicated columns
Add .gitea/workflows/export.yaml for automated build on push, introduce `clean` target in Makefile to recreate export directory, remove stale `dump_text.py` from SOURCES.txt, and correct duplicate column definitions in the `user_stats` SQL view creation inside db.py.
2024-11-23 19:07:19 +00:00
retoor 768477df2a feat: add merge_images script, dataset module, and rename dr.rant_stats_all to dr.stats_all
Add new merge_images.py script that compiles all exported PNG graphs into a single composite image with 2-column layout and 480x320 per-image sizing. Introduce drstats/dataset.py with dump() function that outputs per-user contribution statistics and all rants/posts for LLM embedding. Rename the console script entry point from dr.rant_stats_all to dr.stats_all across setup.cfg, entry_points.txt, README.md, and PKG-INFO. Update Makefile to replace sync with sync_excempt target, add merge_images target, and add prerequisite reminders for export targets. Refactor db.py view creation queries to use compact string formatting. Redirect Duration class timing output and dataset.py printr calls to stderr.
2024-11-23 18:56:52 +00:00
retoor d1594ed798 feat: add dataset export command and contributions views with user stats aggregation
Add dr.dataset console script entry point and implement dump function in new dataset module. Create SQL views for contributions, contributions_extended, rants_of_user, and posts_of_user in db.py to aggregate user activity metrics. Update Makefile with sync, export_stats, and export_dataset targets. Add timeout parameter to HTTP requests in devrant.py and remove demo code. Extend README with usage instructions for environment setup and available dr.* commands.
2024-11-23 18:56:52 +00:00
retoor 507a8dcaeb feat: add dr.rant_stats_all command and comment/score views to database schema 2024-11-23 18:56:52 +00:00
retoor 12a93eccb5 chore: add credits section to README and replace pirant dependency with matplotlib
- Add credits section acknowledging Rohan Burke (coolq) for the devrant API wrapper
- Remove pirant dependency from setup.cfg and add matplotlib>=3.9.2
- Add new console scripts for sync and per-day/weekday/hour statistics
- Add new source files: db.py, devrant.py, sync.py, and updated statistics.py
- Include binary database file drstats.db and compiled Python cache files
2024-11-23 18:56:52 +00:00
retoor 0ad7c0cf51 chore: add dataset and pirant dependencies, rename console script entry point to dr.rant_stats
Add dataset>=1.6.2 and pirant>=0.1.4.dev1 (via git URL) to install_requires in setup.cfg.
Rename the console_scripts entry point from 'utro = drstats.statistics:rant_stats' to 'dr.rant_stats = drstats.statistics:rant_stats'.
Update egg-info metadata files (PKG-INFO, requires.txt, entry_points.txt, SOURCES.txt, top_level.txt) to reflect new dependencies and package structure.
2024-11-23 18:56:52 +00:00
retoor c32565621d feat: scaffold drstats project with setuptools build, gitignore, and utro CLI entry point
Initialize the dRStats repository with core project structure: add .gitignore excluding dist and venv directories, create Makefile for pip-based build and editable install, write README.md describing the devrant health monitoring purpose, define pyproject.toml using setuptools build backend, configure setup.cfg with metadata (name drstats, version 0.1.1, MIT license, aiohttp dependency) and console_scripts entry point mapping 'utro' to drstats.statistics:rant_stats, and include generated egg-info metadata files.
2024-11-23 18:56:52 +00:00