egbakou / restcountries.net Goto Github PK
View Code? Open in Web Editor NEW⚡Offline dotnet standard library to get information about countries
Home Page: https://lioncoding.com
License: MIT License
⚡Offline dotnet standard library to get information about countries
Home Page: https://lioncoding.com
License: MIT License
https://restcountries.eu is down.
I will add a new source soon.
Thank you for this package, it's very helpful in our project. One issue I've come across is the lack of updates on the source (restcountries.eu). Namely Great Britain still being listed as being in the EU. There's a fork running on restcountries.com that's more up to date. See https://gitlab.com/amatos/rest-countries
A thing to consider is to support changing source urls or straight out switching over to this other data source.
i installed the nuget into my .netstandard library, but when i call the api with an of the methods , i can get an error like no countries returned. am i missing something or the site is down?
To update the dataset, create a new file named "states.json" and save it in the /src/RESTCountries.NET/Services
directory. The JSON structure of the file should be as follows:
[
{
"countryCode": "country code",
"states": [
{
"name": "State name",
"cities": [
"Cities in this state"
]
},
{
"name": "Another State name",
"cities": [
"Cities in this state"
]
}
]
},
{
"countryCode": "another country code",
"states": [
{
"name": "State name",
"cities": [
"Cities in this state"
]
},
{
"name": "Another State name",
"cities": [
"Cities in this state"
]
}
]
}
]
Please ensure that the country alpha 2 code is obtained from the existing data.json
file.
To simplify the process, you may automate the task using a script
For the: Republic of Croatia I get:
---HRK | Croatian kuna
However, Croatia has adopted the EUR per 01/01/2023:
https://inshorts.com/en/news/croatia-adopts-euro-as-its-currency-from-today-1672579201630
When including this package in a project marked for AOT there are issues with the JSON deserialiser, which currently uses (inefficient) reflection.
InvalidOperationException: Reflection-based serialization has been disabled for this application. Either use the source generator APIs or explicitly configure the 'JsonSerializerOptions.TypeInfoResolver' property.
Related to #23
Hi,
thank you for your lib, I saw it on reddit and it fullfills a need I have very recently.
Sadly it seems the IDD is not well implemented.
Here you have a Root and a Suffix, weil Suxffix is a list.
E.g. for Germany your Root is +4 and your suffix is 9.
E.g. for Vatican Country you list the Root as +3 with 2 suffixes: 79 and 906698
E.g. for DomRep your root is +1 and 3 sufffices.
That seems "wrong":
Compared with https://countrycode.org
In Germany +49 is the complete country code. So the logic would be Take Root + Suffix.
In Vatican it seems +379 is the country code. So the logic would be take Root + 1 suffix (no way to find out which one, else then knowing)
In DomRep it seems +1 is the country code. So the logic would be ignore suffix, just take Root.
Can we have a logic in which the country code is a property allways or maybe have the IDD and Suffix all countries the same way?
Just found that the API URL found at https://github.com/egbakou/RESTCountries.NET/blob/master/src/RESTCountries.NET/Constants/APIResources.cs
is down at this moment and points to nowhere. The new URL is https://restcountries.com/v3.1 .
Thank you for reading this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.