{"id":29702550,"url":"https://github.com/devgateway/costya","last_synced_at":"2025-08-17T20:10:50.130Z","repository":{"id":78413223,"uuid":"318627710","full_name":"devgateway/costya","owner":"devgateway","description":"Display how much AWS cost ya","archived":false,"fork":false,"pushed_at":"2024-01-22T22:54:51.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-23T13:00:07.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/devgateway.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,"zenodo":null}},"created_at":"2020-12-04T20:27:14.000Z","updated_at":"2021-11-09T13:57:44.000Z","dependencies_parsed_at":"2025-07-23T12:39:41.227Z","dependency_job_id":"50bf6225-5bd5-4023-be24-9c54b7053fbf","html_url":"https://github.com/devgateway/costya","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devgateway/costya","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fcostya","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fcostya/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fcostya/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fcostya/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devgateway","download_url":"https://codeload.github.com/devgateway/costya/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devgateway%2Fcostya/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270899582,"owners_count":24664720,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2025-07-23T12:39:35.177Z","updated_at":"2025-08-17T20:10:50.106Z","avatar_url":"https://github.com/devgateway.png","language":"PHP","readme":"# Costya\n\nA tool to show how much AWS cost ya. Displays billing itemization for a given month by Expensify code. Responses from\nAWS Cost Explorer are cached to avoid extra charges.\n\nThe standard output is formatted as a CSV table, suitable for import into Expensify. The output fields are:\n\n    Merchant,Date,Amount,Category,Tag\n\nAWS bills will be merged into a single multi-page PDF receipt; attach it to each imported expense.\n\nThe script will parse invoice dates, and find the latest one. It will query AWS expenses for the calendar month that\nprecedes it. This date will also be output in the resulting CSV.\n\nA CSV file that matches AWS `Project` tags with Expensify billing codes should be called `codes.csv`. If the first\nline doesn't contain a colon (`:`) character in the second column, it's considered a header and skipped.\n\nThe billing code in the first data line is the default code. Billing to this code shows a warning. It is used for:\n\n1. Billing of the tags that don't have a matching code.\n2. Adjusting for rounding errors.\n\nThe amount actually charged by Amazon is calculated as a sum of invoice totals.\n\nAmazon charges fractional cents per Project tag, so subtotals by billing code don't add up precisely when rounded to\nwhole cents. The script adjusts the default billing code's subtotal to accomodate for that. A warning is displayed in\nthis case.\n\n## Installation\n\nRequires [Composer](https://getcomposer.org/), PHP CLI, jq, pdftk, and pdftotext (poppler-utils package).\n\nRequires AWS credentials in the environment under profile [costya]\n\nTo install Composer dependencies, run:\n\n    make install\n\n## Usage Example\n\nTo verify billing codes, you need to grab `policy.json` from Expensify. Log in to your account, enable Development\nConsole, filter by XHR requests, and open a report. The required JSON will be returned for a POST request to:\n\n    https://www.expensify.com/api?command=Policy_Get\n\nDownload Amazon invoice PDFs to the project directory, and run:\n\n    make\n\n\n## Error messages\n\n    Code RG:4339-CRP-ASDB-4 from codes.csv not found in active.txt\nThis usually means that there's a code coming from policy.json that may have been deactivated in the period of time being reported. Check with Finance if that's so and update the code in codes.csv\n\n    PHP Fatal error:  Uncaught Aws\\Exception\\CredentialsException: 'costya' not found in credentials file in /mnt/c/Users/fferr/IdeaProjects/costya/vendor/aws/aws-sdk-php/src/Credentials/CredentialProvider.php:861\n\nMake sure that you have the credentials in any of the places mentioned [here.](https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/guide_credentials_profiles.html). Recommended to put in credentials file in .aws for the profile [costya] \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgateway%2Fcostya","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevgateway%2Fcostya","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevgateway%2Fcostya/lists"}