Giter Site home page Giter Site logo

egbakou / restcountries.net Goto Github PK

View Code? Open in Web Editor NEW
286.0 4.0 18.0 365 KB

⚡Offline dotnet standard library to get information about countries

Home Page: https://lioncoding.com

License: MIT License

C# 100.00%
restcountries-api dotnet-standard csharp-library countries countries-autocomplete countries-data countries-json

restcountries.net's Issues

Support for other sources

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.

It doesnt work

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?

[feature]: add support for country states

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

No AOT support

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.

IDD seems not correct

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.