You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

resources.py 748B

123456789101112131415161718192021
  1. def City(response):
  2. return {
  3. 'city': response.city.name,
  4. 'continent_code': response.continent.code,
  5. 'continent_name': response.continent.name,
  6. 'country_code': response.country.iso_code,
  7. 'country_name': response.country.name,
  8. 'dma_code': response.location.metro_code,
  9. 'latitude': response.location.latitude,
  10. 'longitude': response.location.longitude,
  11. 'postal_code': response.postal.code,
  12. 'region': response.subdivisions[0].iso_code if response.subdivisions else None,
  13. 'time_zone': response.location.time_zone,
  14. }
  15. def Country(response):
  16. return {
  17. 'country_code': response.country.iso_code,
  18. 'country_name': response.country.name,
  19. }