{"id":23114008,"url":"https://github.com/astrokin/honk","last_synced_at":"2025-10-07T05:44:24.742Z","repository":{"id":225904148,"uuid":"767186676","full_name":"astrokin/honk","owner":"astrokin","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-04T21:17:53.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T12:27:45.691Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astrokin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-03-04T21:16:20.000Z","updated_at":"2024-03-04T21:16:25.000Z","dependencies_parsed_at":"2024-03-04T22:44:40.078Z","dependency_job_id":null,"html_url":"https://github.com/astrokin/honk","commit_stats":null,"previous_names":["astrokin/honk"],"tags_count":0,"template":false,"template_full_name":"duneanalytics/DuneQueryRepo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrokin%2Fhonk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrokin%2Fhonk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrokin%2Fhonk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astrokin%2Fhonk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astrokin","download_url":"https://codeload.github.com/astrokin/honk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247100957,"owners_count":20883685,"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-12-17T03:17:57.056Z","updated_at":"2025-10-07T05:44:19.702Z","avatar_url":"https://github.com/astrokin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dune Query Repo\n\nA template for creating repos to [manage your Dune queries](https://dune.mintlify.app/api-reference/crud/endpoint/create) and any [CSVs as Dune tables](https://dune.mintlify.app/api-reference/upload/endpoint/upload).\n\n### Setup Your Repo\n\n1. Generate an API key from your Dune account and put that in both your `.env` file and [github action secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) (name it `DUNE_API_KEY`). You can create a key under your Dune team settings. *The api key must be from a plus plan for this repo to work.*\n\n2. Type your intended query ids into the `queries.yml` file. The id can be found from the link `https://dune.com/queries/\u003cquery_id\u003e/...`. If you're creating this for a dashboard, go to the dashboard you want to create a repo and click on the \"github\" button in the top right of your dashboard to see the query ids.\n\n3. Then, run `pull_from_dune.py` to bring in all queries into `/query_{id}.sql` files within the `/queries` folder. Directions to setup and run this python script are below.\n\n### Updating Queries or CSV Tables\n\n1. Make any changes you need to directly in the repo. Any time you push a commit to MAIN branch, `push_to_dune.py` will save your changes into Dune directly. You can run this manually too if you want.\n\n2. For CSVs, update the files in the `/uploads` folder. `upload_to_dune.py` will run on commit, or can be run manually. The table name in Dune will be `dune.team_name.dataset_\u003cfilename\u003e`.\n\n---\n\n### Query Management Scripts\n\nYou'll need python and pip installed to run the script commands. If you don't have a package manager set up, then use either [conda](https://www.anaconda.com/download) or [poetry](https://python-poetry.org/) . Then install the required packages:\n\n```\npip install -r requirements.txt\n```\n\n| Script | Action                                                                                                                                                    | Command |\n|---|-----------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| `pull_from_dune.py` | updates/adds queries to your repo based on ids in `queries.yml`                                                                                           | `python scripts/pull_from_dune.py` |\n| `push_to_dune.py` | updates queries to Dune based on files in your `/queries` folder                                                                                          | `python scripts/push_to_dune.py` |\n| `preview_query.py` | gives you the first 20 rows of results by running a query from your `/queries` folder. Specify the id. This uses Dune API credits | `python scripts/preview_query.py 2615782` |\n| `upload_to_dune.py` | uploads/updates any tables from your `/uploads` folder. Must be in CSV format, and under 200MB. | `python scripts/upload_to_dune.py` |\n\n---\n\n### Things to be aware of\n\n💡: Names of queries are pulled into the file name the first time `pull_from_dune.py` is run. Changing the file name in app or in folder will not affect each other (they aren't synced). **Make sure you leave the `___id.sql` at the end of the file, otherwise the scripts will break!**\n\n🟧: Make sure to leave in the comment `-- already part of a query repo` at the top of your file. This will hopefully help prevent others from using it in more than one repo.\n\n🔒: Queries must be owned by the team the API key was created under - otherwise you won't be able to update them from the repo.\n\n➕: If you want to add a query, add it in Dune app first then pull the query id (from URL `dune.com/queries/{id}/other_stuff`) into `queries.yml`\n\n🛑: If you accidently merge a PR or push a commit that messes up your query in Dune, you can roll back any changes using [query version history](https://dune.com/docs/app/query-editor/version-history).\n\n---\n\n### For Contributors\n\nI've set up four types of issues right now:\n- `bugs`: This is for data quality issues like miscalculations or broken queries.\n- `chart improvements`: This is for suggesting improvements to the visualizations.\n- `query improvements`: This is for suggesting improvements to the query itself, such as adding an extra column or table that enhances the results.\n- `generic questions`: This is a catch all for other questions or suggestions you may have about the dashboard.\n\nIf you want to contribute, either start an issue or go directly into making a PR (using the same labels as above). Once the PR is merged, the queries will get updated in the frontend.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrokin%2Fhonk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastrokin%2Fhonk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastrokin%2Fhonk/lists"}