File size: 4,210 Bytes
1228d99 3037af2 d8aa567 1228d99 7b418f8 da917d7 1627318 da917d7 1627318 1228d99 7b418f8 1627318 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
---
license: apache-2.0
language:
- en
task_categories:
- text-classification
- summarization
size_categories:
- n<1K
tags:
- text
- pandas
- scrapy
---
# Sovereign States Dataset
This dataset provides a comprehensive list of sovereign states, along with their **common and formal names**, **membership within the UN system**, and details on **sovereignty disputes and recognition status**. The data was originally scraped from [Wikipedia's List of Sovereign States](https://en.wikipedia.org/wiki/List_of_sovereign_states) and processed for clarity and usability.
## Dataset Features
- **Common Name**: The commonly used name of the country or state.
- **Formal Name**: The official/formal name of the country or state.
- **Membership within the UN System**: Indicates whether the country is a UN member state or has observer status.
- **Sovereignty Dispute**: Any sovereignty or territorial disputes involving the state.
- **Further Information**: Additional details regarding the state’s recognition and status.
---
## Dataset Details
### Source
- **Website**: [Wikipedia - List of Sovereign States](https://en.wikipedia.org/wiki/List_of_sovereign_states)
- **Scraped On**: [12 January 2025]
- **Data Cleaning**: Non-ASCII characters, unnecessary symbols, and text within brackets were cleaned for clarity.
### Format
- **File Type**: CSV
- **Encoding**: UTF-8
- **Number of Rows**: [196]
- **Columns**:
- `Common Name`
- `Formal Name`
- `Membership within the UN System`
- `Sovereignty Dispute`
- `Further Information`
---
## Citation
If you use this dataset in your research or project, please cite it as follows:
@misc{sovereign_states_dataset,
- author = {Your Name or Team Name},
- title = {Sovereign States Dataset},
- year = {2025},
- url = {https://huggingface.co/datasets/your-username/sovereign-states-dataset}
}
## Acknowledgments
Special thanks to the contributors of Wikipedia for maintaining and updating the List of Sovereign States. This dataset was scraped and processed using:
- Python
- Scrapy
- Pandas
- Regex for cleaning data
## Contributing
Contributions are welcome! If you spot an issue or have suggestions for improvement:
1. Fork the repository.
2. Make your changes.
3. Submit a pull request.
## Who are the source Data producers ?
The data is machine-generated (using web scraping) and subjected to human additional treatment.
below, I provide the script I created to scrape the data (as well as my additional treatment):
```
import scrapy
class StatesspiderSpider(scrapy.Spider):
name = 'statesspider'
start_urls = ['https://en.wikipedia.org/wiki/List_of_sovereign_states']
def parse(self, response):
rows = response.xpath('//table[contains(@class, "wikitable")][1]//tr') # Locate the main table
for row in rows[1:]: # Skip the header row
common_and_formal_names = row.xpath('td[1]//text()').getall() # First column
membership_within_un_system = row.xpath('td[2]//text()').getall() # Second column
sovereignty_dispute = row.xpath('td[3]//text()').getall() # Third column
further_information = row.xpath('td[4]//text()').getall() # Fourth column
# Clean up and join text lists
common_and_formal_names = ' '.join(common_and_formal_names).strip()
membership_within_un_system = ' '.join(membership_within_un_system).strip()
sovereignty_dispute = ' '.join(sovereignty_dispute).strip()
further_information = ' '.join(further_information).strip()
yield {
'Common and Formal Names': common_and_formal_names,
'Membership within the UN System': membership_within_un_system,
'Sovereignty Dispute': sovereignty_dispute,
'Further Information': further_information,
}
```
## Usage
### Loading the Dataset in Python
To use the dataset in Python, you can load it using pandas:
```python
import pandas as pd
# Load the dataset
url = "https://huggingface.co/datasets/your-username/sovereign-states-dataset/resolve/main/sovereign_states_cleaned_final.csv"
df = pd.read_csv(url)
# Preview the dataset
print(df.head())
``` |