Giter Site home page Giter Site logo

statscanpy's Introduction

statscanpy

A package for using data from Statistics Canada Web Services with python.

Installation

pip install git+https://github.com/andrewjdyck/statscanpy#egg=statscanpy

Usage

import statscanpy as scp

# Search for farm debt
search = scp.datasearch('labour force')
search.print_results()

# initialize product class for productId 14100287.
# This will download metadata for the product cube.
product = scp.Product('14100287')

# read the product metadata
meta = product.metadata

# dimensions of the product cube
dims = product.dimensions

# get details on the sub-dimensions
subdims = product.dimension_members_to_df()

# Canada's seasonally adjusted unemployment rate for ages 15+
coord = '1.7.1.1.1.1.0.0.0.0'

# Get the information about the data series
product.get_series_info(coord)
print(product.series_info)

# Retrieve the most recent 10 observations for the data series
data = product.get_coordinate_data()

Census data retrieval

import statscanpy as sc

# Initiate the class
census = sc.Census()

# Get Census profile data with default parameters
result = census.get_cpr_geo()
print(result)

# Prairies, 2016
dguid = '2016A00014'
result = census.get_cpr_geo(dguid=dguid)

# Census geographies
geos = census.get_census_geo()

# Census indicators
# Population for Canada geography
popn = census.get_census_indicator()

Links

Statistics Canada Web Data Services: https://www.statcan.gc.ca/eng/developers/wds

User guide: https://www.statcan.gc.ca/eng/developers/wds/user-guide

Census web data services: https://www12.statcan.gc.ca/wds-sdw/index-eng.cfm

Dissemination Geography Unique Identifier (DGUID): https://www150.statcan.gc.ca/n1/pub/92f0138m/92f0138m2019001-eng.htm

statscanpy's People

Contributors

andrewjdyck avatar

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.