{"id":23158759,"url":"https://github.com/greendelta/usio","last_synced_at":"2025-06-10T08:35:19.300Z","repository":{"id":23440856,"uuid":"26804269","full_name":"GreenDelta/usio","owner":"GreenDelta","description":null,"archived":false,"fork":false,"pushed_at":"2015-06-22T14:17:36.000Z","size":4948,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-10T03:46:20.468Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GreenDelta.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}},"created_at":"2014-11-18T10:36:17.000Z","updated_at":"2020-02-14T13:14:27.000Z","dependencies_parsed_at":"2022-08-22T01:10:26.552Z","dependency_job_id":null,"html_url":"https://github.com/GreenDelta/usio","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/GreenDelta%2Fusio","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Fusio/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Fusio/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GreenDelta%2Fusio/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GreenDelta","download_url":"https://codeload.github.com/GreenDelta/usio/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234841,"owners_count":20905852,"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-17T22:27:24.464Z","updated_at":"2025-04-04T18:40:59.171Z","avatar_url":"https://github.com/GreenDelta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"usio\n====\nThis project provides scripts for creating an US input-output database for the\nuse in [openLCA](http://www.openlca.org/). It creates a direct requirements \nmatrix from the [BEA make and use tables](http://www.bea.gov/industry/io_benchmark.htm). \nThis DR matrix is than combined with a satellite matrix and converted to a set of \nprocess dates sets in the [olca-schema format](https://github.com/GreenDelta/olca-schema) \nwhich can be imported into openLCA. The satellite matrix is based on the \nsatellite matrix of the OpenIO database but was mapped to the flows of the \nopenLCA reference list.\n\n![matrix-diff example](diff_example.png)\n\nUsage\n-----\nIn order to build the database using the scripts in this repository you need to \nhave Python 3.x and [NumPy](http://www.numpy.org/) installed (for Windows you \ncan find NumPy binaries here: http://www.lfd.uci.edu/~gohlke/pythonlibs/). If\nthis is the case, just download this repository and execute the `make.py` \nscript:\n\n    python make.py\n    \nThis will create a usio\\_[description].zip file in the `build` directory.\n\n\nData flow\n---------\nThe data package is created with the following steps:\n\n1. The original BEA make and use tables are converted to a simple CSV matrix\nformat (see the matrix format description below).\n\n2. From these make and use tables a direct requirements matrix is calculated\nas described in [Concepts and Methods of the U.S. Input-Output Accounts][1] \n(see Chapter 12).\n\n3. This direct requirement matrix is then combined with a satellite matrix\nand converted into a set of process data sets. The CSV tables of the satellite\nmatrix and a JSON-LD package template are already prepared and stored in the \ndata folder.\n\n[1]:http://www.bea.gov/papers/pdf/IOmanual_092906.pdf \"Karen J. Horowitz, Mark A. Planting: Concepts and Methods of the U.S. Input-Output Accounts. 2006\"\n\n\nConfiguration\n-------------\nBy default the BEA make and use tables _after redefinition_ are taken to \ncalculate the direct requirement matrix but the script also works with the\ntables before redefinitions (which are also included in the data folder). The\ncreation of the direct requirements matrix can be configured to apply scrap\nadjustments and to remove value added sectors or not:\n\n    # no scrap adjustments and removal of value added sectors\n    import iodb    \n    iodb.create_drc_matrix(make_csv_file, use_csv_file, dr_csv_file)\n\n    # now with scrap adjustments and removal of value added sectors\n    iodb.create_drc_matrix(make_csv_file, use_csv_file, drc_csv_file, \n                           scrap='Scrap', value_added=['VA1', 'VA2'])\n\nAdditionally, the different build steps are independent from each other and\nconsume and produce simple data formats. Thus, it should be possible to update\nthe data sources (e.g. by using the BEA 2007 statistics) without much effort.\n\n\nThe CSV matrix format\n---------------------\nThe data processing is based on matrices that are stored in a simple CSV file\nformat which describes the content of a matrix with 3 columns: a row identifier\n(a string), a column identifier (a string), the value of the respective row\nand column (a number). Here is an example of how the content of such a file may\nlook like:\n\n    \"A\",\"A\",300\n    \"A\",\"B\",25\n    \"A\",\"Scrap\",3\n    \"B\",\"A\",30\n    \"B\",\"B\",360\n    \"B\",\"C\",20\n    \"B\",\"Scrap\",2\n    \"C\",\"B\",15\n    \"C\",\"C\",250\n\nThis repository contains also a small tool for comparing two matrices in this \nformat. See the [diffexample.py script](scripts/diffexample.py) in the scripts\nfolder for how to use this tool. Additionally, there is a Excel macro for\nconverting matrices in Excel into this matrix format in the script folder.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreendelta%2Fusio","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreendelta%2Fusio","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreendelta%2Fusio/lists"}