Git Product home page Git Product logo

localedb-py's Introduction

localedb-py

Python bindings for LocaleDB.

Dependencies

Setup

pip install git+https://github.com/momacs/localedb-py.git

Remember to activate your venv of choice unless you want to go system-level.

Usage

from localedb import LocaleDB
db = LocaleDB()

print(db.get_rand_us_state_fips(3))   # select three random U.S. state  FIPS codes
print(db.get_rand_us_county_fips(3))  # select three random U.S. county FIPS codes

db.set_disease('COVID-19')      # set COVID-19 as the current disease
db.set_locale_by_name('Italy')  # set Italy as the current locale

db.set_locale_by_name('US', 'Alaska')  # set the state of Alaska as the current locale
db.set_locale_by_us_fips('02')         # same

db.set_locale_by_name('US', 'Alaska', 'Anchorage')  # set the county of Anchorage, Alaska as the current locale
db.set_locale_by_us_fips('02020')                   # same

conf = db.get_dis_dyn_by_day_conf(20,77)  # get the time series of confirmed cases from day 20 to day 77
print(conf.flatten().tolist())            # print that time series

The last instruction should result in the following being printed:

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 3, 5, 5, 5, 7, 16, 17, 21, 30, 35, 45, 59, 61, 63, 66, 68, 75, 82, 86, 89, 99, 105]

Usage Examples

The following computational notebooks (located in a separate repository) demonstrate the usage and capabilities of the package:

License

This project is licensed under the BSD License.

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.