Git Product home page Git Product logo

ocha-dap / hdx-python-utilities Goto Github PK

View Code? Open in Web Editor NEW
9.0 17.0 6.0 1.39 MB

A range of helpful utilities for Python developers including streaming tabular data, date parsing, JSON and YAML handling, dictionary and list utilities

Home Page: https://hdx-python-utilities.readthedocs.io/en/latest/

License: MIT License

Python 100.00%
datetime hdx json logging utilities yaml stream-processing tabular-data

hdx-python-utilities's Introduction

Build Status Coverage Status Ruff Downloads

The HDX Python Utilities Library provides a range of helpful utilities for Python developers. Note that these are not specific to HDX.

  1. Easy downloading of files with support for authentication, streaming and hashing
  2. Retrieval of data from url with saving to file or from data previously saved
  3. Date parsing utilities
  4. Loading and saving JSON and YAML (inc. with OrderedDict)
  5. Dictionary and list utilities
  6. HTML utilities (inc. BeautifulSoup helper)
  7. Compare files (eg. for testing)
  8. Simple emailing
  9. Easy logging setup and error logging
  10. Path utilities
  11. Text processing
  12. Encoding utilities
  13. Check valid UUID
  14. Easy building and packaging

For more information, please read the documentation.

This library is part of the Humanitarian Data Exchange (HDX) project. If you have humanitarian related data, please upload your datasets to HDX.

hdx-python-utilities's People

Contributors

ianhopkinson avatar mcarans avatar turnerm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hdx-python-utilities's Issues

Tests fail on Windows for hdx-analysis-scripts because no encoding is provided for `compare_files`

Tests for https://github.com/OCHA-DAP/hdx-analysis-scripts which pass in GitHub Actions fail on Windows because the compare_files function does not specify an encoding at this line for the open calls:

open(path1).read().splitlines(), open(path2).read().splitlines()

When no encoding is provided Python uses the system default encoding which is different for Ubuntu and Windows. This can be resolved by explicitly specifying an encoding for the open calls of utf-8. An optional encoding argument could be provided to the compare_files function which would handle rare cases when non-UTF-8 files were to be compared. This makes the reasonable assumption that both files to be compared would have the same encoding.

Package hdx-python-utilities for conda-forge

This package is a dependency for hdx-python-country, see OCHA-DAP/hdx-python-country#14

/cc @turnerm

Dependencies:

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.