{"id":21315903,"url":"https://github.com/zmjones/untreaties","last_synced_at":"2025-07-12T01:31:32.647Z","repository":{"id":71676705,"uuid":"10370579","full_name":"zmjones/untreaties","owner":"zmjones","description":"scrapes, cleans, transforms, and searches United Nations treaty data","archived":false,"fork":false,"pushed_at":"2015-03-15T03:36:46.000Z","size":3953,"stargazers_count":17,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-06T12:22:30.586Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"treaties.un.org","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/zmjones.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":"2013-05-29T22:17:26.000Z","updated_at":"2024-08-03T23:12:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"777e696d-1d91-4442-a51a-a24de95a52f3","html_url":"https://github.com/zmjones/untreaties","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zmjones/untreaties","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmjones%2Funtreaties","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmjones%2Funtreaties/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmjones%2Funtreaties/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmjones%2Funtreaties/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmjones","download_url":"https://codeload.github.com/zmjones/untreaties/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmjones%2Funtreaties/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264923080,"owners_count":23683716,"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-21T18:28:25.704Z","updated_at":"2025-07-12T01:31:32.080Z","avatar_url":"https://github.com/zmjones.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository contains a set of scripts that allow the retrieval of the [United Nations' Treaty Collection](http://treaties.un.org/), and transformation of the retrieved data. Please [open an issue](https://github.com/zmjones/untreaties/issues/new) if you find any errors or would like to suggest a feature. Pull requests are welcome!\n\n### Getting the data\n\nYou can clone (see below) or [download](https://github.com/zmjones/untreaties/archive/master.zip) the data contained in this repository or scrape it using `un_data.py`, which requires `pandas`, `requests`, and `beautifulsoup4`. These dependencies are listed in `requirements.txt`. The script will generate `index.csv` along with a folder containing the treaty data itself (`treaties`) and a folder containing declarations made by participants (contained in `declarations`).\n\n```shell\ngit clone git@github.com:zmjones/untreaties.git\ncd untreaties\npip install -r requirements.txt\npython un_data.py\n```\n\n### Transforming the data\n\nThe [R](http://cran.us.r-project.org/) script `utilities.R` contains a number of functions that make working with the raw data easier. You can load these functions by simply sourcing the file. It requires `stringr`, `lubridate`, and `plyr`. The `loadData` function allows the user to load a specific treaty given its chapter and treaty numbers, which are passed as strings. You can optionally expand the column names (if needed). If you choose to expand the column names you can also transform the data into a country-year format, given a start year and an end year (both passed as strings).\n\n```S\nsource(\"utilities.R\")\nloadData(chap = \"10\", treaty = \"2\")\nloadData(chap = \"10\", treaty = \"2\", expand = TRUE)\nloadData(chap = \"10\", treaty = \"2\", expand = TRUE, panel = TRUE, syear = \"1945\", eyear = \"2013\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmjones%2Funtreaties","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmjones%2Funtreaties","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmjones%2Funtreaties/lists"}