{"id":25506719,"url":"https://github.com/toxdes/python-scripts","last_synced_at":"2025-11-17T11:30:16.349Z","repository":{"id":144104237,"uuid":"254793646","full_name":"toxdes/python-scripts","owner":"toxdes","description":"some helper scripts I've written for day to day use.","archived":false,"fork":false,"pushed_at":"2024-02-13T09:10:33.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-02-13T10:27:07.629Z","etag":null,"topics":["python","python-scripts","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","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/toxdes.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}},"created_at":"2020-04-11T04:37:52.000Z","updated_at":"2024-02-13T10:27:12.956Z","dependencies_parsed_at":"2024-02-13T10:27:11.846Z","dependency_job_id":"a25ab728-7e27-4e7a-99a0-4822f26e18fa","html_url":"https://github.com/toxdes/python-scripts","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/toxdes%2Fpython-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxdes%2Fpython-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxdes%2Fpython-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/toxdes%2Fpython-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/toxdes","download_url":"https://codeload.github.com/toxdes/python-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239611999,"owners_count":19668275,"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":["python","python-scripts","python3"],"created_at":"2025-02-19T06:59:23.403Z","updated_at":"2025-11-17T11:30:16.296Z","avatar_url":"https://github.com/toxdes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Scripts\n\nThese repository contains some helper scripts I've written for day to day use. This was part of dotfiles repo before, now it's a different repo, cause why not?\n\nMost stuff can be done with bash scripts, but it was way to difficult for me to run, and also my love for python.\n\nMost files here are aliased conveniently in the [`aliasrc`](https://github.com/toxdes/dotfiles/blob/master/config-files/ALIASRC) of the dotfiles repo, to make them actually usable.\n\nThis repo also contains some `bash` files, cause they're super simple _and_ useful.\n\n# Content\n\n### 1. `youtube.py`\n\nHelper script on top of `youtube-dl` to make downloading way easier.\nRequires `xclipboard`.\n\n```shell\nusage: youtube.py [-h] [-c] [-p] [-q {240p,360p,480p,720p,1080p,1440p}] [-a] [-o OUTPUT_DIR] [-r] [-i] [-e] [-t]\n\nHelper Script for youtube-dl.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c                    Get video link from clipboard.\n  -p                    Treat the link as if it is a playlist.\n  -q {240p,360p,480p,720p,1080p,1440p}\n                        Default is 360p\n  -a                    Download best quality audio only.\n  -o OUTPUT_DIR         Default is current directory.\n  -r                    Do not download, just output the generated command only.\n  -i                    Print list of available formats to download.\n  -e                    Use aria2c as the external downloader\n  -t                    Custom script for twitch\n```\n\n##### Examples\n\n```shell\n$ yt -cq 720p # video\n$ yt -cap # mp3 songs playlist\n$ yt -cpq 480p # downloading lectures playlist\n$ yt -rcpq 1080p # debug, check if the command is okay\n$ yt -tcq 360p # twitch vod\n```\n\n### 2. `cc.py` and `cparser`\n\nFor compiling `C` and `C++` files, this was created when I was unaware of makefiles, but it's handy while testing `C` or `C++` code snippets.\nAlso included `prep` subcommand that takes / asks for a directory name, and optionally takes `-f` argument.\n\n_All scripts are aliased conveniently in [`aliasrc`](https://github.com/toxdes/dotfiles/blob/master/config-files/ALIASRC)._\n\n`prep` command does the following:\n\n1. Ask for `dir_name` if not provided in args.\n2. Create a new dir named `dir_name`.\n3. If `-f` was provided then create 6 empty files in the newly created directory, namely `A.cpp, B.cpp, ..., F.cpp`, otherwise skip this step.\n4. Copy `bits/stdc++.h` from the user's machine, to the newly created directory as `bits/stdc++.h`. This is useful, because it used to take 7ish seconds to compile each C++ file since my laptop is slow. Now, we precompile this header, so that each individual C++ file uses this header compiles in 1-2ish seconds. Huge time saved!\n5. Compile the locally copied `bits/stdc++.h` header.\n6. Done!\n\nNowadays, I use it a lot (especially the `prep` subcommand).\n\n#### Notes for cparser\n\n`server.py` listens to POST requests to a specified port, the competitive\ncompanion browser extension posts parsed problems to this endpoint,\nand creates a `samples` directory, for each testcase.\n\n`run.py` compiles and runs the program against the parsed sample test\ncases.\n\n`run.py custom` compiles, and runs against user input.\n\n`server.py` is used as a daemon process, in the background so it's\naliased as `cphd`.\n\n`run.py` is used as a script, so it's aliased as `cpr`.\n\n##### Examples\n\n```shell\n$ c test_pointers.c # Compile and run C file\n$ cpp wow.cpp # Compile and run C++ file\n$ prep abc175 # do steps menotioned above.\n```\n\n### 3. `days.py`\n\nFor counting timespan, given the start-date. Handy to use when I have to find quickly time elapsed since some date, e.g. birthday.\n\n##### Examples\n\n```shell\n$ days #gives time elapsed since predefined date\n$ days \u003canything\u003e # asks for a date, gives age\n```\n\n### 4. `attempts.py`\n\nCreated this when I was preparing for GATE. After each mock test, running this script would ask me details about the attempted, correct questions etc, what went wrong, and how would I improve etc. and save it as a text file.\n\n`read` argument would list all such entries, which could be opened in the terminal right away.\n\n##### Examples\n\n```shell\n$ attempts read # lists all attempts\n$ attempts # create a new attempt, interactive\n```\n\n### 5. `nconvert.py`\n\nFor converting numbers to and from different number systems. This script was handy for GATE preparation as well, to check if my conversions are correct.\n\n##### Examples\n\n```shell\n$ nums # interactive\nBase : 16 # enter base\nNumber : ffc # number\nDecimal:4092 # results\nBinary:0b111111111100\nOctal:0o7774\nHex:0xffc\n\n```\n\n### 6. `googler.py`\n\nThis was created when I was unaware of DuckDuckGo's Bangs. Functionality is same, most used sites by me are included. Wanted to use terminal binary `googler`, but I guess it turned out to be inconvenient, so now links are opened in browser instead.\n\nI don't use it anymore because of DuckDuckGo, so no examples for this.\n\n### 7. `imports.py`\n\nThis is just because I wanted to avoid writing `import math`, everytime I wanted to use python as a calculator.\n\n##### Examples\n\n```shell\n$ pc # imports mostly used modules\n\u003e\u003e\u003e log(10,2) # and starts this interactive shell\n3.3219280948873626\n\u003e\u003e\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoxdes%2Fpython-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftoxdes%2Fpython-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftoxdes%2Fpython-scripts/lists"}