{"id":18360614,"url":"https://github.com/samasaur1/ao3stats","last_synced_at":"2025-04-10T03:36:52.713Z","repository":{"id":96638852,"uuid":"583982271","full_name":"Samasaur1/ao3stats","owner":"Samasaur1","description":"Scrape your history from AO3, and then get some statistics from that data.","archived":false,"fork":false,"pushed_at":"2025-02-18T09:10:43.000Z","size":104,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T02:59:51.486Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Samasaur1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-31T18:53:32.000Z","updated_at":"2025-03-13T17:24:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"9e793ea9-286d-44aa-9e7c-175c03a6f06c","html_url":"https://github.com/Samasaur1/ao3stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samasaur1%2Fao3stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samasaur1%2Fao3stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samasaur1%2Fao3stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Samasaur1%2Fao3stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Samasaur1","download_url":"https://codeload.github.com/Samasaur1/ao3stats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248153628,"owners_count":21056471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T22:29:07.119Z","updated_at":"2025-04-10T03:36:52.689Z","avatar_url":"https://github.com/Samasaur1.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ao3stats\n\nScrape your history from AO3, and then get some statistics from that data.\n\nThis repository is packaged with the [Nix package manager](https://nix.dev/), so if you have it installed, you can simply run\n\n```\nnix run github:Samasaur1/ao3stats#scrape\nnix run github:Samasaur1/ao3stats#stats\n```\n\nFor other installation instructions, see below.\n\n## General Overview\n\n### Requirements\n\nao3stats requires Python 3.10 or later, Swift 5.5 or later, and an internet connection.\n\n### Structure\n\nao3stats is split into two component projects: a Python project that scrapes your history from AO3, and a Swift project that takes the output data and outputs a summary of statistics.\n\n## Setup\n\n1. Clone or download the repository: `git clone https://github.com/Samasaur1/ao3stats` works, or you can click \"Code\" and then \"Download as ZIP\" from the GitHub page\n2. Open a terminal in the cloned/downloaded folder. On macOS, Terminal.app comes preinstalled; on Windows, I believe you'd use PowerShell or the command prompt; and on Linux, I assume you know what you're doing.\n3. Run the following (instructions are for macOS/Linux; Windows instructions will be slightly different):\n\n    ```\n    python3 -m venv .\n    source bin/activate\n    python3 -m pip install tqdm requests beautifulsoup4\n    ```\n\n4. (Optional, for calculating stats).\n\n    Run the following instructions (again, instructions are for macOS/Linux):\n\n    ```\n    cd display\n    swift build -c release\n    cd ..\n    ln -s display/.build/release/display stats\n    ```\n\n## Running the program(s)\n\nOpen a terminal in the cloned/downloaded folder (if you are running the program immediately after setting it up, you can use the same terminal).\n\nWhen you ran `source bin/activate`, the prompt should have changed to say `(ao3stats)` before whatever it was. If your current prompt looks like that, you are \"in the virtual environment.\" If it doesn't look that way, you are not in the virtual environment (if you are running the program immediately after setting it up, you should be in the virtual environment).\n\nIf you aren't in the virtual environment, run `source bin/activate` in the terminal, and you now should be.\n\nNow you can do the following:\n\n1. Run the following command: `python3 main.py` and put in your username and password when asked\n2. Wait for the program to finish (it should tell you how many deleted works were in your history)\n3. There is now a file called `works.json` in the folder. This is your AO3 data, but not yet a summary\n4. Run `./stats`. It should output a summary of your AO3 history\n\n### Options to `./stats`\n\nBy default, running `./stats` with no arguments produces a summary on a file named `works.json` in the current folder. If you want, you can generate statistics for an old data dump by putting the name of that file as the first argument (e.g., `./stats old-works.json`).\n\nYou can also get specific stats on an author and/or a fandom. For example: `./stats --fandom \"GitHub\"` or `./stats --author \"Octocat\"`.\n\n## Using `jq` to dump the works database\n\nIf you can't or don't want to build the program that calculates stats, you can inspect the `works.json` file manually. [`jq`](https://jqlang.github.io/jq/) is a great tool for working with JSON, and you can try examples such as these:\n\n```\njp '.' works.json\njq '. | map(select(.authors[0] == \"Samasaur1\"))' works.json\njq '. | map(select(.changes_since_last_view != \"Latest version.\"))' works.json\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamasaur1%2Fao3stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamasaur1%2Fao3stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamasaur1%2Fao3stats/lists"}