|
1818 | 1818 | " collaborators_chart, \"Source: GitHub Innovation Graph economy collaborators data.\"\n", |
1819 | 1819 | ")" |
1820 | 1820 | ] |
| 1821 | + }, |
| 1822 | + { |
| 1823 | + "cell_type": "code", |
| 1824 | + "execution_count": 83, |
| 1825 | + "id": "682b3c86", |
| 1826 | + "metadata": {}, |
| 1827 | + "outputs": [ |
| 1828 | + { |
| 1829 | + "name": "stdout", |
| 1830 | + "output_type": "stream", |
| 1831 | + "text": [ |
| 1832 | + "Wrote data/GitHub/developers.csv\n", |
| 1833 | + "Wrote data/GitHub/repositories.csv\n", |
| 1834 | + "Wrote data/GitHub/organizations.csv\n", |
| 1835 | + "Wrote data/GitHub/git_pushes.csv\n", |
| 1836 | + "Wrote data/GitHub/languages.csv\n", |
| 1837 | + "Wrote data/GitHub/economy_collaborators.csv\n", |
| 1838 | + "Wrote data/GitHub/language_to_cluster_mapping.csv\n" |
| 1839 | + ] |
| 1840 | + }, |
| 1841 | + { |
| 1842 | + "name": "stderr", |
| 1843 | + "output_type": "stream", |
| 1844 | + "text": [ |
| 1845 | + "/Users/ssarva/west-africa-labor-market-analysis/.venv/lib/python3.14/site-packages/urllib3/connectionpool.py:1110: InsecureRequestWarning: Unverified HTTPS request is being made to host 'raw.githubusercontent.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings\n", |
| 1846 | + " warnings.warn(\n" |
| 1847 | + ] |
| 1848 | + } |
| 1849 | + ], |
| 1850 | + "source": [ |
| 1851 | + "from pathlib import Path\n", |
| 1852 | + "\n", |
| 1853 | + "output_dir = Path(\"data/GitHub\")\n", |
| 1854 | + "output_dir.mkdir(parents=True, exist_ok=True)\n", |
| 1855 | + "\n", |
| 1856 | + "github_csv_sources = {\n", |
| 1857 | + " \"developers.csv\": f\"{INNOVATION_GRAPH_DATA_URL}/developers.csv\",\n", |
| 1858 | + " \"repositories.csv\": f\"{INNOVATION_GRAPH_DATA_URL}/repositories.csv\",\n", |
| 1859 | + " \"organizations.csv\": f\"{INNOVATION_GRAPH_DATA_URL}/organizations.csv\",\n", |
| 1860 | + " \"git_pushes.csv\": f\"{INNOVATION_GRAPH_DATA_URL}/git_pushes.csv\",\n", |
| 1861 | + " \"languages.csv\": f\"{INNOVATION_GRAPH_DATA_URL}/languages.csv\",\n", |
| 1862 | + " \"economy_collaborators.csv\": (\n", |
| 1863 | + " f\"{INNOVATION_GRAPH_DATA_URL}/economy_collaborators.csv\"\n", |
| 1864 | + " ),\n", |
| 1865 | + " \"language_to_cluster_mapping.csv\": LANGUAGE_CLUSTER_MAPPING_URL,\n", |
| 1866 | + "}\n", |
| 1867 | + "\n", |
| 1868 | + "for filename, url in github_csv_sources.items():\n", |
| 1869 | + " response = requests.get(\n", |
| 1870 | + " url,\n", |
| 1871 | + " timeout=30,\n", |
| 1872 | + " verify=filename != \"language_to_cluster_mapping.csv\",\n", |
| 1873 | + " )\n", |
| 1874 | + " response.raise_for_status()\n", |
| 1875 | + " output_path = output_dir / filename\n", |
| 1876 | + " output_path.write_bytes(response.content)\n", |
| 1877 | + " print(f\"Wrote {output_path}\")" |
| 1878 | + ] |
1821 | 1879 | } |
1822 | 1880 | ], |
1823 | 1881 | "metadata": { |
|
0 commit comments