Giter Site home page Giter Site logo

Comments (6)

xmunoz avatar xmunoz commented on August 16, 2024

Thanks for the bug report! Taking a look now...

from sodapy.

xmunoz avatar xmunoz commented on August 16, 2024

Which domain are you connecting to? Can you provide the client setup code so that I can try to reproduce the issue?

from sodapy.

xmunoz avatar xmunoz commented on August 16, 2024

I googled the dataset identifier and it led me to this site (which currently appears to be down):
https://data.calgary.ca/d/y8as-bmzj

Screenshot from 2021-02-20 17-24-29

from sodapy.

patrickleclair-GORDONFN avatar patrickleclair-GORDONFN commented on August 16, 2024

The code I used was:

client = Socrata("data.calgary.ca",app_token="")
results = client.get_all("y8as-bmzj")

from sodapy.

xmunoz avatar xmunoz commented on August 16, 2024

Alright, I'm able to query this domain now. Let me try to reproduce. Something else I did notice though is that above you put the response in results, but then iterate over an undefined data variable. Could this be causing the bug?

from sodapy.

xmunoz avatar xmunoz commented on August 16, 2024

I'm sorry, I wasn't able to reproduce the problem that you're having. Here is the code that I used.

from sodapy import Socrata
from csv import DictWriter

client = Socrata("data.calgary.ca",app_token="")
results = client.get_all("y8as-bmzj")
with open("coc_test.csv", "w", newline="", encoding="utf-8") as line_file:
    csv_writer = DictWriter(line_file, fieldnames=["id","sample_site","sample_date",
                                                   "parameter","numeric_result","result_qualifier",
                                                   "formatted_result","result_units","latitude_degrees","longitude_degrees","site_key"])
    for row in results:
        csv_writer.writerow(row)


After this finished running, it correctly produced a file with 293,039 unique rows.

$ uniq -u coc_test.csv | wc -l
293039

I'm going to close this issue. Please feel free to re-open if I missed something.

from sodapy.

Related Issues (20)

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.