Skip to main content

Aus Bills

This is a package is for obtaining parliament bills for Australian governments.

Install via pip

pip install ausbills

Current governments that are supported:

  • Australian Federal Government
  • Australian Capital Territory Government

Australian Federal Government

This module had methods for scraping the Australian Federal Parliament website, using beautiful soup.

The bills are scraped to get data from both the house and the senate:

from ausbills.federal_parliment import get_all_bills, Bill
all_bills = get_all_bills()
print(all_bills)
bill_five = all_bills[5]

all_bills.data is a list of all current bills and some basic data in the form of a dict. The rest of the data may be obtained via the Bill() object.

bill = Bill(bill_id=bill_five["id"])
print(bill.summary)
print(bill.sponsor)
print(bill.bill_text_links)
print(bill.explanatory_memoranda_links)

or you can use the url string to create an instance of Bill():

bill = Bill(bill_five["url"])

or the id

bill = Bill(bill_five["id"])

You may also change the date format:

bill = Bill(bill_five["id"],"DD/MM/YYYY")

and you can get the data dump as a dict:

bill.data

NSW Government

Using the nsw_parliament module, you can scrape bills from the NSW Parliament website

Use nsw_all_bills to return a list of bill dicts (each dict represents an individual bill).

from nsw_parliament import nsw_all_bills

print(nsw_all_bills)
print('The first bill returned: ' + nsw_all_bills[0])

You can return more data on an individual bill using the nsw_Bill object:

from nsw_parliament import nsw_all_bills, nsw_Bill

all_the_bills_mate = nsw_all_bills
print(nsw_Bill(all_the_bills_mate).status)

ACT Legislative Assembly

This module allows you to scrape bill data from the Australian Capital Territory Legislative Assembly website using beautiful soup.

Similarly to the Federal Parliament and WA modules, you can scrape all the bills like this:

from act_legislative_assembly import act_all_bills as all_bills

print(all_bills)
print('The 5th Bill is ' + all_bills[4])

You can interact with individual bills with the act_Bill() object:

all_the_bills = all_bills
some_bill = act_Bill(all_the_bills[5])
print(some_bill.title)

Contributing

We use BeautifulSoup to scrape the bills from the Bills websites. so make sure you become familiar with the docs here.

Fork the repo and install requirements

pip3 install -r requirements.txt

Each state should their own bills and corresponding website. Add a python file for a new state in the /ausbills dir. the python file should have the naming convention: wa_parliment.py for Western Australia for example. Make sure we all agree on method/object/output conventions (use federal_bills as a guide). Once you are happy, update the README on method usage and make a Pull Request.


Upgrade package

Change VERSION in setup.py, then:

git tag -a 0.1.0 -m "update version 0.1.0"
git push origin 0.1.0

Todo

  • Write better usage docs

Release files for ausbills 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ausbills 0.4.0
File Size Uploaded
ausbills-0.4.0.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ausbills 0.4.0
File Interpreter ABI Platform
ausbills-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 32.4 kB

Release files / ausbills-0.4.0.tar.gz

Download URL ausbills-0.4.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c19a4ce6ceef5a2228f9014788c2ad6835f08cf5de14ee49bf7b961a54511049
BLAKE2b-256 checksum
How to use checksums
edc7b88866beee4e310cc2f266a61a9e16de7e64c3b91c1087aae3240a38e61a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

Release files / ausbills-0.4.0-py3-none-any.whl

Download URL ausbills-0.4.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
404aad71053cbb4aed032bd98e9f12ed2a960bae450c6f39328bfde2769e2543
BLAKE2b-256 checksum
How to use checksums
0bc89b6223e9f14d117b44756c2afc06b5ceb30d7ba9f61acc4eed38a48331a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6

Release history Release notifications | RSS feed

1.0.0

2 release files

0.8.0

2 release files

This release

0.4.0 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.9

1 release file

0.0.8

2 release files

0.0.7

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page