Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

alphagov/govukurllookup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status codecov GitHub tag

Helper module for using the GOV.UK content API

Helper module for returning data from the GOV.UK content API.

Take a pandas series as input, which should be a list of urls, without the https://www.gov.uk slug.

Returns a list of dictionaries from the response json.

Usage

The module makes use of pandas for a range of functions when dealing with tabular data.

import pandas as pd
from govukurllookup import *

# Import urls from a csv file

urls = pd.read_csv('url_file.csv')

foo = govukurls(urls.url)

# In initialising the object, the list of urls will be deduplicated:
# Number of duplicates removed:

len(foo.urls) - len(foo.dedupurls)

# Run a lookup on the content API

foo.lookup()

# A list of dicts is returned

foo.urldicts

About

Helper module for using the GOV.UK content API

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages