Code Monkey home page Code Monkey logo

ipumspy's People

Contributors

dtburk avatar franfabrizio avatar joegrover avatar khwilson avatar renae-r avatar sondalex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipumspy's Issues

`wait_for_extract(UsaExtract)` seems to hang

I haven't been able to get ipums.wait_for_extract() to work when passing a UsaExtract object (just sits there forever 5 minutes, but you know, that's basically forever), but it does work when I pass an extract number and collection.

To replicate:

from ipumspy import IpumsApiClient, UsaExtract

ipums = IpumsApiClient(USER_API_KEY)


extract = UsaExtract(["us2012b", "us2014b"], ["age", "sex", "farm"],)

ipums.submit_extract(extract=extract)
ipums.wait_for_extract(extract)

Unable to `pip install ipumspy`

I'm trying to install ipumspy. I did it in the past without problem. Are you awhare of this issue?

Collecting ipumspy
  Using cached ipumspy-0.4.0-py3-none-any.whl (68 kB)
Requirement already satisfied: requests[use-chardet-on-py3]<3.0.0,>=2.26.0 in /bbkinghome/mbarrera/miniconda3/lib/python3.10/site-packages (from ipumspy) (2.28.1)
Collecting PyYAML<6.0.0,>=5.4.1
  Using cached PyYAML-5.4.1.tar.gz (175 kB)
  Installing build dependencies ...   Getting requirements to build wheel ... error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [62 lines of output]
      /tmp/pip-build-env-td9_64m_/overlay/lib/python3.10/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
      !!
      
              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.
      
              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
      
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

Suggest small change in documentation

Thanks for this package. I am finding it super useful.

I have one small suggestion on this page: https://ipumspy.readthedocs.io/en/latest/variables.html

In this example:

from ipumspy import readers

# read ddi and data
ddi_codebook = readers.read_ipums_ddi([ddi xml file path])
ipums_df = readers.read_microdata(ddi_codebook, [data file path])

The square brackets around [ddi xml file path] and [data file path] make it seem like these functions expect a list. I'd suggest:

ddi_xml_file_path = ...
data_file_path = ...
ddi_codebook = readers.read_ipums_ddi(ddi_xml_file_path)
ipums_df = readers.read_microdata(ddi_codebook, data_file_path)

Unable to download with Python 3.11

I am having issues downloading ipumspy and all of its associated dependencies with Python 3.11. Most of the required dependencies are outdated, including numpy which is seemingly giving me the most trouble. Any suggestions how I can resolve this conflict in dependencies?

remove pickles from testing

Currently the test to for extract_to_dict() relies on a pickle object in the test fixtures rather than creating an extract object every time. As the pickle format is sometimes updated and older formats may eventually no longer be readable by the pickle module, this may become a sustainability issue in the future. An area for improvement.

Typos in Python Documentation

In the Get Started documentation for ipumspy, there is a typo in the DOWNLOAD_DIR variable:

ddi_file = list(DOWLOAD_DIR.glob("*.xml"))[0]

DOWNLOAD is missing the "N".

Additionally, the two lines directly below should change "ipumsy" to "readers" as ipumsy does not work and readers is imported at the top of the documentation:

ddi = ipumspy.read_ipums_ddi(ddi_file)
ipums_df = ipumspy.read_microdata(ddi, DOWNLOAD_DIR / ddi.file_description.filename)

This will also make that block consistent with the code block in the Read an IPUMS Extract section.

Dependency `click` conflicts with common data science packages.


Installation of ipumspy requires dependency click<8.0.0,>=7.0.0. This dependency conflicts with recent versions of dtale, jupyter-plotly and maybe with other common data science packages.

It can be troublesome in data science virtual environments to fix this issue post installation.

Would it be possible to update pyproject.toml click = "^7.0.0" dependency to:

[15] click = ">=7.0.0"

better error messaging around unused kwargs

Joe pointed out that you can pass a non-usa collection name to UsaExtract() and not get an error, which is fine, but we should probably have a warning or something that clarifies that.

extract_status function doesn't check for HTTP 404 return status

If the user tries to request a non-existent extract number, the API will return:

{
    "status": 404,
    "error": "Not Found"
}

ipumspy currently doesn't correctly detect this and so tries to parse this as if it were an actual extract payload.

Ideally it would detect this and relay the error message to the user.

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.